http://stackoverflow.com/comment/47581070
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29722889
has text: I tried stopPropagation(); with and without brackets but the click still propagates and I added both just as an example beacause I tried e.stopPropagation; e.stopPropagation(); seconDiv.stopPropagation; secondDiv.stopPropagation(); and even preventDefault.
score: 0

http://stackoverflow.com/q/29734014
has comment: http://stackoverflow.com/comment/47602502
downvote count: 0
has comment: http://stackoverflow.com/comment/47601264
tagged with: javascript
has answer: http://stackoverflow.com/a/29734320
possible better answer: http://stackoverflow.com/a/29734165
has answer: http://stackoverflow.com/a/29734165
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47601492
has body: I have a simple program that takes in an input and then should show that input multiplied up to 100. I am new to this, but have tried to get it to work before posting here. I have the link to the program that I am referring to. I want the result to be shown, but I cannot figure out why it is not showing. You can see what I have below. I think I do not have the html and javascript hooked up properly. Here is my html: &lt;body&gt; &lt;input type="number" id="NumToBMultiplied" class="value" placeholder="Enter an integer" /&gt; &lt;input type='submit' id='RunProg' class='button' /&gt; &lt;p&gt; id='result'&lt;/p&gt; &lt;/body&gt; Here is my Javascript: h = document.getElementByID('NumToBMultiplied'); var result = document.getElementbyID('RunProg').addEventListener('click', function () { for (i = 0; i &lt; 100; i++) return i * h; } }); document.getElementByID('result').innerHTML = result; http://jsbin.com/wayejequxu/1/edit?html,js,output Any help is appreciated!
answer count: 4
favorite count: 0
upvote count: 1
accepted answer: http://stackoverflow.com/a/29734320
has answer: http://stackoverflow.com/a/29734597
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29734249
has comment: http://stackoverflow.com/comment/47601886
score: 1
has title: Trying to get the result of javascript function using innerHTML

http://stackoverflow.com/q/29815717
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47765827
has title: Reset View after leaving it - SAPUI5
favorite count: 0
has answer: http://stackoverflow.com/a/29817390
type: AnsweredQuestion
tagged with: sapui5
upvote count: 1
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29817390
has body: I need to reset my Search-view on Button Click. That means when I leave the view through the "close"-Button and go back to the search, it is supposed to be reloaded: Inputs empty Result-table hidden as if it is reloaded I just cant make sure to reload the view because once it is called, its saved in the Core and cant be deleted, without being unable to get it again. Right now I am setting the Visibility to false and true to open or close the view, but I cant find the magic code here!^^ Here is what happens when I press the close Button: handleSchliessen : function () { var p = this.getView('suche'); p.setVisible(false); sap.ui.getCore().byId("Handler").getModel("datenModel").refresh(true); this.callbackMethod.call(this.callbackObject); }, Any help would be great guys, I can provide more Code if you need, its just too long :)
score: 0

http://stackoverflow.com/comment/47605312
score: 0
type: Comment
has text: No, I want to remove the double quotes for each digit and also the comma after each key value. Also, need more space between Key Value too.
type: AnswerComment
comment on: http://stackoverflow.com/a/29735613

http://stackoverflow.com/comment/47699305
has text: @kel, enlighten me please, I found nothing with this specific subject
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29784576
score: 0

http://stackoverflow.com/comment/47518947
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29690890
has text: my scripts are in

http://stackoverflow.com/comment/47587401
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29726613
has text: Can you persuade your customers to host and include a tiny script that your widget can use?

http://stackoverflow.com/a/29784742
has comment: http://stackoverflow.com/comment/47699749
type: Answer
has comment: http://stackoverflow.com/comment/47699823
has comment: http://stackoverflow.com/comment/47700097
answers question: http://stackoverflow.com/q/29784475
has comment: http://stackoverflow.com/comment/47700163
has body: you cant store function calls as strings in an array when you want to call them. (Well you could somehow but that would be evel) maybe do something like var options: { newGame: ['n', 'new game', 'game'], loadGame: ['l', 'load game', 'game'] } var functions: { newGame: function() { /* your function */ }, loadGame: function() { /* your function */ } } Then in uiPromt you could do for (functionName in options) { // check if playerInput is in options[functionName] array if (options[functionName].indexOf(playerInput) &gt;= 0) { functions[functionName]() // call function break } }
has comment: http://stackoverflow.com/comment/47700541
score: 0
has comment: http://stackoverflow.com/comment/47700154

http://stackoverflow.com/a/29734205
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29733746
answers question: http://stackoverflow.com/q/29733746
has body: You have overlapping (invisible) elements from your content that covers your links. The following CSS: #content{ padding-top: 110px; } forces your content to sit on top of your navigation links blocking them from being clicked. There are several solutions to this. One way to confirm that this is the case is to remove #content{ padding-top: 110px; } and replace it with #content{ position:relative; top:110px; } A better way to debug the issue is to open Chrome DevTools and inspecting the #content div to see where the box model overlaps your links and adjust accordingly.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/122155680
downvote count: 0
has comment: http://stackoverflow.com/comment/47602200

http://stackoverflow.com/comment/47731450
has text: No problem. Feel free to add this as the accepted answer so others can potentially benefit from your question.
comment on: http://stackoverflow.com/a/29756395
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/55049040
has comment: http://stackoverflow.com/comment/127176422
has comment: http://stackoverflow.com/comment/119721163
type: Answer
has comment: http://stackoverflow.com/comment/121568519
answers question: http://stackoverflow.com/q/29722270
has body: You now can use async import(): import fs = require('fs'); and then: fs.readdir('./someDir', (err, files) =&gt; { files.forEach(file =&gt; { const module = import('./' + file).then(m =&gt; m.callSomeMethod(); ); // or const module = await import('file') }); });
has comment: http://stackoverflow.com/comment/119720632
downvote count: 2
upvote count: 44
has comment: http://stackoverflow.com/comment/96850723
score: 42

http://stackoverflow.com/a/29694450
score: 4
answers question: http://stackoverflow.com/q/29694302
has body: Sadly, when ES5 added the date/time format to JavaScript, they made a mistake: They said that strings without a timezone should be treated as though they were GMT, not local time; but in ISO-8601, which is what they based the format on, strings without timezones are local time. ES6 changes it to match ISO-8601, so now we have a problem: Some engines use the ES5 rule (current Firefox, for instance), and some engines use the ES6 rule (current Chrome, for instance). So you need to specify a timezone on those strings to parse them reliably, cross-browser: If they're meant to be GMT, it's easy: Just add a Z to them: var dt = new Date(entry.date + "Z"); If they're meant to be local time, it's harder, because you have to allow for DST, so the offset to use varies by the date. var dt = new Date(entry.date + "Z"); dt.setMinutes(dt.getMinutes() + dt.getTimezoneOffset()); I think that still works correctly on DST boundaries, but you'll want to test. You can handle this yourself, or you can use a library to handle it for you. There are several choices, just search for "JavaScript date library". One quite popular one at the moment (no pun) is http://momentjs.com. Example of #1, just adding Z to make those times GMT/UTC reliably: Date.prototype.addHours = function(h) { this.setHours(this.getHours() + h); return this; }; Date.prototype.addMins = function(h) { this.setMinutes(this.getMinutes() + h); return this; }; var data = [{ "date": "2015-05-01T15:00:00.000", "hours": 4, "mins": 30 }, { "date": "2015-05-04T15:00:00.000", "hours": 4, "mins": 30 }]; data.forEach(function(entry) { snippet.log(entry.date + " =&gt; " + new Date(entry.date + "Z")); }); &lt;!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 --&gt; &lt;script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"&gt;&lt;/script&gt; Example of #2, assuming the strings are local time: Date.prototype.addHours = function(h) { this.setHours(this.getHours() + h); return t…
type: Answer
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/47584384
type: Comment
type: QuestionComment
has text: Thanks for your answer tpie. I thought that by using `customPromise : function` I was inferring the scope in my work.controller (customPromise). I'm not sure of exactly what I have to do. I looked through the ui.router wiki, and still don't get where I have to go. Should I wrap my entire `customPromise` in the controller around the code where I use my `$http` request?
comment on: http://stackoverflow.com/q/29712871
score: 0

http://stackoverflow.com/comment/47786095
comment on: http://stackoverflow.com/q/29816459
score: 0
has text: Can you try adding `page=4` in `commentpost.php?...`
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29755352
downvote count: 0
has comment: http://stackoverflow.com/comment/47650201
has comment: http://stackoverflow.com/comment/47644283
has body: It is not possible. It would pose a huge security risk to allow javascript to open programs on client side.
type: Answer
has comment: http://stackoverflow.com/comment/47642843
upvote count: 1
has comment: http://stackoverflow.com/comment/47643114
has comment: http://stackoverflow.com/comment/47643416
answers question: http://stackoverflow.com/q/29755307
score: 1

jhipster
tag name: jhipster
type: Tag
tags question: http://stackoverflow.com/q/29834623

http://stackoverflow.com/comment/47635283
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/29750169
has text: My guess would be that you are returning a new string from the query filter rather than modifying the original person object. Thats where the issue is. I will prefer if you give it a shot first, rather than me posting the answer. If you are unable to do it, I will help.

http://stackoverflow.com/comment/47716709
has text: Good solution, please note however that by using siblings() you select all nodes, so the code works in this specific case but not if you have, say a tag at the same level. You can use siblings('.btn') or siblings('button') to select all siblings elements having class "btn" or being a button, respectively.
type: Comment
comment on: http://stackoverflow.com/a/29794039
type: AnswerComment
score: 0

http://stackoverflow.com/q/29754362
favorite count: 0
has answer: http://stackoverflow.com/a/29754497
answer count: 4
has answer: http://stackoverflow.com/a/29754454
score: 2
downvote count: 0
type: UnansweredQuestion
has body: I have a @Html.TextBox and a @Html.CheckBox, no matter what is entered in @Html.TextBox , the moment I click checkbox for windows authentication I want my @Html.TextBox to become EMPTY and DISABLED @using (Html.BeginForm()) { &lt;div id="emailtext"&gt;@Html.TextBoxFor(m=&gt;m.Email)&lt;/div&gt; &lt;div id="chk"&gt;@Html.CheckBox("CheckWindowsAuth") @Html.Label("Use windows authntication")&lt;/div&gt; } My jquery which is not helpinng &lt;script src="my jquery path"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ $("#chk").click(function(){ $("#emailtext").val(""); $("#emailtext").attr("disabled", "disabled"); }); }); &lt;/script&gt; Please help me know where I'm going wrong... Thanks
has answer: http://stackoverflow.com/a/29754439
type: Question
upvote count: 2
has title: Unable to disable TextBox on CheckBox selection
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29755038
has comment: http://stackoverflow.com/comment/47640932

http://stackoverflow.com/a/29758220
type: Answer
has body: The first time the WebFont API gets loaded, the webfont.js file defines a top-level object on window.WebFont. This holds the methods for loading the fonts, DOM manipulation to add a stylesheet, and (by the looks of it) some cross-browser compatibility check. If you attempt reloading this script again, it seems to reuse the 1st window.WebFont object and therefore disregards any new fonts you pass to it. Solution: Nullify the window.WebFont and its generated &lt;script&gt; + &lt;link rel="stylesheet"&gt; tags Here's the corrections made to the above script: window.loadWebFont = function(fontFamilies, onComplete) { if(window._WEBFONT_SCRIPT) { console.log("Removing previous Google Web Fonts elements."); window._WEBFONT_SCRIPT.parentNode.removeChild(window._WEBFONT_SCRIPT); window._WEBFONT_SCRIPT = null; if(window._WEBFONT_CSS) { window._WEBFONT_CSS.parentNode.removeChild(window._WEBFONT_CSS); window._WEBFONT_CSS = null; } window.WebFont = null; } if(!_.isArray(fontFamilies)) fontFamilies = [fontFamilies]; else fontFamilies = fontFamilies.concat(); for(var f=fontFamilies.length; --f&gt;=0;) { var theFont = fontFamilies[f]; if(!theFont || $.trim(theFont)==="") { fontFamilies.splice(f, 1); } } var loadCount = fontFamilies.length; window.WebFontConfig = { "fontloading": function(a, b) { if((--loadCount)&lt;=0) { var css = $('link[href^="http://fonts.googleapis.com/"]'); //Store the &lt;link&gt; element, not the jQuery/Zepto result window._WEBFONT_CSS = css[0]; onComplete(); } }, google: { families: fontFamilies } }; var wf = window._WEBFONT_SCRIPT = document.createElement('script'); wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; wf.type = 'text/javascript'; wf.async = 'true'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(wf, s); };
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29756605
downvote count: 0

http://stackoverflow.com/comment/47674804
has text: Thanks, @Aramil. Again the issue is that I have no problem containing the images inside the div (I could even do that by setting them as background images and allowing them to fill the height of the div), the problem is trying to allow them to overflow the div whilst positioning the centre of each image at the vertical middle of the div. (If the div height happens to be larger than the image height, they will sit inside it.) [Take a look at this fiddle](http://jsfiddle.net/e4effect/gko2b3er/9/) to see the effect I am trying to achieve
score: 0
comment on: http://stackoverflow.com/a/29770302
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/47606311
type: Comment
type: AnswerComment
score: 0
has text: No, HTML does not include any functionality to prevent blur/focus events from triggering if an element is hidden, so you have to write it yourself. I'm not exactly sure what else you might be expecting.
comment on: http://stackoverflow.com/a/29729903

highcharts
tags question: http://stackoverflow.com/q/29828455
tags question: http://stackoverflow.com/q/29714843
tags question: http://stackoverflow.com/q/29828703
tags question: http://stackoverflow.com/q/29780701
tags question: http://stackoverflow.com/q/29813731
tags question: http://stackoverflow.com/q/29781041
tags question: http://stackoverflow.com/q/29695198
tags question: http://stackoverflow.com/q/29801891
tags question: http://stackoverflow.com/q/29799201
tags question: http://stackoverflow.com/q/29742658
tags question: http://stackoverflow.com/q/29690760
tags question: http://stackoverflow.com/q/29689235
tags question: http://stackoverflow.com/q/29841107
tags question: http://stackoverflow.com/q/29782430
tags question: http://stackoverflow.com/q/29809700
tags question: http://stackoverflow.com/q/29840526
tags question: http://stackoverflow.com/q/29773381
tags question: http://stackoverflow.com/q/29833018
tags question: http://stackoverflow.com/q/29771495
tags question: http://stackoverflow.com/q/29837190
tags question: http://stackoverflow.com/q/29751372
tags question: http://stackoverflow.com/q/29796728
tags question: http://stackoverflow.com/q/29756635
tags question: http://stackoverflow.com/q/29753234
tags question: http://stackoverflow.com/q/29728212
tags question: http://stackoverflow.com/q/29764857
tags question: http://stackoverflow.com/q/29840170
tags question: http://stackoverflow.com/q/29773873
tags question: http://stackoverflow.com/q/29837087
tags question: http://stackoverflow.com/q/29795968
tags question: http://stackoverflow.com/q/29726145
tags question: http://stackoverflow.com/q/29788790
tags question: http://stackoverflow.com/q/29792273
tags question: http://stackoverflow.com/q/29754610
tags question: http://stackoverflow.com/q/29697426
tags question: http://stackoverflow.com/q/29797039
tags question: http://stackoverflow.com/q/29801284
tags question: http://stackoverflow.com/q/29770889
type: Tag
tags question: http://stackoverflow.com/q/29747023
tags question: http://stackoverflow.com/q/29729723
tag name: highcharts
tags question: http://stackoverflow.com/q/29697091
tags question: http://stackoverflow.com/q/29788382

http://stackoverflow.com/a/29832209
has comment: http://stackoverflow.com/comment/47820416
has comment: http://stackoverflow.com/comment/47820540
has comment: http://stackoverflow.com/comment/47790988
upvote count: 0
score: -1
has comment: http://stackoverflow.com/comment/47822401
type: Answer
answers question: http://stackoverflow.com/q/29831077
has body: Bootstrap modal has a option remote, but on Bootstrap v3.3.0 is deprecated and will be removed in v4. You can use jQuery.load. For example $( "#some-click" ).on('click', function() { var userId = button.data('id'); //get user id here //jQuery.load set html with modal and user details by id $( "#user" ).load( "/not-here.php", { id:userId }); });
has comment: http://stackoverflow.com/comment/47820549
downvote count: 1
has comment: http://stackoverflow.com/comment/47790968

javascript
tags question: http://stackoverflow.com/q/29699753
tags question: http://stackoverflow.com/q/29776116
tags question: http://stackoverflow.com/q/29774030
tags question: http://stackoverflow.com/q/29838083
tags question: http://stackoverflow.com/q/29834625
tags question: http://stackoverflow.com/q/29728327
tags question: http://stackoverflow.com/q/29692960
tags question: http://stackoverflow.com/q/29768260
tags question: http://stackoverflow.com/q/29836686
tags question: http://stackoverflow.com/q/29751852
tags question: http://stackoverflow.com/q/29694098
tags question: http://stackoverflow.com/q/29739326
tags question: http://stackoverflow.com/q/29761048
tags question: http://stackoverflow.com/q/29689093
tags question: http://stackoverflow.com/q/29705878
tags question: http://stackoverflow.com/q/29709720
tags question: http://stackoverflow.com/q/29719029
tags question: http://stackoverflow.com/q/29743904
tags question: http://stackoverflow.com/q/29793650
tags question: http://stackoverflow.com/q/29799070
tags question: http://stackoverflow.com/q/29815843
tags question: http://stackoverflow.com/q/29773562
tags question: http://stackoverflow.com/q/29802244
tags question: http://stackoverflow.com/q/29756499
tags question: http://stackoverflow.com/q/29716184
tags question: http://stackoverflow.com/q/29692732
tags question: http://stackoverflow.com/q/29724462
tags question: http://stackoverflow.com/q/29817181
tags question: http://stackoverflow.com/q/29731212
tags question: http://stackoverflow.com/q/29701216
tags question: http://stackoverflow.com/q/29818457
tags question: http://stackoverflow.com/q/29840214
tags question: http://stackoverflow.com/q/29699276
tags question: http://stackoverflow.com/q/29716201
tags question: http://stackoverflow.com/q/29751396
tags question: http://stackoverflow.com/q/29773947
tags question: http://stackoverflow.com/q/29813503
tags question: http://stackoverflow.com/q/29817768
tags question: http://stackoverflow.com/q/29778920
tags question: http://stackoverflow.com/q/29752920
tags question: http://stackoverflow.com/q/29726466
tags question: http://stackoverflow.com/q/29695422
tags question: http://stackoverflow.com/q/29764242
tags question: http://stackoverflow.com/q/29788889
tags question: http://stackoverflow.com/q/29765227
tags question: http://stackoverflow.com/q/29836997
tags question: http://stackoverflow.com/q/29729611
tags question: http://stackoverflow.com/q/29746917
tags question: http://stackoverflow.com/q/29827705
tags question: http://stackoverflow.com/q/29803130
tags question: http://stackoverflow.com/q/29842016
tags question: http://stackoverflow.com/q/29726706
tags question: http://stackoverflow.com/q/29705040
tags question: http://stackoverflow.com/q/29732870
tags question: http://stackoverflow.com/q/29817806
tags question: http://stackoverflow.com/q/29832713
tags question: http://stackoverflow.com/q/29806169
tags question: http://stackoverflow.com/q/29799806
tags question: http://stackoverflow.com/q/29748405
tags question: http://stackoverflow.com/q/29832416
tags question: http://stackoverflow.com/q/29716066
tags question: http://stackoverflow.com/q/29744514
tags question: http://stackoverflow.com/q/29838803
tags question: http://stackoverflow.com/q/29708572
tags question: http://stackoverflow.com/q/29842672
tags question: http://stackoverflow.com/q/29818963
tags question: http://stackoverflow.com/q/29828016
tags question: http://stackoverflow.com/q/29787182
tags question: http://stackoverflow.com/q/29804389
tags question: http://stackoverflow.com/q/29725002
tags question: http://stackoverflow.com/q/29777719
tags question: http://stackoverflow.com/q/29811420
tags question: http://stackoverflow.com/q/29734290
tags question: http://stackoverflow.com/q/29738684
tags question: http://stackoverflow.com/q/29815895
tags question: http://stackoverflow.com/q/29784721
tags question: http://stackoverflow.com/q/29770341
tags question: http://stackoverflow.com/q/29830498
tags question: http://stackoverflow.com/q/29767306
tags question: http://stackoverflow.com/q/29844569

http://stackoverflow.com/q/29822739
possible better answer: http://stackoverflow.com/a/29822973
has title: inline display of list elements through external .js file
has answer: http://stackoverflow.com/a/29822989
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/29822973
type: AnsweredQuestion
has body: I have created a simple html page using external script and external styling. In it a menu list is displayed using < li > element. The problem in my page is that the list elements are displayed vertically in block fashion, though they were supposed to be displayed inline. I cannot find the error for correction, so here I'm attaching all the relevant codes. Please help me know the error if you find it. Thank you. WEB pAGE Hello abcde myscript.js function myfunction() { var x = document.getElementsByClassName("mmm"); x[0].innerHTML = x[0].innerHTML = ' Abc DEF GHI JKL '; } mystyle.css h1 { font-family:Comic Sans MS; } .div1 { position:fixed; height:110px; width:1350px; background-color:Teal; color:White; margin:0px; padding:0px; } .mmm{ position:fixed; top:115px; left:419px; background-color:#69A005; color:White; height:50px; width:1000px; } .div3{ position:fixed; top:115px; background-color:#69A005; color:White; height:50px; width:430px; } ul#menu{ color:white; margin:5px; padding:0px; } li#m1 { display:inline; margin:10px; padding:10px; color:White; } a#tn { display:inline; width:90px; background-color:#000000; padding:5px; }
type: Question
has answer: http://stackoverflow.com/a/29822986
accepted answer: http://stackoverflow.com/a/29822986
tagged with: javascript
score: 0
answer count: 3

http://stackoverflow.com/comment/47856770
type: AnswerComment
has text: @Nitika I am glad this works for you. Please be sure to accept the answer so be can both gain a little rep
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29747489

http://stackoverflow.com/q/29775488
tagged with: javascript
has comment: http://stackoverflow.com/comment/47681771
score: 0
tagged with: filter
answer count: 1
has comment: http://stackoverflow.com/comment/47681699
has title: angularjs filter search on objects with different hashcode
tagged with: angularjs
type: UnansweredQuestion
has body: Okay the title became abit long but let me start out by an explanation: I have a service called: divisionService From this i have a function that returns a list of all Divisions in my system. I am using this list to populate a select: Alle Then i have a HTTP request that selects my users (plus some extra statistics) $http.get(api.getUrl('getUserStats', null)) .success(function (response) { auoc.users = response; }); The response might look something like this: [Object, Object, Object, Object, Object] Where each object looks like this: object = { avg_score : 5 completed_modules: user: object{ division: object{id: 19, location_id: 5, name: "Udvikling", organization_id: 1 }, division_id: 19 id: 1 image_path: "img/profileIcon.png" } } I hope you can read the above there are seriously alot of data inside that user object. Now i wish to bind my select to be sort my list of users by their division object. So i thought it would be ng-model="search.division" and then on my repeat do : ng-repeat="user in auoCtrl.users | filter: search" Sadly when changing the value of the select everything got hidden So i guess my question is. how do i search for the division in this example? :s
has answer: http://stackoverflow.com/a/29789686
type: Question
has comment: http://stackoverflow.com/comment/47682443
has comment: http://stackoverflow.com/comment/47681798

http://stackoverflow.com/comment/64568795
type: Comment
score: 1
has text: Warning: this appears to require jQueryUI's 'draggable' functionality to be included, yet jQuery is not listed in the question or answer. Would help to augment the answer with this requirement.
type: AnswerComment
comment on: http://stackoverflow.com/a/29823506

http://stackoverflow.com/comment/47787890
has text: I did a sysout in my action class with gson.toJSON(str) generated value and it gave the string as **[{"queueNamesList": [{"Name": "Inbasket"}, {"Name": "Lending Option\"s\""}, {"Name": "Work Queue"}]}]** In the JSP page the code I am using is **var jsonFormattedResult = '<s:property value="#session['jsonFormattedResult']" escapeHtml = "false" />';** which was comming in the similar way I mentioned in the post as **var jsonFormattedResult = '[{"queueNamesList": [{"Name": "Inbasket"}, {"Name": "Lending Option\"s\""}, {"Name": "Work Queue"}]}]';**
type: Comment
comment on: http://stackoverflow.com/a/29810071
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47765991
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29819525
has text: Nevertheless I can understand the complexity level! another workaround is that loading the popup in your Main.controller.js You may face hiccups there!

http://stackoverflow.com/comment/48777693
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/30340571
type: Comment
has text: as Aron mentioned in the comments - this problem is reproducable using the standard `fetch` syntax in chrome - so I'm pretty sure it has nothing to do with marty itself. but will try and update all the same ;)

http://stackoverflow.com/comment/47768890
type: AnswerComment
type: Comment
score: 2
has text: While this may answer the question it’s always a good idea to put some text in your answer to explain what you're doing. Read [how to write a good answer](http://stackoverflow.com/help/how-to-answer).
comment on: http://stackoverflow.com/a/29820433

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

http://stackoverflow.com/q/29763461
favorite count: 0
has comment: http://stackoverflow.com/comment/47658494
has comment: http://stackoverflow.com/comment/47659618
has comment: http://stackoverflow.com/comment/47659371
tagged with: php
has comment: http://stackoverflow.com/comment/47659882
has answer: http://stackoverflow.com/a/29764219
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47658798
score: 2
has comment: http://stackoverflow.com/comment/47658564
has title: Decrement-ing Number when a javascript parameter is passed
upvote count: 2
tagged with: mysql
has comment: http://stackoverflow.com/comment/47658896
type: Question
has comment: http://stackoverflow.com/comment/47659739
has comment: http://stackoverflow.com/comment/47659777
has comment: http://stackoverflow.com/comment/47659005
accepted answer: http://stackoverflow.com/a/29764219
tagged with: javascript
has comment: http://stackoverflow.com/comment/47658533
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
has body: See I'm having this problem when i pass an argument from my database to a javascript function i get a number that decrements and also it's a different number from what i expect to show up the format of what im passing is (####-####) <?php include 'connect.php'; session_start(); if(isset($_SESSION['name']) && $_SESSION['name'] != "") { ?> Log Out Hello, <?php echo $_SESSION['name']; ?> All Books Journals Guidelines Patient Education + <input type="search" name="search" class="inputs" placeholder="Search Articles" value="<?php echo isset($_POST['search']) ? $_POST['search'] : ""; ?>" /> Search And Or <input type="search" class="inputs" placeholder="Filter Results" name="filter" style="width:70%;" value='<?php echo (isset($_POST['filter']) ? $_POST['filter'] : ''); ?>' /> Filter <?php if((isset($_POST['submit'])) || (isset($_POST['btn_filter']))) { $search = mysqli_real_escape_string($con,$_POST['search']); $sql = (strcmp($search, "") == true ? "SELECT * FROM tbl_additionals JOIN tbl_general_info WHERE tbl_general_info.reference_number LIKE '%$search%' OR tbl_general_info.title LIKE '%$search%' OR tbl_general_info.author LIKE '%$search%' OR tbl_additionals.abstract LIKE '%$search%'" : "SELECT * FROM tbl_additionals JOIN tbl_general_info WHERE tbl_general_info.reference_number LIKE '%$search%' OR tbl_general_info.title LIKE '%$search%' OR tbl_general_info.author LIKE '%$search%' OR tbl_additionals.abstract LIKE '%$search%' LIMIT 30"); $query = mysqli_query($con, $sql); if(mysqli_num_rows($query) != 0) { while($run = mysqli_fetch_assoc($query)) { $reference = (string)$run['reference_number']; $title = (strlen($run['title']) > 121) ? substr($run['title'], 0, strpos(wordwrap($run['title'], 121), "\n")) . '...' : $run['title']; echo ' '; echo " "; echo " "; echo " ". strtoupper($title) ." "; echo " "; echo " "; echo " "; echo $run['reference_number']; echo " Authors :Dr.Michael RamsayDr.Lars BenitezDr.Kevin John Pascual "; echo " "; echo " "; echo " "; echo " "; echo ($run[…
has comment: http://stackoverflow.com/comment/47658562

http://stackoverflow.com/comment/47733924
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29783851
type: Comment
has text: Also, how is your xml?

send
type: Tag
tag name: send
tags question: http://stackoverflow.com/q/29727980

http://stackoverflow.com/comment/47552222
score: 1
has text: Furthermore , you will need to mark it accepted in order to get the (answered) effect...
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29708176

jquery
tags question: http://stackoverflow.com/q/29692296
tags question: http://stackoverflow.com/q/29787799
tags question: http://stackoverflow.com/q/29711866
tags question: http://stackoverflow.com/q/29742593
tags question: http://stackoverflow.com/q/29692848
tags question: http://stackoverflow.com/q/29773166
tags question: http://stackoverflow.com/q/29750585
tags question: http://stackoverflow.com/q/29780681
tags question: http://stackoverflow.com/q/29759163
tags question: http://stackoverflow.com/q/29777189
tags question: http://stackoverflow.com/q/29833231
tags question: http://stackoverflow.com/q/29744608
tags question: http://stackoverflow.com/q/29840170
tags question: http://stackoverflow.com/q/29725865
tags question: http://stackoverflow.com/q/29773873
tags question: http://stackoverflow.com/q/29742622
tags question: http://stackoverflow.com/q/29771607
tags question: http://stackoverflow.com/q/29738160
tags question: http://stackoverflow.com/q/29772811
tags question: http://stackoverflow.com/q/29732746
tags question: http://stackoverflow.com/q/29816785
tags question: http://stackoverflow.com/q/29764373
tags question: http://stackoverflow.com/q/29843262
tags question: http://stackoverflow.com/q/29700391
tags question: http://stackoverflow.com/q/29791137
tags question: http://stackoverflow.com/q/29783701
tags question: http://stackoverflow.com/q/29773521
tags question: http://stackoverflow.com/q/29732074
tags question: http://stackoverflow.com/q/29831406
tags question: http://stackoverflow.com/q/29700386
tags question: http://stackoverflow.com/q/29842524
tags question: http://stackoverflow.com/q/29691632
tags question: http://stackoverflow.com/q/29703867
tags question: http://stackoverflow.com/q/29762116
tags question: http://stackoverflow.com/q/29708584
tags question: http://stackoverflow.com/q/29732429
tags question: http://stackoverflow.com/q/29779216
tags question: http://stackoverflow.com/q/29785557
tags question: http://stackoverflow.com/q/29832171
tags question: http://stackoverflow.com/q/29706179
tags question: http://stackoverflow.com/q/29765111
tags question: http://stackoverflow.com/q/29719246
tags question: http://stackoverflow.com/q/29795636
tags question: http://stackoverflow.com/q/29731428
tags question: http://stackoverflow.com/q/29799915
tags question: http://stackoverflow.com/q/29816689
tags question: http://stackoverflow.com/q/29692554
tags question: http://stackoverflow.com/q/29778061
tags question: http://stackoverflow.com/q/29813235
tags question: http://stackoverflow.com/q/29704156
tags question: http://stackoverflow.com/q/29701078
tags question: http://stackoverflow.com/q/29798524
tags question: http://stackoverflow.com/q/29744600
tags question: http://stackoverflow.com/q/29729472
tags question: http://stackoverflow.com/q/29770557
tags question: http://stackoverflow.com/q/29722599
tags question: http://stackoverflow.com/q/29741627
tags question: http://stackoverflow.com/q/29747733
tags question: http://stackoverflow.com/q/29786640
tags question: http://stackoverflow.com/q/29807700
tags question: http://stackoverflow.com/q/29821946
tags question: http://stackoverflow.com/q/29757314
tags question: http://stackoverflow.com/q/29790726
tags question: http://stackoverflow.com/q/29724431
tags question: http://stackoverflow.com/q/29732132
tags question: http://stackoverflow.com/q/29756431
tags question: http://stackoverflow.com/q/29811619
tags question: http://stackoverflow.com/q/29756643
tags question: http://stackoverflow.com/q/29842038
tags question: http://stackoverflow.com/q/29730573
tags question: http://stackoverflow.com/q/29792042
tags question: http://stackoverflow.com/q/29762419
tags question: http://stackoverflow.com/q/29804151
tags question: http://stackoverflow.com/q/29700565
tags question: http://stackoverflow.com/q/29690952
tags question: http://stackoverflow.com/q/29775348
tags question: http://stackoverflow.com/q/29782152
tags question: http://stackoverflow.com/q/29737885
tags question: http://stackoverflow.com/q/29765724
tags question: http://stackoverflow.com/q/29771428

http://stackoverflow.com/q/29835946
has comment: http://stackoverflow.com/comment/47799156
tagged with: javascript
has comment: http://stackoverflow.com/comment/47798946
has body: I am trying to filter out items in the array that have a blank string in "EventNames.Name." In order to keep the chaining to a minimum, I separated my filter into separate variables. Here is my function: function listViewFilter(){ var NameFiltered = DateFiltered.map(function (property){ // remove blank EventNames.Name return property.EventNames.filter(function (subprop){ return subprop.Name !== ""; }); }) Filtered = NameFiltered; } It is still not returning the correct result. Can anyone help? I am wondering if I should be chaining, rather than nesting. { "EventNames":[ { "Name":"", "EventDate":"APRIL 19, 2015", "Ticket":"/losangeles/events/eventdetail/?viewNav=/event-detail&amp;eventId=undefined&amp;oid=undefined" } ], "TMEvents":[ ], "SpecialEvents":[ ], "TMEventImage":[ { "Name":"", "EventDate":"APRIL 19, 2015" } ], "Artists":[ { } ], "EventOffers":[ { } ], "CrossRoadEvents":[ ], "ImageUrls":[ { } ], "TicketUrls":[ { "Ticket":"/losangeles/events/eventdetail/?viewNav=/event-detail&amp;eventId=undefined&amp;oid=undefined" } ], "MonthVals":[ { "MonthVal":"APRIL 19 2015" } ], "EventDate":"APRIL 19 2015", "VenueName":"House of Blues Las Vegas" }
tagged with: functional-programming
upvote count: 1
linked to: http://stackoverflow.com/q/5072136
has comment: http://stackoverflow.com/comment/47798843
favorite count: 0
has comment: http://stackoverflow.com/comment/47798779
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47799153
has title: JavaScript: Why is my filter function not working?
has comment: http://stackoverflow.com/comment/47799085
has answer: http://stackoverflow.com/a/29836322
has answer: http://stackoverflow.com/a/29836276
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/48865463
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47799237

http://stackoverflow.com/a/29842333
answers question: http://stackoverflow.com/q/29842122
has body: You could use a CSRF token and exit early from your script if you detect that no or an invalid CSRF token. Almost (if not all) PHP frameworks come with support for this. Also check this question from the security community: https://security.stackexchange.com/questions/23371/csrf-protection-with-custom-headers-and-without-validating-token
has comment: http://stackoverflow.com/comment/47810829
type: Answer
has comment: http://stackoverflow.com/comment/47814081
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/53756611
has comment: http://stackoverflow.com/comment/47810946
score: -1

http://stackoverflow.com/q/29728212
upvote count: 1
type: Question
tagged with: charts
has answer: http://stackoverflow.com/a/29735454
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29735454
answer count: 1
tagged with: highcharts
has title: Highcharts pie chart slice colour intensity using colorValue
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has body: I am trying to achieve the same thing as seen here: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/treemap-coloraxis Except with a pie chart instead. I have it set up like so: $('#expenditurePie').highcharts({ chart: { plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false, backgroundColor: '#121212', height: 322, className: 'summary-chart-right' }, title: null, tooltip: { pointFormat: '{series.name}: &lt;b&gt;{point.percentage:.1f}%&lt;/b&gt;' }, plotOptions: { pie: { allowPointSelect: true, borderColor: '#000', cursor: 'pointer', dataLabels: false } }, colorAxis: { minColor: '#FFFFFF', maxColor: '#FF0000' }, series: response }); A sample of response data: ... {name: "Leisure", y: 143.55, colorValue: 3} ... It isn't working and the pie chart colours are their default. How can I do this?
type: AnsweredQuestion

http://stackoverflow.com/q/29800425
has comment: http://stackoverflow.com/comment/49048486
has title: onepage scroller apple mouse wheel doesn't work
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47729470
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47731153
has comment: http://stackoverflow.com/comment/47764084
has comment: http://stackoverflow.com/comment/47731107
has body: I am using this jQuery One Page scroll Now I got it to work with my rails app, but what I noticed later is that I want it to scroll to the next page when I scroll with my mouse wheel one step. am I doing something wrong here ? Since the demo doesn't work when I scroll with my mouse wheel. I did read the documentation and by default the mouse wheel option is on, but it still wont work. here is my jsfiddle first second
type: UnansweredQuestion
tagged with: ruby-on-rails
tagged with: css
answer count: 0
type: Question

http://stackoverflow.com/a/29732725
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29731796
has comment: http://stackoverflow.com/comment/47850539
has body: A few errors there must me fixed in your code. Please attach .setCurrentCategory() to $scope (or this) in controller as Angular realize MVVM architecture. $scope is an object that links your controllers with views. As long as you want to interact with data from controller by method setCurrentCategory you must assign it to $scope Filters - according to AngularJS documentation need expression – not curly brackets angular.module('Eggly', []) .controller('MainCtrl', function($scope) { $scope.categories = [{ "id": 0, "name": "Development" }, { "id": 1, "name": "Design" }, { "id": 2, "name": "Exercise" }, { "id": 3, "name": "Humor" }]; $scope.bookmarks = [{ "id": 0, "title": "AngularJS", "url": "http://angularjs.org", "category": "Development" }, { "id": 1, "title": "Egghead.io", "url": "http://angularjs.org", "category": "Development" }, { "id": 2, "title": "A List Apart", "url": "http://alistapart.com/", "category": "Design" }, { "id": 3, "title": "One Page Love", "url": "http://onepagelove.com/", "category": "Design" }, { "id": 4, "title": "MobilityWOD", "url": "http://www.mobilitywod.com/", "category": "Exercise" }, { "id": 5, "title": "Robb Wolf", "url": "http://robbwolf.com/", "category": "Exercise" }, { "id": 6, "title": "Senor Gif", "url": "http://memebase.cheezburger.com/senorgif", "category": "Humor" }, { "id": 7, "title": "Wimp", "url": "http://wimp.com", "category": "Humor" }, { "id": 8, "title": "Dump", "url": "http://dump.com", "category": "Humor" }]; $scope.currentCategory = null; function setCurrentCategory(category) { $scope.currentCategory = category; } $scope.setCurrentCategory = setCurrentCategory; }); &lt;link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet" /&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt; &lt;div ng-app='Eggly'&gt; &lt;div ng-controller='MainCtrl'&gt; &lt;div class="container-fluid"&gt; &lt;div class="row"&gt; &lt;div class="col-sm-3 col-m…
accepted answer of: http://stackoverflow.com/q/29731796

http://stackoverflow.com/comment/47590894
has text: plz create a jsfiddle
comment on: http://stackoverflow.com/q/29717721
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47593318
comment on: http://stackoverflow.com/a/29729832
has text: sure, please share code of the select menu items and what's the ajax response look like
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47679733
type: Comment
has text: The @Amir Popovich Answer still creates an instance of Cat. This technically does not.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29774074

datetimeoffset
type: Tag
tags question: http://stackoverflow.com/q/29801353
tag name: datetimeoffset

http://stackoverflow.com/a/30334652
upvote count: 1
has body: This error occurs because a different versions of your angular-animate and angular javascripts files.
answers question: http://stackoverflow.com/q/29824767
accepted answer of: http://stackoverflow.com/q/29824767
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/q/29722732
type: Question
tagged with: if-statement
has title: Creating slider and slide will not reset position upon sliding left
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/47580317
tagged with: slider
has body: 'use strict'; $(function(){ var width = 720; var animationSpeed = 1000; var pause = 3000; var currentSlide = 1; var $slider = $('#slider'); var $slideContainer = $slider.find('.slides'); var $slides = $slideContainer.find('.slide'); var $slidesleft = $slideContainer.find('.left'); var $slidesright = $slideContainer.find('.right'); var interval; function startSlider(){ interval = setInterval(function(){ $slideContainer.animate({'margin-left': '-='+width}, animationSpeed,function(){ currentSlide++; if (currentSlide === $slides.length) { currentSlide = 1; $slideContainer.css('margin-left', 0); } }); },pause); } function stopSlider(){ clearInterval(interval); }; $('#slidebttn').on('mouseenter', stopSlider).on('mouseleave', startSlider); startSlider(); $('#slidebttn .right').on('click', function (){ $slideContainer.animate({'margin-left': '-='+width}, animationSpeed,function(){ currentSlide++; if (currentSlide === $slides.length) { currentSlide = 1; $slideContainer.css('margin-left', 0); } }); } ); $('#slidebttn .left').on('click', function (){ $slideContainer.animate({'margin-left': '+='+width}, animationSpeed,function(){ currentSlide--; if (currentSlide === 0) { currentSlide = $slides.length; $slideContainer.css('margin-left', 720); } }); } ); }); Ok here is my code I am working with. Everything works fine until I try and slide my slider to the left. It will not repeat back to the right position. As of right now the slide right button works just fine with no problems but it refuses to slide left. Any reason I it might not be sliding left appropriately?
has answer: http://stackoverflow.com/a/29729461
accepted answer: http://stackoverflow.com/a/29729461
tagged with: game-physics
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47584253

http://stackoverflow.com/q/29773562
tagged with: jquery
has comment: http://stackoverflow.com/comment/47678831
has comment: http://stackoverflow.com/comment/47677974
has comment: http://stackoverflow.com/comment/47677627
tagged with: ajax
has comment: http://stackoverflow.com/comment/47677998
has body: The ajaxstart function is not triggering in chrome but it works fine in firefox, here is the js $(document).ready(function () { $(document).ajaxStart(function () { $("#waiting").css("display", "block"); }); $(document).ajaxComplete(function () { $("#waiting").css("display", "none"); }); }); And the HTML
has answer: http://stackoverflow.com/a/29773821
has comment: http://stackoverflow.com/comment/47678048
has comment: http://stackoverflow.com/comment/47677983
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47677701
has comment: http://stackoverflow.com/comment/47679701
downvote count: 2
has comment: http://stackoverflow.com/comment/47707962
has comment: http://stackoverflow.com/comment/47677883
has comment: http://stackoverflow.com/comment/47677716
has comment: http://stackoverflow.com/comment/47680565
has comment: http://stackoverflow.com/comment/47678381
has comment: http://stackoverflow.com/comment/47678161
tagged with: google-chrome
has answer: http://stackoverflow.com/a/29796702
type: Question
has comment: http://stackoverflow.com/comment/47677481
answer count: 2
has title: ajax loading not working in chrome
upvote count: 0
has comment: http://stackoverflow.com/comment/47721286
score: -2
has comment: http://stackoverflow.com/comment/47677602
tagged with: javascript

http://stackoverflow.com/a/29783311
has comment: http://stackoverflow.com/comment/47696786
has comment: http://stackoverflow.com/comment/47742242
has comment: http://stackoverflow.com/comment/47697026
has comment: http://stackoverflow.com/comment/47696851
has comment: http://stackoverflow.com/comment/47698490
has comment: http://stackoverflow.com/comment/47773999
type: Answer
has body: you may simply overwrite the function: document.write=function(){ alert('document.write is not allowed'); } document.write('this should be written');
answers question: http://stackoverflow.com/q/29783142
has comment: http://stackoverflow.com/comment/47775170
has comment: http://stackoverflow.com/comment/47741544
accepted answer of: http://stackoverflow.com/q/29783142
score: 0
type: AcceptedAnswer

http://stackoverflow.com/a/53959253
downvote count: 1
score: 7
answers question: http://stackoverflow.com/q/29696572
upvote count: 8
type: Answer
has body: I think you set it as var data = []; but after some time you made it like: data = 'some thing which is not an array'; then data.push('') will not work as it is not an array anymore.

http://stackoverflow.com/comment/47636149
comment on: http://stackoverflow.com/q/29733387
has text: You could always just promisify() the individual functions you happen to be using.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47575902
score: 0
type: Comment
has text: @user3630591 did you try what I gave in answer
type: AnswerComment
comment on: http://stackoverflow.com/a/29720375

http://stackoverflow.com/comment/47763559
type: QuestionComment
comment on: http://stackoverflow.com/q/29802567
has text: @JuanMendes — You can, it's just a terrible idea and it returns what you say instead of `this` which makes using a constructor function pointless.
score: 1
type: Comment

http://stackoverflow.com/comment/120104283
has text: does `watch` increases more memory resource?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/30695750

http://stackoverflow.com/comment/47721857
type: Comment
has text: Can anybody please provide an working example for the code above?
score: 0
comment on: http://stackoverflow.com/q/29796001
type: QuestionComment

http://stackoverflow.com/q/29699751
tagged with: angularjs
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I would like to know if the initialization flow of AngularJS apps is predictable in terms of the order of execution of different blocks within an HTML document. I read this question What is meant by Bootstrapping in angular JS?, which explains a lot of the process, but does not answer my question in detail. I have a plunker example http://plnkr.co/edit/boVFjHWoxdbiADq41dXC?p=preview, where I console.log() numbers, in the order that I thought they would execute. What was a bit surprising though was that the execution of the .run() block seems to be deferred. Hello Plunker! So I have a few questions: Is it safe to say that the run() block, flagged in the console by the number "2", will always be executed after the rest of the page was processed? I get that what initiates the execution of the .run() block is the call angularInit(), which is executed by the call ready() on DOM ready. Is that correct? Does that mean that, in effect, the execution of the run() block happens on the same tick, as it would if it was assigned to window.onload?
has title: Bootstrap / initialization flow of AngularJS apps
has answer: http://stackoverflow.com/a/29706373
upvote count: 1
answer count: 1
linked to: http://stackoverflow.com/q/21058213
tagged with: javascript
type: UnansweredQuestion
tagged with: execution
downvote count: 0
score: 1
favorite count: 0

http://stackoverflow.com/q/29688907
tagged with: jquery
has comment: http://stackoverflow.com/comment/47515064
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/29689050
tagged with: css
score: 2
type: AnsweredQuestion
upvote count: 2
tagged with: scroll
has comment: http://stackoverflow.com/comment/47514902
accepted answer: http://stackoverflow.com/a/29689050
has title: I need to keep a page scrolled to the bottom UNTIL the user scrolls back up
type: Question
has comment: http://stackoverflow.com/comment/47515043
has body: Ok, here's my situation: I've been working on a chatroom type website for a side-project/hobby. The current layout uses html frames. The bottom frame is the "footer", or "message input" frame. The top frame is where the public messages are displayed. I use ajax to update the top frame every second. It works fine. My issue is this: I need to be able to keep the top frame scrolled all the way to the bottom -- UNLESS the user scrolls back up to view old messages, for example. I currently have a function that keeps it scrolled down to the bottom, but every time ajax updates the page, it forces it back down to the bottom, so I can't scroll back up for more than about a second, and it's really frustrating. I have searched for a solution, but i've not found any that actually work for me. The function that I use to scroll to the bottom is as follows: function jumpToPageBottom() { $('html, body').scrollTop( $(document).height()); } It does it's job, but again, I need it to stop forcing the page to the bottom if a user scrolls back up to view older messages. UPDATE -- I should clarify, I'm using actual frames, rather than an iframe. My "index" page code is: &lt;FRAMESET ROWS="*,90"&gt; &lt;FRAME SRC="header.php" name="display" MARGINWIDTH="0" MARGINHEIGHT="0" FRAMEBORDER="NO"&gt; &lt;FRAME SRC="footer.php" name="message" SCROLLING="no" BORDERCOLOR="00FF00" MARGINWIDTH="0" MARGINHEIGHT="0"&gt; &lt;/FRAMESET&gt; And the code that refreshes my chat messages is: &lt;script id="source" language="javascript" type="text/javascript"&gt; function jumpToPageBottom() { $('html, body').scrollTop( $(document).height()); } $(function() { startRefresh(); }); function startRefresh() { setTimeout(startRefresh,1000); $.ajax({ url: 'api.php', //the script to call to get data data: "", //you can insert url argumnets here to pass to api.php //for example "id=5&amp;parent=6" dataType: 'json', //data format success: function(data) //on recieve of reply { //------------------------------------------…
tagged with: javascript
linked to: http://stackoverflow.com/q/3898130
answer count: 1
downvote count: 0

http://stackoverflow.com/a/41736603
score: 0
answers question: http://stackoverflow.com/q/29749026
has body: &lt;input id="slider" ui-jq="slider" value="val" ui-options="{ min: 1, max: 100, step: 1, value: val }" ui-event="{slideStop: 'updateModel($event)'}" class="slider slider-horizontal form-control" type="text"&gt; value = "val" do this. in your html element input set the value. where val is scope variable
type: Answer
has comment: http://stackoverflow.com/comment/70666826
has comment: http://stackoverflow.com/comment/70666490

http://stackoverflow.com/comment/47667812
type: AnswerComment
score: 0
type: Comment
has text: Yes, but I don't think that it contains the key you're looking for. Post the output in your question as an edit so I can verify
comment on: http://stackoverflow.com/a/29767927

http://stackoverflow.com/q/29814250
accepted answer: http://stackoverflow.com/a/29817191
tagged with: meteor
tagged with: twitter-bootstrap-3
has body: I'm using Meteor and Bootstrap, with the nemo64:bootstrap package. In custom.bootstrap.json I have "alerts" and "alert" on. I'm trying to capture the closed.bs.alert event in a Template events. For some reason, it won't capture. Template.alert.events({ 'closed.bs.alert .alert': function () { console.log('closed'); // does not trigger } }); Oddly, close.bs.alert does work: Template.alert.events({ 'close.bs.alert .alert': function () { console.log('closed'); // triggers } }); Also, if I add the event via jQuery, I can capture closed.bs.alert: $('.alert').on('closed.bs.alert', function () { console.log('closed'); // triggers }); So, I know I have my events formatted correctly and I know the closed.bs.alert event is triggering... but for some reason I can't catch it with Template.alert.events. Any ideas?
type: AnsweredQuestion
has title: Meteor + Bootstrap - Alert closed.bs.alert does not trigger
tagged with: twitter
has answer: http://stackoverflow.com/a/29817191
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0

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

http://stackoverflow.com/comment/47697385
has text: Or fix the code that's generating the output so it produces raw strings instead of escape sequences.
comment on: http://stackoverflow.com/q/29783439
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47715963
comment on: http://stackoverflow.com/q/29793148
has text: Please use the "edit" link under your question to correct the jsFiddle link in your question so people don't go looking at the wrong jsFiddle link. You can always correct or add to your question.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29870861
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48220233
has comment: http://stackoverflow.com/comment/48337083
has body: The filtering of the comments belongs at the message level... the problem is getting the filters down that far so you can use them properly without using global variables or something awful. For that kind of thing, I usually pass 'delegates' into my object that point to observables at the root level viewModel... This is good OO practice because the nested Message object should know nothing about the container it's held in (resist using global variables here... always tempting with JS). Once you've got that setup, the count of messages is easy (happens right at the root). The count of total comments is the aggregate counts of all your messages.filteredMessageComments which can be done in a computed at the root by iteration. Here's a simplified example using only text boxes (i.e. no options/dropdowns) but the same approach should apply. ** FIDDLE: ** http://jsfiddle.net/brettwgreen/mh1qax40/ ** HTML: ** Name Filter: Comment Filter: Message Count: Comment Count: JS: var MessagesData = [ { MessageName: 'Message One', MessageComments: [ {Comment: 'Comment One'}, {Comment: 'Comment Two'}, {Comment: 'Comment Three'} ] }, { MessageName: 'Message Two', MessageComments: [ {Comment: 'Comment One'}, {Comment: 'Comment Two'}, {Comment: 'Comment Three'} ] }, { MessageName: 'Message Three', MessageComments: [ {Comment: 'Comment One'}, {Comment: 'Comment Two'}, {Comment: 'Comment Three'} ] }]; var MessageComment = function(msgComment) { var self = this; self.Comment = ko.observable(msgComment.Comment); }; var Message = function(msg, commentFilter) { var self = this; self.MessageName = ko.observable(msg.MessageName); self.MessageComments = ko.observableArray(); $.each(msg.MessageComments, function(i, m) { self.MessageComments.push(new MessageComment(m)); }); self.FilteredMessageComments = ko.computed(function() { var results = []; $.each(self.MessageComments(), function(i, mc){ // using the injected comment filter function (an observable) // filter the comments accordingly if (mc.Co…
type: Answer
has comment: http://stackoverflow.com/comment/48176842
answers question: http://stackoverflow.com/q/29712422
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29712422
has comment: http://stackoverflow.com/comment/48179661
has comment: http://stackoverflow.com/comment/48176455
has comment: http://stackoverflow.com/comment/48329896

http://stackoverflow.com/comment/47796806
type: AnswerComment
comment on: http://stackoverflow.com/a/29834991
type: Comment
score: 1
has text: Haha yeah I did ( ͡° ͜ʖ ͡°) been coding too long today... thanks!

http://stackoverflow.com/comment/47798652
score: 0
type: AnswerComment
has text: Why can't I cite w3schools? I'm obviously new here.
type: Comment
comment on: http://stackoverflow.com/a/29835773

http://stackoverflow.com/comment/47617515
comment on: http://stackoverflow.com/a/29691350
type: Comment
has text: mmm interesting. I'm going to try
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47694036
type: Comment
score: 1
has text: It was for me an interesting subject ;)
type: AnswerComment
comment on: http://stackoverflow.com/a/29773746

http://stackoverflow.com/q/29821898
tagged with: javascript
answer count: 1
has answer: http://stackoverflow.com/a/29824493
tagged with: updatepanel
tagged with: asp.net
favorite count: 0
type: UnansweredQuestion
tagged with: modalpopupextender
score: 1
upvote count: 1
has body: I have the following scenario: UpdatePanel1 -> UpdatePanel2 -> UpdatePanel3: Inside it I have a GridView with a following column definition: &lt;ItemTemplate&gt; &lt;asp:ImageButton ID="img_btnEdit" runat="server" AlternateText="Edit" CausesValidation="false" Height="15px" OnClientClick='&lt;%#Eval("TranValueId", "PopulateEditTransValuesMDPP({0}); return false;") %&gt;' ImageUrl="~/Images/document_edit.png" Width="15px" /&gt; &lt;/ItemTemplate&gt; When clicked, a ModalPopupExtender should open, but first I need to retrieve the boundfield of the clicked row. JS function: function PopulateEditTransValuesMDPP(id) { var btPopupLoad = document.getElementById('&lt;%= btPopupLoad.ClientID %&gt;'); var hdnlblModalPopuphelper = document.getElementById('&lt;%= hdnlblModalPopuphelper.ClientID %&gt;'); if (id != null) { hdnlblModalPopuphelper.innerHTML = id; } btPopupLoad.click(); } Here is the rest of the HTML code that resides in the same UpdatePanel as the GridView: &lt;asp:Label ID="hdnlblModalPopuphelper" runat="server" Text="" style="display:none;"&gt;&lt;/asp:Label&gt; &lt;asp:Button ID="btPopupLoad" runat="server" Text="Load" OnClick="btPopupLoad_Click" style="display:none;" /&gt; &lt;ajaxToolkit:ModalPopupExtender ID="modppOpen" runat="server" TargetControlID="btPopupLoad" PopupControlID="pnlModPPDefaultValueEditing" BackgroundCssClass="modalBackground" OkControlID="btnCloseModalPopup" DropShadow="true" /&gt; &lt;asp:Panel ID="pnlModPPDefaultValueEditing" runat="server" CssClass="aspnetForm" Width="80%"&gt; &lt;asp:UpdatePanel ID="updpanEditDefaultValue" runat="server" UpdateMode="Conditional"&gt; &lt;Triggers&gt; &lt;asp:AsyncPostBackTrigger ControlID="btnSaveEditingTransValueDefaultValue" /&gt; &lt;/Triggers&gt; (...) Problem Description: Everything works fine, except that the OnClick Event (the server side event) of the btPopupLoad is not triggered! The only way I made the OnClick event to get fired was by setting the UseSubmitBehaviour="false" in its definition but…
type: Question
has title: How to fire OnClick event in nested panels with ModalPopupExtender?
tagged with: c#
downvote count: 0

http://stackoverflow.com/q/29816236
tagged with: checkbox
type: Question
has answer: http://stackoverflow.com/a/29816323
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/47759772
has title: header checkbox not working first click
answer count: 1
tagged with: asp.net
has body: hey everyone i have two view 1- Index 2- Edit i have a grid its header have one checkbox i want to click checkbox all rows checkbox is checkbox. in my header checkbox its not working first time when i click uncheck then check its work fine. i dont know why and what is the problem in my code please help here is my index view its have Script function Check_Uncheck() { $('#SelectAll').click(function () { if (this.checked) { $('.checkbox:enabled').each(function () { this.checked = true; }); } else { $('.checkbox:enabled').each(function () { this.checked = false; }); } }); } and here is my Edit its have checkbox &lt;input type="checkbox" id="SelectAll" onclick="Check_Uncheck();" tabindex="3" /&gt;
type: UnansweredQuestion

http://stackoverflow.com/q/29767255
has title: Disable multiple radio buttons?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47665734
has comment: http://stackoverflow.com/comment/47666116
has comment: http://stackoverflow.com/comment/47666354
has answer: http://stackoverflow.com/a/29768310
has comment: http://stackoverflow.com/comment/47667450
type: Question
has comment: http://stackoverflow.com/comment/47667183
tagged with: javascript
tagged with: jquery
has body: I have a question form with multiple yes/no radio buttons each with it's own textarea that should only be enabled whenever "No" is selected for that particular question. Problem is the setup up I'm using only works for one question because of matching classes. I haven't been able to come up with a nice way of making each radio button pair unique and only affect it's own textarea. I'm using the counter variable to make different class names for each group but the script only affects .class1 I need to modify the script and would like some advice. This is part of the view I'm using. @for (int i = 0; i < Model.Questions.Count; i++) { @Html.RadioButtonFor(p => Model.Questions[i].AnswerSelected, true, new { @class = "class" + i, value = "yes" }) Yes @Html.RadioButtonFor(p => Model.Questions[i].AnswerSelected, false, new { @class = "class" + i, value = "no" }) No @Html.TextAreaFor(p => Model.Questions[i].ActionToTake, new { id = "text1" }) } Bits of markup from inspect element Yes No Yes No and this is the script I'm using $(document).ready(function() { $(".class1").change(function (e) { if ($(this).val() === 'True') { $("#text1").prop('readonly', true); $("#text1").css('background-color', '#EBEBE4'); } else if ($(this).val() === 'False') { $("#text1").prop('readonly', false); $("#text1").css('background-color', '#FFFFFF'); } }); }) Is there a good way to approach this? If you need more detail let me know. (I've asked this before but felt I wasn't being clear enough in the question)
score: 0
tagged with: radio-button
answer count: 1
tagged with: asp.net
has comment: http://stackoverflow.com/comment/47666677

http://stackoverflow.com/comment/47687140
comment on: http://stackoverflow.com/a/29775187
type: Comment
has text: Yeah, that was before I put the required atts in. Anyway, it still does not work and I get the same JS error. It is driving me crazy! So I removed the JS check - if (!$("#roleForm").valid()) - and just captured the errors in the controller. Pain but had to be done.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/83496996
has text: Can anyone explain why do we send 1 for a and -1 for b? if(a === null) { return 1; } else if(b === null){ return -1; }
score: 10
type: AnswerComment
comment on: http://stackoverflow.com/a/29829361
type: Comment

http://stackoverflow.com/q/29805828
tagged with: validation
downvote count: 0
tagged with: dom-events
favorite count: 0
type: UnansweredQuestion
tagged with: input
upvote count: 1
has body: I have a function that currently works with an input to prevent customers from inputting a P.O. Box into an address field. The input that works has an inline onKeyPress event, however the input I need to run the function on doesn't (and I can't access it). My question is how to incorporate the correct event listener so that my function runs on this inaccessible input? My JS Fiddle is here: http://jsfiddle.net/ZQQS9/4/ function killPObox(id) { var idValue = document.getElementById('v65-onepage-shipaddr1').value; if (id == 'v65-onepage-shipaddr1') { function runVal() { if (idValue.substr(0,4).toUpperCase() === "PO B" || idValue.substr(0,5) === "P.O. ") { alert("USA Light cannot ship to P.O. Boxes. Please enter a street address."); } } setInterval(runVal(),1); } } &lt;!-- Practice input that works --&gt; 1. &lt;input type="text" class="quantity" name="v65-onepage-shipaddr1" id="v65-onepage-shipaddr1" onKeyPress="killPObox(this.name)"&gt; &lt;br&gt; &lt;br&gt; &lt;!-- Actual input that I need to hook into, cannot edit --&gt; 2. &lt;input type="text" size="25" maxlength="75" name="ShipAddress1" id="v65-onepage-shipaddr1" value="" style="" onkeydown=""&gt;
has answer: http://stackoverflow.com/a/29805998
score: 1
type: Question
has title: How to do custom validation in JavaScript
has answer: http://stackoverflow.com/a/30659961
tagged with: javascript
answer count: 2

http://stackoverflow.com/q/29745925
has comment: http://stackoverflow.com/comment/73130676
tagged with: unity-game-engine
type: UnansweredQuestion
tagged with: plugins
has body: I have a script in Javascript ( not UnityScript ) and need to get it working in Unity. As I understand I need to change ending to jslib so it gets imported properly. But I have trouble using the actual script. I am trying to make it work somehow with DllImport but with no luck so far. So if someone knows how to import javascript file and call it from C#, that would be awesome.
score: 0
has answer: http://stackoverflow.com/a/29747120
linked to: http://stackoverflow.com/q/39589800
type: Question
tagged with: native
has comment: http://stackoverflow.com/comment/47625531
tagged with: javascript
has comment: http://stackoverflow.com/comment/47625505
linked to: http://stackoverflow.com/q/16434389
has comment: http://stackoverflow.com/comment/47626003
has title: Unity import native javascript as jslib
answer count: 1

http://stackoverflow.com/comment/47747234
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29809029
has text: Just put the code inside `$(function() { /** code from the answer **/ })`. I omitted it for brevity.
type: AnswerComment

internet-explorer-9
tag name: internet-explorer-9
tags question: http://stackoverflow.com/q/29782735
tags question: http://stackoverflow.com/q/29832744
tags question: http://stackoverflow.com/q/29828561
tags question: http://stackoverflow.com/q/29702104
tags question: http://stackoverflow.com/q/29749970
type: Tag

http://stackoverflow.com/comment/47589788
has text: The html is correct. Just for your info I am editing my code with what you see in the browser.
comment on: http://stackoverflow.com/q/29727781
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29791405
answer count: 2
possible better answer: http://stackoverflow.com/a/29791576
has answer: http://stackoverflow.com/a/29791576
tagged with: prototype
has title: (String instanceof Object) returns true but I am not able to find the Object.prototype in String.prototype chain
upvote count: 4
has body: My JavaScript says that instanceof operator search for if the prototype property is present on the constructor or not. String instanceof Object; // true String.prototype === Object.prototype; // false String.prototype.prototype === Object.prototype; // false String.prototype.prototype.prototype === Object.prototype; // Throws into "Cannot read property 'prototype' of undefined" String.prototype.prototype; // undefined That simply means Object.prototype is not present on String.prototype chain. Which has confused me then how come String instanceof Object is returning true?
accepted answer: http://stackoverflow.com/a/29791693
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0
type: Question
tagged with: instanceof
score: 4
has answer: http://stackoverflow.com/a/29791693

http://stackoverflow.com/q/29838724
has comment: http://stackoverflow.com/comment/47804254
type: Question
tagged with: .net-3.5
has comment: http://stackoverflow.com/comment/47819531
has comment: http://stackoverflow.com/comment/47803786
downvote count: 0
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/47806257
tagged with: .net-4.5
tagged with: asp.net
favorite count: 0
has body: My Project is having a number of .NET applications(aspx) developed in .NET Framework 3.5 and hosted under single domain(Common Virtual directory) to share session. Now I have developed (aspx) applications in .NET Framework 4.5 and deployed in the same Virtual directory and switched the IIS settings to use 4.5 Framework in Integrated mode. So, all old and new applications run in Framework 4.5. The problem is one old javascript syntax are not supported. Old Syntax: document.frmUser.txtLogin.value = document.frmUser.txtRequired.value; above code assign the text box value of txtRequired to txtLogin. Both are inside the form tag with ID frmUser. The newer syntax for this is: document.getElementbyID("txtLogin").value = document.getElementbyID(".txtRequired").value; But I am not allowed to change the old application code. Is there any possibility to make it work without changing the code. Any workaround to fix it, by adding additional IIS or any other settings???
answer count: 0
type: UnansweredQuestion
tagged with: iis
upvote count: 1
has title: OLD Javascript code document.formID.ElementID Not worling in .NET Framework 4.5

http://stackoverflow.com/comment/47809754
has text: okay, so changed d "attr" to "style". It was working fine with other plotting, so didnt realize. Also added color scale, and respective changes to "style" but no effect
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29840463

http://stackoverflow.com/q/29735518
tagged with: http://stackoverflow.com/tag/json
has body: I want to format my JSON Document neatly in to an HTML page. My Javascript code is: xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { // Optionally, here you can update the dom to have a table in "responseDiv" // var html = '' var text = xmlhttp.responseText; var newStr = text.substring(1, text .length-1); document.getElementById("myDiv").innerHTML = " " + newStr + " "; } } My HTML code is as below: Digits Probability JSON Array: {0: 0.99, 1: 0.8, 2: 0.6, 3: 0.4, 4: 0.2, 5: 0, 6: 0.12, 7: 0.09, 8: 0.001, 9: 0.0025} I was able to remove the "{ }" from the JSON code but I want to display the Key Values in a neat format, which I am not sure how to. Please help. Thanks.
has comment: http://stackoverflow.com/comment/47604104
type: Question
has comment: http://stackoverflow.com/comment/47604205
has answer: http://stackoverflow.com/a/29735561
tagged with: javascript
has comment: http://stackoverflow.com/comment/47604321
answer count: 3
downvote count: 0
has answer: http://stackoverflow.com/a/29735635
has title: How to format JSON Key values in HTML
has comment: http://stackoverflow.com/comment/47604242
favorite count: 0
has comment: http://stackoverflow.com/comment/47604541
upvote count: 2
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47604876
has answer: http://stackoverflow.com/a/29735613
score: 2

http://stackoverflow.com/comment/47764235
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29817421
type: Comment
has text: I have been thinking to hide it, but I didn't see that it is recommended by wow.js. I thought that there is some problem with code why is that happening. I have tried on some other websites and still same problem. maybe I could hide that divs with jquery and then reveal it with wow?

http://stackoverflow.com/comment/47676712
type: QuestionComment
comment on: http://stackoverflow.com/q/29773062
has text: li id is "soup" but your josn file has "soups"
score: 0
type: Comment

http://stackoverflow.com/comment/47565052
has text: @Alrazah: `hr` has semantic meaning, `div` does not.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29714939
score: 1

http://stackoverflow.com/comment/47541786
comment on: http://stackoverflow.com/q/29702943
score: 0
has text: @user1884155 it's assuming that a 3rd party isn't controlling the _Console_ input, whereas a third party could be loading in an external JavaScript resource
type: Comment
type: QuestionComment

http://stackoverflow.com/a/40083522
has body: Just to get this question off the Unanswered list. The XPInstall whitelist only contains Mozilla's sites, so Mozilla doesn't seem to have a way to accept a domain into their default addon installation whitelist. The browser itself will not notify the untrusted web page about the results of the add-on installation. If your extension is restartless, it can notify the page it has been installed via postMessage.
answers question: http://stackoverflow.com/q/29830253
downvote count: 0
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/47600938
score: 0
has text: Thanks! However when I change this, the dateInfo seems to be empty. The label and default date are not displayed anymore.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29733828

http://stackoverflow.com/comment/135833143
comment on: http://stackoverflow.com/a/74186251
type: AnswerComment
score: 0
type: Comment
has text: for some reason I can't suggest a change, but your mock value isn't a real iso string, `"2023-09-06T11:54:47.050Z"` would be valid however

http://stackoverflow.com/comment/47689301
score: 1
type: AnswerComment
has text: For reference, see jQuery's `ajax()` [documentation](http://api.jquery.com/jquery.ajax/) and [examples](http://api.jquery.com/jquery.ajax/#entry-examples) regarding how to specify a data *object*.
type: Comment
comment on: http://stackoverflow.com/a/29779638

http://stackoverflow.com/comment/47809002
comment on: http://stackoverflow.com/a/29841140
score: 0
type: AnswerComment
has text: @Arjun, Thanks for your answer! How about the height?
type: Comment

http://stackoverflow.com/q/29835765
has answer: http://stackoverflow.com/a/29835835
has answer: http://stackoverflow.com/a/29835979
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29835835
upvote count: 3
downvote count: 1
has body: I read in the EcmaScript specification that certain methods are "generic". What does this mean? Does it mean that the methods make little or no assumptions about the object bound to the this value when the function is invoked?
type: Question
tagged with: ecmascript-6
accepted answer: http://stackoverflow.com/a/29835979
tagged with: javascript
has title: I read in the EcmaScript specification that certain methods are "generic". What does this mean?
answer count: 2
favorite count: 0

http://stackoverflow.com/q/29784078
has comment: http://stackoverflow.com/comment/47698018
answer count: 3
linked to: http://stackoverflow.com/q/13121016
has body: Recently my team has landed in a weird situation. End of last year we migrated from IE 8 to IE 11. Our application is now designed to work in IE 11 Enterprise mode. We need to display a javascript alert message to upgrade the Browser if the user is using IE 8. Alert message is successfully displayed to the users who use IE 8. But problem occurs when the alert message is also displayed to the users who are using IE11 in enterprise mode. I know that IE11 Enterprise mode basically emulates IE 8 behavior and that is the reason why our browser detection functionality is failing. So I wanted to check if someone has implemented this kind of feature where they can successfully detect the IE version even if they are using IE 11 enterprise mode. All responses are valuable. Appreciate your response !!!
downvote count: 0
tagged with: javascript
has title: Internet Explorer ver 11 enterprise mode detection
has answer: http://stackoverflow.com/a/32206142
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47698101
has comment: http://stackoverflow.com/comment/47730439
upvote count: 3
type: Question
score: 3
has answer: http://stackoverflow.com/a/29816551
tagged with: internet-explorer
has answer: http://stackoverflow.com/a/35352340

http://stackoverflow.com/a/50255056
has comment: http://stackoverflow.com/comment/97050618
downvote count: 4
score: 2
upvote count: 6
answers question: http://stackoverflow.com/q/29745873
has comment: http://stackoverflow.com/comment/95708829
has comment: http://stackoverflow.com/comment/87528542
has body: I know this is marked as already answered but you can literally just do... moment.utc(moment.duration(moment(dateA).diff(moment(dateB))).asMilliseconds()).format('HH:mm:ss');
type: Answer

http://stackoverflow.com/q/29792136
downvote count: 0
has body: I have small html code bellow: &lt;span class="k"&gt;function&lt;/span&gt; () { &lt;span class="k"&gt;this&lt;/span&gt;.test = '&lt;p&gt;&lt;span&gt;test&lt;/span&gt;&lt;/p&gt;'; } and this regex: /["|'](&lt;)|(&lt;)(?:\/[^&gt;]&gt;)["|']/g With this regex, it returns two matched results, but what I want is to match all html open tags between the quotes and group them into one result. What is the correct regex to do so? I need to replace those open tags with &amp;lt; after. Thanks in advance!
favorite count: 0
has answer: http://stackoverflow.com/a/29792238
has comment: http://stackoverflow.com/comment/47713070
tagged with: http://stackoverflow.com/tag/html
tagged with: regex
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29793021
score: 1
has answer: http://stackoverflow.com/a/29793021
has title: Match HTML open tags between quotes
has comment: http://stackoverflow.com/comment/47714441
accepted answer: http://stackoverflow.com/a/29792238
upvote count: 1
has comment: http://stackoverflow.com/comment/47713078
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/1732348
answer count: 2

http://stackoverflow.com/comment/47944600
has text: How would I store, because when i click on the any link and page refreshes then it didn't save the previous states?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29768483

http://stackoverflow.com/q/29697561
downvote count: 8
tagged with: javascript
has answer: http://stackoverflow.com/a/29698750
upvote count: 1
answer count: 1
score: -7
favorite count: 0
type: UnansweredQuestion
tagged with: google-chrome-extension
has title: Decrypt chrome extension
has body: does anyone know how to get clear source code of this extension? Maybe via some extension to deobfuscate?
tagged with: google-chrome
type: Question

http://stackoverflow.com/comment/47568869
has text: Giusto! Dai, meglio così allora :D Comunque non mi è completamente chiaro ancora perchè la risposta veniva data in automatico :/
type: Comment
comment on: http://stackoverflow.com/a/29716602
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47689279
comment on: http://stackoverflow.com/a/29779504
type: AnswerComment
has text: @Abdi what url you putted in browser..I think you are accessing using filepath like `C:/Users/Abu-Mustaqiima/Documents/AngularJS/WeatherApp/index.html` ,I think it should be something like `http://localhost/yourpath`
type: Comment
score: 0

http://stackoverflow.com/a/29709499
answers question: http://stackoverflow.com/q/29708886
score: 0
has body: You have many way, some are listed here: Adding options to a select and selecting one on internet explorer var option = new Option(data[i].name, data[i].id); Since old IE don't like to manipulate select/option you should do something like: var HTMLselect = '&lt;select&gt;'; for (var i = 0; i&lt;=100; i++){ HTMLselect += '&lt;option value="' + i + '"&gt;' + i + '&lt;/option&gt;'; } HTMLselect += '&lt;/select&gt;'; That's shorter, faster to execute, and prevent cross platform problems.
type: Answer

http://stackoverflow.com/comment/47770433
has text: @JamesThorpe - many selectors has the potential of search much of a DOM (mostly not all of it, but a big part). I would say, the selector would have to part the selection string and internally use the right jquery selector for the job.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29821946
score: 0

http://stackoverflow.com/a/29728110
has comment: http://stackoverflow.com/comment/47592443
upvote count: 0
has comment: http://stackoverflow.com/comment/47592502
has comment: http://stackoverflow.com/comment/47594045
has comment: http://stackoverflow.com/comment/47592586
has comment: http://stackoverflow.com/comment/47594179
has comment: http://stackoverflow.com/comment/47592468
has comment: http://stackoverflow.com/comment/47592801
has comment: http://stackoverflow.com/comment/47592715
has comment: http://stackoverflow.com/comment/47593183
has comment: http://stackoverflow.com/comment/47592572
has comment: http://stackoverflow.com/comment/47592512
has comment: http://stackoverflow.com/comment/47591414
has comment: http://stackoverflow.com/comment/47594102
answers question: http://stackoverflow.com/q/29727980
has comment: http://stackoverflow.com/comment/47593080
type: Answer
has comment: http://stackoverflow.com/comment/47594407
downvote count: 1
has comment: http://stackoverflow.com/comment/47592933
has comment: http://stackoverflow.com/comment/47593047
score: -1
has comment: http://stackoverflow.com/comment/47593678
has body: Update js varible in response function. jQuery.ajax({ url : ajaxurl, dataType : "json", type : "post", data : search_params, success : function(response){ if(response.code=='success'){ jQuery('#coupon-result').html('&lt;img src="&lt;?php echo WP_iv_membership_URLPATH; ?&gt;admin/files/images/right_icon.png"&gt;'); amount = response.p_amount; }else{ jQuery('#coupon-result').html('&lt;img src="&lt;?php echo WP_iv_membership_URLPATH; ?&gt;admin/files/images/wrong_16x16.png"&gt;'); } jQuery('#p_amount').html(response.p_amount); }
has comment: http://stackoverflow.com/comment/47593966
has comment: http://stackoverflow.com/comment/47593945
has comment: http://stackoverflow.com/comment/47592909

http://stackoverflow.com/comment/47786249
comment on: http://stackoverflow.com/q/29829893
has text: Contrary to the common misconception, there is no "best" way to do something this broad. The "best" way would be to start implementing the logic you've already designed. If you run into a specific problem feel free to ask a new question.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29753152
has comment: http://stackoverflow.com/comment/47682869
type: Answer
has comment: http://stackoverflow.com/comment/47667155
has comment: http://stackoverflow.com/comment/47657685
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/29752110
has body: First, as I'm new to StackOverflow, I'm not sure if this is the proper way to do this. Quenton's answer above is a good one. You should consider what these controls will do and use proper links for non-JS support. There's enough people that feel more comfortable having JS turned off to warrant it. As for handling the JavaScript, classes are a good way as stated above. To expand on that, you can have several classes per element as well. For example: &lt;li class="MenuItem"&gt;&lt;a herf="/path/to/action" class="MenuAction MenuAction_Open"&gt;(text or image here)&lt;/a&gt;&lt;/li&gt; This way you can use a class for specific menu actions while also using CSS to stylize things uniformly. I would also recommend taking a look at JQuery. If you're going to be doing a lot of JavaScript, it makes the process much more simple. There is a good tutorial on JQuery here: W3 Schools
score: 0

http://stackoverflow.com/a/29804790
type: Answer
has comment: http://stackoverflow.com/comment/47737578
has body: It does, it's called geocoding. edited: You have to get the coordinates from the click first - add an event listener to the map for a 'click' event to call a function(event). Inside the function, you can access location by event.latLng. And from there, you can use the reverse-geocoding from the link above.
has comment: http://stackoverflow.com/comment/47737838
accepted answer of: http://stackoverflow.com/q/29804683
has comment: http://stackoverflow.com/comment/47737457
answers question: http://stackoverflow.com/q/29804683
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/47836806
score: 1
type: Comment
type: QuestionComment
has text: It sounds like you haven't configured the server to recognize the `.py` suffix as meaning it's an executable script.
comment on: http://stackoverflow.com/q/29836344

http://stackoverflow.com/comment/47906196
comment on: http://stackoverflow.com/a/29841225
type: Comment
has text: @guest271314 i still cant get it. :( my brain is damaged
score: 0
type: AnswerComment

http://stackoverflow.com/q/29716853
answer count: 2
has body: Good day! I'm trying to create modal for edit purposes. That means that it must be filled with retrieved data by specific ID. The problem is that it doesn't work. Link used to call PHP edit function: PHP edit function: if (isset($_GET['edit'])) { $edit = httpGet(ROOT . "/API.php?getId=" . $_GET['edit']); ?> <?php } "editId" modal: Edit Transaction <input type="text" id="id" name="id" class="form-control input-lg" placeholder="ID" value="<?php echo $edit[0]['id']; ?>"> <select class="form-control" id="type" name="type" placeholder="Transaction type" value="<?php echo $edit[0]['type']; ?>"> Withdraw Deposit <input type="text" id="sum" name="sum" class="form-control input-lg" placeholder="Sum" value="<?php echo $edit[0]['sum']; ?>"> <select class="form-control" id="currency" name="currency" placeholder="Currency" value="<?php echo $edit[0]['currency']; ?>"> ILS USD <input type="text" id="transaction" name="transaction" class="form-control input-lg" placeholder="Transaction ID" value="<?php echo $edit[0]['transaction']; ?>"> <input type="text" id="buyer" name="buyer" class="form-control input-lg" placeholder="Buyer" value="<?php echo $edit[0]['buyer']; ?>"> <input type="text" id="email" name="email" class="form-control input-lg" placeholder="Email" value="<?php echo $edit[0]['email']; ?>"> <input type="text" id="invoice" name="invoice" class="form-control input-lg" placeholder="Invoice" value="<?php echo $edit[0]['invoice']; ?>"> <input type="text" id="date" name="date" class="form-control input-lg" placeholder="Date" value="<?php echo $edit[0]['date']; ?>"> Update Payment Cancel
accepted answer: http://stackoverflow.com/a/29717409
tagged with: javascript
has comment: http://stackoverflow.com/comment/47568299
has title: Toggling Bootstrap modal from PHP trigger
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/29716955
has answer: http://stackoverflow.com/a/29716955
tagged with: twitter-bootstrap
tagged with: php
has comment: http://stackoverflow.com/comment/47568291
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/29717409
type: Question

knapsack-problem
type: Tag
tags question: http://stackoverflow.com/q/29838713
tags question: http://stackoverflow.com/q/29841287
tag name: knapsack-problem

http://stackoverflow.com/q/29703554
possible better answer: http://stackoverflow.com/a/29703916
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/29703916
tagged with: css
has title: Getting two Bootstrap Accordions to work within tabs
type: AnsweredQuestion
has body: I am having a problem trying to get two Bootstrap Accordions to work within separate tabs on the same page. Basically, when I click through the first accordion all works as it should with the content collapsing and expanding as expected. When it comes to the second accordion however, clicking on the links has no affect but it does apply my css styling to the element. My question is how do I get it so that both accordions collapse and expand as per the expected behaviour of accordion#1? Home Profile Messages Settings HEADING 1 ***** SOME TEXT ***** HEADING 2 ***** SOME TEXT ***** HEADING 3 ***** SOME TEXT ***** ***** SOME OTHER CONTENT ***** HEADING 1 ***** SOME TEXT ***** HEADING 2 ***** SOME TEXT ***** HEADING 3 ***** SOME TEXT ***** ***** SOME OTHER CONTENT ***** Here is the jQuery i am using; $(function() { $('.panel-heading').click(function() { if ($(this).hasClass('activestate')) { $(this).removeClass('activestate'); } else { $('.panel-heading').removeClass('activestate'); $(this).addClass('activestate'); } }); }); I have replicated my issue here with accordion1 in tab 1 and accordion 2 in tab 3: http://jsfiddle.net/4yk7yzo9/1/ I am a no0b with jQuery so please play nicely and thanks in advance for any pointers in the right direction
has comment: http://stackoverflow.com/comment/47543365
type: Question
has answer: http://stackoverflow.com/a/29703923
tagged with: jquery-ui
tagged with: javascript
score: 0
answer count: 3
tagged with: jquery
has answer: http://stackoverflow.com/a/29704060
accepted answer: http://stackoverflow.com/a/29703923

http://stackoverflow.com/a/29788127
has comment: http://stackoverflow.com/comment/47705836
score: 0
has body: When you save a webpage like that, the browser saves everything to your drive, all resources and HTML that is currently loaded, and it also alters it so that when you view the page locally, URLs translate to the stored files. What is happening is your saved version of the map isn't able to access some of the dynamic content that it needs in order to run. If you click the Menu button in Chrome, go to More Tools, and then Javascript Console, you will likely see errors on the local version of the page. When an error occurs, the browser stops running that bit of script, thus leaving you with a non-functioning map. If you want a map like that for local use, you can always take a screenshot of the map and edit it to your needs. You can do this with Alt+Print Screen on most systems. On Windows, this will save the image to your clipboard. You can then use MS Paint (or your favorite editor) and paste the image in for editing and saving.
type: Answer
answers question: http://stackoverflow.com/q/29787932

http://stackoverflow.com/comment/47679150
comment on: http://stackoverflow.com/a/29774209
has text: If you want it on all levels, then you should use recursion.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/29787162
has body: I'm trying to upgrade a site template that uses mainly jQuery 1.08 to use 1.11, since a widget I want to connect to the subscribe form uses 1.11. Here's the template I'm using: http://multifour.com/projects/ray/ios/image-intro/index.html What's weird is if I use the following code, the header is there but the form doesn't work properly: And if I use this code, the form works but the header disappears: I can't use both either, because whenever I enter the second line the header disappears for some reason. What gives, can someone please help me? Thanks!
has title: update jQuery to use with widget
type: Question
has comment: http://stackoverflow.com/comment/47703971
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/47703932
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47740146
type: UnansweredQuestion
upvote count: 4
has answer: http://stackoverflow.com/a/29867153
downvote count: 0

http://stackoverflow.com/q/29831648
tagged with: javascript
score: -1
has body: I am using a html input checkbox control in a modalpopup which runs a javascript function in the onclick event. Now my challenge is getting the value of the checked property of this control from code-behind to do some behavioral stuff. When I added the runat="server" property to it and wrote chkIsPrivate.Attributes.Add("onclick", "toggleCheckbox()"); in the page_load, the javascript function would not fire. I have searched online for a solution but didn't get any. I'm hoping someone will help me out here. Please note that without the runat="server" and the line of code in page_load, the javascript function fires when the checkbox control is clicked. But I need to get the value of the checked property in the code-behind. HTML: Private Campaign: Password: <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" Width="150px"></asp:TextBox> Confirm Password: <asp:TextBox ID="txtConfirmPassword" runat="server" TextMode="Password" Width="150px"></asp:TextBox> JavaScript: function toggleCheckbox() { var checkBox = document.getElementById("chkIsPrivate"); var pwd = document.getElementById("password_tr"); var confirmPwd = document.getElementById("confirmPassword_tr"); var hiddenVal = document.getElementById("privateHiddenInput"); if (checkBox.checked) { pwd.style.display = "table-row"; confirmPwd.style.display = "table-row"; } else { pwd.style.display = "none"; confirmPwd.style.display = "none"; } }
answer count: 2
linked to: http://stackoverflow.com/q/21133519
has comment: http://stackoverflow.com/comment/47789868
tagged with: asp.net
favorite count: 0
possible better answer: http://stackoverflow.com/a/29832287
linked to: http://stackoverflow.com/q/5792290
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29832287
has comment: http://stackoverflow.com/comment/47791460
has comment: http://stackoverflow.com/comment/47790559
has answer: http://stackoverflow.com/a/29840447
has comment: http://stackoverflow.com/comment/47793883
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47790297
has comment: http://stackoverflow.com/comment/47790864
downvote count: 2
accepted answer: http://stackoverflow.com/a/29840447
upvote count: 1
has title: How to get checked value of HTML Input Checkbox in Code Behind
type: Question
has comment: http://stackoverflow.com/comment/47791225
tagged with: c#

http://stackoverflow.com/a/31433337
has comment: http://stackoverflow.com/comment/70074572
has comment: http://stackoverflow.com/comment/75336136
has comment: http://stackoverflow.com/comment/75306291
has body: This can happen if the image URL is not publicly accessible, as Stripe has to be able to request the image from their servers. This can happen if you are running a local copy of the application which isn't accessible from the outside world, or if it is behind a VPN or authentication.
answers question: http://stackoverflow.com/q/29786783
score: 22
type: Answer
upvote count: 22
downvote count: 0

http://stackoverflow.com/comment/47821198
type: Comment
comment on: http://stackoverflow.com/a/29844592
score: 0
type: AnswerComment
has text: I just want text to be shown for the boxes ticked. The ones unticked I want them to remain hidden. Sorry for the confusion, thanks

http://stackoverflow.com/comment/47807623
type: Comment
has text: Good, too bad this information is missing from the documentation!
type: AnswerComment
comment on: http://stackoverflow.com/a/29834629
score: 0

http://stackoverflow.com/a/29826537
upvote count: 2
answers question: http://stackoverflow.com/q/29825908
score: 2
downvote count: 0
has body: If you just want to capture hex values (i.e 6 characters following #) regexp groups comes in handy var r = new RegExp('fill:#([a-zA-Z0-9]{6})','g') var res= []; while(result = r.exec(file)) { res.push(result[1]); } In the code piece above, I matched the 6 characters after #, and stored the captured group in an array called res Here is a modified version of your fiddle to demonstrate http://jsfiddle.net/mumg81qq/3/
type: Answer

http://stackoverflow.com/comment/47765472
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29819382
has text: Did you try `linearRampToValueAtTime`?

http://stackoverflow.com/comment/47574546
comment on: http://stackoverflow.com/q/29718948
score: 0
type: QuestionComment
has text: The new URL is set at the time of firing this event (in your handler, `window.location.href` is already updated), but I don't think it's possible to also capture the POST data. If it is always a login form, wouldn't it be possible to replace some of its contents with server-side means?
type: Comment

http://stackoverflow.com/comment/47811782
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29841884
has text: @GirishSakhare thanks for your advice. And the last could you suggest me any opensource interpreter in python? I am working with python now and it will be easy for me to understand it and than try to build my own.

tableheader
tags question: http://stackoverflow.com/q/29754409
tag name: tableheader
type: Tag

http://stackoverflow.com/comment/47709040
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/75898/discussion-between-alex-man-and-ekuusela).
type: AnswerComment
comment on: http://stackoverflow.com/a/29789176
score: 0

http://stackoverflow.com/q/29700964
score: 1
favorite count: 0
has title: closing child window while the reference is lost [without opening a false popup]
type: Question
has answer: http://stackoverflow.com/a/29701069
has body: Well! there are so many posts on this topic but couldn't find the one which answers my question. Topic Javascript. The question: My application opens 3-4 popups using window.open API. It depends on the user whether he keeps them open or closed. User can refresh the parent page which will ultimately lose all the references of children. Now assume parent is refreshed. While logging out I want to close all the open popups. Open popups can be easily closed, and I was able to figure that out using win = window.open("", CHILD_WINDOW_NAME); win.close(); Now if the popups are not open and I'm trying to close them using above code. It opens a false popup for a second and then closes it, which I don't want. This gives a bad feel of flashing popups. How could I achieve it? Reference: http://josephj.com/lab/2011/window-open-reconnect/demo.html
tagged with: popup
upvote count: 1
answer count: 1
tagged with: javascript
type: UnansweredQuestion
tagged with: window.open
downvote count: 0

http://stackoverflow.com/q/29816137
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29817668
type: Question
linked to: http://stackoverflow.com/q/23803743
has comment: http://stackoverflow.com/comment/47760134
tagged with: jquery-deferred
tagged with: javascript
upvote count: 1
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47760179
favorite count: 0
tagged with: ajax
tagged with: promise
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47760642
linked to: http://stackoverflow.com/q/19177087
has body: Below are my Multiple ajax calls with promises. $(window).load(function(){ $.when(getApiModemList()).done(function(vendors){ var deferreds = calculateApiBalances(vendors); $.when.apply($,deferreds).done(function(balance) { console.log(balance); console.log("All Done"); }); }); function getApiModemList(){ return $.getJSON("url"); } function calculateApiBalances(vendors) { var defer=[]; $.each(vendors,function(k,v){ defer.push($.getJSON(someurl)); }); return defer; } }); Function calculateApiBalances() return me some balance which I need to Sum up to get total of all balance . But when print console.log(balance) it doesnot provide me with valid array of balance json. Another issue is if any one of my ajax calls in calculateApiBalances() fails it doesnot prints All Done. What should be done in above code to achieve this.
has title: Get response of multiple deferred objects in jquery

http://stackoverflow.com/comment/47575634
comment on: http://stackoverflow.com/a/29718757
score: 0
type: AnswerComment
has text: So this was technically correct, but as I accept, let me explain why for people stumbling across this post. All of my resources and ajax requests were being done like '$.ajax url: "/"' or ' ' The leading / was directing the requests to the specified root in nginx. The issue I was having was trying to fix it in the node app, when everything was in my client side js.
type: Comment

http://stackoverflow.com/comment/47646948
has text: @EricDavidSartor - This is the answer. The reason why you are getting the infinite loop is answered in http://stackoverflow.com/a/2270344/862479
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29755597
type: Comment

http://stackoverflow.com/a/29730053
answers question: http://stackoverflow.com/q/29730011
score: 2
downvote count: 0
type: Answer
has body: It should be $(function(){ $('[data-toggle="modal"]').trigger("click"); }); Because the modal window click event handler is having the autoplay option.
upvote count: 2

http://stackoverflow.com/a/29790980
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/47728423
downvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/29790862
has body: in doc: select as label for value in array label: The result of this expression will be the label for element. The expression will most likely refer to the value variable (e.g. value.propertyName). angular.module('app', []) .controller('ctrl', ["$scope", function($scope) { $scope.dealers = [{ dealerNumber: 1, name: 'd', distance: '123' }, { dealerNumber: 2, name: 'dd', distance: '124' }, { dealerNumber: 3, name: 'ddd', distance: '125' }, { dealerNumber: 4, name: 'dddd', distance: '126' }, { dealerNumber: 5, name: 'ddddd', distance: '127' }, { dealerNumber: 6, name: 'dddddd', distance: '128' } ]; } ]); UPDATE: with using filters angular.module('app', []) .controller('ctrl', ["$scope", function($scope) { $scope.dealers = [{ dealerNumber: 1, name: 'd', distance: '123.5' }, { dealerNumber: 2, name: 'dd', distance: '124.6' }, { dealerNumber: 3, name: 'ddd', distance: '125' }, { dealerNumber: 4, name: 'dddd', distance: '126' }, { dealerNumber: 5, name: 'ddddd', distance: '127' }, { dealerNumber: 6, name: 'dddddd', distance: '128' } ]; } ]);
answers question: http://stackoverflow.com/q/29790862
has comment: http://stackoverflow.com/comment/47728710
type: AcceptedAnswer

http://stackoverflow.com/q/29726391
has comment: http://stackoverflow.com/comment/47614221
has body: I'm experimenting broadcasting media (webcam, recorded videos -- like TV) over the internet through websocket (currently only works on Chrome). It is working fine in controlled environment. However, when put it on test in real life environment most of the times the clients did not receive data sent from the other end. Here's how I set my websocket configuration (for example only): var websocket = new WebSocket('ws://74.13.452.171:8080'); websocket.addEventListener("message", function(e) { // do something with e.data }); So how to make sure that all clients visiting a certain page of the web site received data sent from another client. Thanks in advance
has comment: http://stackoverflow.com/comment/47586681
has comment: http://stackoverflow.com/comment/47586712
answer count: 0
has comment: http://stackoverflow.com/comment/47586886
type: Question
has comment: http://stackoverflow.com/comment/47586697
tagged with: websocket
tagged with: javascript
has comment: http://stackoverflow.com/comment/47587479
score: 0
has comment: http://stackoverflow.com/comment/47586808
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47586747
type: UnansweredQuestion
has title: How to make sure all connected clients received data sent through Websocket

http://stackoverflow.com/q/29808183
has comment: http://stackoverflow.com/comment/47744732
has comment: http://stackoverflow.com/comment/47744503
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29808386
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47784779
answer count: 1
tagged with: angularjs-ng-repeat
has body: What I'm trying to do is find a simple way to toggle a model based on a search string results, I made a quick concept example to help visualize; JSFiddle I have a toggle button within each item that has its model blah in the example provided. What I keep failing at is figuring out a way to say for example if search=name.phone then blah=false or essentially use the search string to toggle the square to red if the string used to search is name.phone and it's in the search results, that at least conveys the concept hopefully. The reality is I have parts within the item template that are potentially hidden at first but they would still yield a search result but aren't visible in result. So I want them visible to the user if they're what was searched for. Makes sense right? I was hoping it was possibly as simple as something like; &lt;div ng-class="{'style-it red':blah, 'style-it green':!blah, 'style-it red':search=name.phone}"&gt;&lt;/div&gt; ..or something like it. Or maybe an inline ternary from the search input or something? I could show more failed attempts but they're obviously the wrong way anyway since I'm asking so I'll save the space. Oh and before you even think about down-voting or something give me an explanation why at least and go check out my Q/A ratio to understand you'd be helping someone who helps others often. I welcome a slice of humble pie in the name of learning.
has comment: http://stackoverflow.com/comment/47744769
favorite count: 0
has comment: http://stackoverflow.com/comment/47744851
has comment: http://stackoverflow.com/comment/47744793
tagged with: angularjs
has title: Toggle a model based on a search string result
has comment: http://stackoverflow.com/comment/47744807
has answer: http://stackoverflow.com/a/29808386
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/a/29803774
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47735952
type: Answer
has comment: http://stackoverflow.com/comment/47735557
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29803591
answers question: http://stackoverflow.com/q/29803591
has body: You need to put your prompt function inside for loop and add check if number is multiply by 3 or 5. var total; for (var i=0; i&lt;10; i++) { var num = parseFloat(window.prompt("enter a value","")); if (num % 3 == 0 || num % 5 == 0) { total += num; } } document.write(total); UPDATE: var total; var i = 0; while (i&lt;10) { var num = parseFloat(window.prompt("enter a value","")); if (num &gt;= 0 &amp;&amp; (num % 3 == 0 || num % 5 == 0)) { total += num; i++; } } document.write(total);

http://stackoverflow.com/a/29766514
type: Answer
answers question: http://stackoverflow.com/q/29765688
upvote count: 3
score: 3
downvote count: 0
has body: I have changed some places. function get_json(str) { str = new Date(str).toLocaleTimeString(); var arr = str.split(":"); var result = {}; result['hour'] = +arr[0]; result['minute'] = +arr[1]; result['second'] = +arr[2]; return result; } function get_unix(str) { return {"unixtime": +(new Date(str))}; } + converts string to int

http://stackoverflow.com/q/29709294
has title: what is the best way to sum the values of a specific column in jqGrid?
has comment: http://stackoverflow.com/comment/47568959
answer count: 0
has comment: http://stackoverflow.com/comment/47645594
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47554851
tagged with: jqgrid
tagged with: javascript
has comment: http://stackoverflow.com/comment/47645552
has body: I am making a invoice form, I am using jqGrid 7.8 to add new lines to the detail of the invoice, the user can add and delete lines, I need to sum the values of some specific columns, the columns price, tax, discount and total, the problem is that I need to sum in 2 different moments, the first is when the user adds a new line, the another is then he deletes a line. What the best way to sum these columns? If this is important my jqGrid works local, add local and delete local, I don't need to do these add or delete on the server side. This is my HTML code: Codigo Descripcion Cantidad Precio Impuesto Total Subtotal Impuesto Total This is my jqgrid: I am using a button named "add" to add the values to the new line in the grid: I am using a button named "delete" to delete a specific line in the grid: The problem in $("#delete").click(function () { }) is that this method delGridRow show a message 'Delete selected record(s)?' and I don't know how to know if the user selected 'yes' or 'cancel' in the dialog, I need to do this because I have to sustract these values of the final totals if the user selected 'yes'.
score: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/47554934
has comment: http://stackoverflow.com/comment/47555781

http://stackoverflow.com/comment/47603171
type: QuestionComment
comment on: http://stackoverflow.com/q/29734851
has text: I'd suspect that event is never getting attached because one of the other conditions is evaluating to true. Try putting another console.log inside the else block to see if the event is being attached.
score: 0
type: Comment

http://stackoverflow.com/q/29827099
has comment: http://stackoverflow.com/comment/47780906
has comment: http://stackoverflow.com/comment/47782303
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47782516
score: 1
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/29828156
tagged with: gson
has comment: http://stackoverflow.com/comment/47781515
type: Question
tagged with: jakarta-ee
has comment: http://stackoverflow.com/comment/47780695
has comment: http://stackoverflow.com/comment/47782524
tagged with: arrays
answer count: 1
downvote count: 0
tagged with: javascript
has title: Why does GSON convert array of objects to array of Strings instead?
has answer: http://stackoverflow.com/a/29828156
favorite count: 0
has body: I'm trying to display a list of objects in a JSP. The list is a conversion from Java array to Javascript array thanks to GSON. The algorithm is: Load array list of objects in servlet Convert to a JSON object with GSON forward JSON object to JSP Load JSON object in a Javascript array Display Javascript array as HTML The problem is when I loop the JS array it doesn't recognize the elements of the JS array as objects: The problem is when I loop the JS array and print its elements, I get the characters of the 1st image! This means that GSON does not convert the Array as objects but as an Array of Strings. How can I make sure that GSON actually converts the JAVA Array of Objects to a JS Array of Objects? My class "Activite": public class Activite { private int id; private String description; } Servlet Side: ArrayList&lt;Activite&gt; listActivite = new ArrayList&lt;Activite&gt;(); // ... Fill array from database ... String jsonActivite = new Gson().toJson(listActivite); request.setAttribute( "listActivite", listActivite ); requestDispatcher.include(request, response); JSP Side: &lt;!-- Load Array List --&gt; &lt;script&gt; var listActivite = &lt;%= new Gson().fromJson((String)request.getAttribute("jsonActivite"))%&gt;; &lt;/script&gt; &lt;p id="demo"&gt;&lt;p&gt; &lt;!-- Print the Array List's objects in the paragraph &lt;p&gt; --&gt; &lt;script&gt; var p = document.getElementById("demo"); document.getElementById("demo").innerHTML+=listActivite+"&lt;/br&gt;&lt;/br&gt;"; for(i=0; i&lt;listActivite.length; i++){ p.innerHTML += 'ID:'+listActivite[i].id+' DESC:'+listActivite[i].description+'&lt;/br&gt;'; } &lt;/script&gt;
upvote count: 1

carousel
tags question: http://stackoverflow.com/q/29778833
tags question: http://stackoverflow.com/q/29783111
tag name: carousel
type: Tag
tags question: http://stackoverflow.com/q/29751878
tags question: http://stackoverflow.com/q/29770969

http://stackoverflow.com/q/29755053
has body: I'm only a few hours new to React, so I might have missed something obvious. I have an app which looks a bit like this: var App = React.createClass({ myAction: function(thingId) { this.setState({currentThing: thingId}); }, render: function() { return (<ThingsContainer app={this}/>); } }); var ThingsContainer = React.createClass({ render: function() { return (<ThingList app={this.props.app}/>); } }); var ThingList = React.createClass({ render: function() { var self = this; var thingNodes = this.props.data.map(function (thing) { return ( ); }); return ( {thingNodes} ); } }); var Thing = React.createClass({ performAction: function() { this.props.app.myAction(this.props.thing.id); }, render: function() { return ( {this.props.thing.title} pip! ); } }); React.render(<App />, document.getElementById('content')); I want to trigger an event on the top-level object from a lower-level object. The relevant page doesn't seem to address this situation directly. In my solution I'm passing down the app object several levels. This doesn't feel right. In Ember I would be able to use a singleton Controller. In Angular I'd probably use a service. In Backbone or jQuery I'd use an event. I don't know how much magic wiring of this sort to expect from React. Is my above solution, which involves explicit wiring between components, even across several edges, the right approach?
has answer: http://stackoverflow.com/a/29755235
type: Question
tagged with: reactjs
tagged with: javascript
score: 0
answer count: 1
type: UnansweredQuestion
has title: How do I trigger an event on a higher-up element in React?

http://stackoverflow.com/comment/47648905
comment on: http://stackoverflow.com/q/29757998
score: 1
has text: This is generally known as an Immediately Invoked Function Expression (IIFE). The difference of style isn't important.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29762919
type: UnansweredQuestion
has body: Here I've read a simple delete is not enough to free the memory allocated for an object. I have an Object containing some subOjects, in the form: MyObject[idx]['foo']. Is there a way to free the memory used by Objects containing subObjects? If I make a MyObject[idx]=null is this enough for garbage collection?
has title: Garbage collection of objects as arrays of arrays
has comment: http://stackoverflow.com/comment/47657873
score: 1
tagged with: garbage-collection
upvote count: 1
type: Question
tagged with: object
tagged with: javascript
tagged with: arrays
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29781378
favorite count: 0
has comment: http://stackoverflow.com/comment/47658976

http://stackoverflow.com/a/29819619
type: Answer
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/29806300
type: AcceptedAnswer
downvote count: 0
has body: Here is what I did: The 2 arrays of coords correspond to what you would get in your AJAX success. markers is an array. In the addMarkers function, I create an array with the filter type value. Something like markers[filterType] = new Array(); This way, you can now easily identify markers of each type and toggle them on or off. Of course you will need to adapt this to your needs (I used buttons, you used checkboxes, etc.) and maybe you only need to load your markers once, etc. But you should be able to get the idea. var map; var markers = new Array(); var coords_1 = [ new google.maps.LatLng(60.32522, 19.07002), new google.maps.LatLng(60.45522, 19.12002), new google.maps.LatLng(60.86522, 19.35002), new google.maps.LatLng(60.77522, 19.88002), new google.maps.LatLng(60.36344, 19.36346), new google.maps.LatLng(60.56562, 19.33002)]; var coords_2 = [ new google.maps.LatLng(59.32522, 18.07002), new google.maps.LatLng(59.45522, 18.12002), new google.maps.LatLng(59.86522, 18.35002), new google.maps.LatLng(59.77522, 18.88002), new google.maps.LatLng(59.36344, 18.36346), new google.maps.LatLng(59.56562, 18.33002)]; function initialize() { var mapOptions = { zoom: 7, mapTypeId: google.maps.MapTypeId.ROADMAP, center: new google.maps.LatLng(59.76522, 18.35002) }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); $('button').on('click', function() { if ($(this).data('action') === 'add') { addMarkers($(this).data('filtertype')); } else { removeMarkers($(this).data('filtertype')); } }); } function addMarkers(filterType) { var temp = filterType === 'coords_1' ? coords_1 : coords_2; markers[filterType] = new Array(); for (var i = 0; i &lt; temp.length; i++) { var marker = new google.maps.Marker({ map: map, position: temp[i] }); markers[filterType].push(marker); } } function removeMarkers(filterType) { for (var i = 0; i &lt; markers[filterType].length; i++) { markers[filterType][i].setMap(null); } } initialize(); JSFiddle demo So in your case, you could do: v…
has comment: http://stackoverflow.com/comment/47770546
accepted answer of: http://stackoverflow.com/q/29806300

http://stackoverflow.com/comment/47541517
comment on: http://stackoverflow.com/q/29699953
score: 0
type: Comment
type: QuestionComment
has text: Also do not tag-spam. Only use the [tag:jquery-validate] tag if the question is about this specific plugin and the [tag:jquery-plugins] tag if the question is about jQuery plugins in general. Please do not rely solely on the jsFiddle to show the code; it must also be included in the OP in case the link goes dead. Thanks.

http://stackoverflow.com/comment/47731890
type: QuestionComment
comment on: http://stackoverflow.com/q/29801547
has text: Hi Muggles, Thanks, just tried the suggestion, no change same error :(
score: 0
type: Comment

http://stackoverflow.com/comment/47755849
comment on: http://stackoverflow.com/a/29806691
has text: It was just to give you an idea..you were comparing the ending part of the page with url.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/29809645
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/37573899
score: 4
favorite count: 0
tagged with: angularjs
has body: When trying to reference external modules, Intellisense spits out an error along the lines of.. Could not find symbol 'ng' in global module or.. Could not find symbol 'ng' in module 'App' // my main module ..even though I'm correctly referencing the typescript definitions (using definitelyTyped): _references.ts /// &lt;reference path="../../typings/tsd.d.ts" /&gt; declare var angular: ng.IAngularStatic; // unable to find in global module SomeDirective.ts /// &lt;reference path="_references.ts" /&gt; module App { export class SomeDirective implements ng.IDirective // unable to find in module 'App' } Interestingly, compiling the *.ts files with grunt-typescript works fine and the application runs without any problems.
tagged with: typescript
type: AnsweredQuestion
tagged with: typescript1.4
has answer: http://stackoverflow.com/a/29810130
has title: Unable to find 'ng' in module... - broken Intellisense?
has answer: http://stackoverflow.com/a/37573899
type: Question
upvote count: 4
answer count: 2
accepted answer: http://stackoverflow.com/a/29810130

http://stackoverflow.com/q/29752547
has comment: http://stackoverflow.com/comment/47637366
possible better answer: http://stackoverflow.com/a/29752651
score: 0
has body: I've got a simple div setup that transitions up when you swipe up the screen, and it works fine on my desktop, but I can't get the transition to work on my mobile (also tried on an Android emulator). I thought it was a problem with the swipe at first (using TouchSwipe), but then I tested it with a button and the transitions still aren't working. To give some background, it's an Angular app, and this is part of a template for Angular. I don't think there's any conflict between any of this... Any ideas? HTML: Open Text CSS: .swipeMenu { height: 45vh; width: 90vw; background-color: #fff; position: absolute; bottom: -45vh; left: 0; right: 0; margin: 0 auto; } JS: $(function() { $("#btnOpen").click(function() { $('.swipeMenu').css("-webkit-transition", "-webkit-transform 0.3s ease"); $('.swipeMenu').css("-moz-transition", "-moz-transform 0.3s ease"); $('.swipeMenu').css("-o-transition", "-o-transform 0.3s ease"); $('.swipeMenu').css("transition", "transform 0.3s ease"); $('.swipeMenu').css("transform", "translateY(-40vh)"); }); //Enable swiping... $(".swipe-container").swipe( { //Generic swipe handler for all directions swipeUp:function(event, direction, distance, duration, fingerCount) { $('.swipeMenu').css("-webkit-transition", "-webkit-transform 0.3s ease"); $('.swipeMenu').css("-moz-transition", "-moz-transform 0.3s ease"); $('.swipeMenu').css("-o-transition", "-o-transform 0.3s ease"); $('.swipeMenu').css("transition", "transform 0.3s ease"); $('.swipeMenu').css("transform", "translateY(-40vh)"); }, swipeDown:function(event, direction, distance, duration, fingerCount) { $('.swipeMenu').css("-webkit-transition", "-webkit-transform 0.3s ease-in"); $('.swipeMenu').css("-moz-transition", "-moz-transform 0.3s ease-in"); $('.swipeMenu').css("-o-transition", "-o-transform 0.3s ease-in"); $('.swipeMenu').css("transition", "transform 0.3s ease-in"); $('.swipeMenu').css("transform", "translateY(40vh)"); }, //Default is 75px, set to 0 for demo so any distance triggers swipe th…
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29753535
accepted answer: http://stackoverflow.com/a/29753535
tagged with: css
has comment: http://stackoverflow.com/comment/47637457
has answer: http://stackoverflow.com/a/29752651
has title: CSS3 transition not working on mobile
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47637394
type: Question
answer count: 2
tagged with: mobile
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29732808
score: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47599042
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47600788
has comment: http://stackoverflow.com/comment/47598872
has title: Javascript - execute code when display: block
linked to: http://stackoverflow.com/q/2157963
has body: Is there a way to wait for a particular tab/panel to be displayed (display : block) before the JS is executed? something like: $document.getElementById( '#panel1' ).style.display = 'block' { // Run code // }
has comment: http://stackoverflow.com/comment/47598946
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29733375
has comment: http://stackoverflow.com/comment/47599007

http://stackoverflow.com/q/29789990
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: drop-down-menu
score: 1
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/47710326
has answer: http://stackoverflow.com/a/29790615
has comment: http://stackoverflow.com/comment/47708920
has comment: http://stackoverflow.com/comment/47708990
has body: How do i make a drop down menu that when an option is chosen it creates a text that is placed in a text box. For Example, Dropdown menu option1 = "are good" i want the output to be, "Waffles Are Good". Waffles Will Automatically be there and they select an option from the drop down menu and it places the text "Are Good" Onto A Text Field
has answer: http://stackoverflow.com/a/29790556
tagged with: java
has title: How Do I Make a Dropdown Menu That Places A Text In a text Field
has comment: http://stackoverflow.com/comment/47710014
answer count: 3
has comment: http://stackoverflow.com/comment/47709827
upvote count: 1
has answer: http://stackoverflow.com/a/29790395

http://stackoverflow.com/q/29696940
tagged with: asp.net
accepted answer: http://stackoverflow.com/a/29697820
has answer: http://stackoverflow.com/a/57147412
has body: my html and javascript code is working correctly. But while I put it in asp.net, the javascript code isn't working. My html code is... Work Completed % and the javascript code is This works perfectly. The code above is to change the progressbar (id="p_bar") value with textbox (id="tval") input and the progressbar range increases or decreases with the value. But when I put runat="server" in , the code is not working. I am unable to find the solution. Please help me.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47531489
upvote count: 5
type: Question
has answer: http://stackoverflow.com/a/29697820
score: 5
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29697063
has title: ASP.NET javascript code is not working while putting an element's runat="server"
favorite count: 0
has answer: http://stackoverflow.com/a/29697327
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29697063
answer count: 4

http://stackoverflow.com/q/29818659
type: Question
tagged with: javascript
score: -3
has body: I have a function for finding identical numbers: var arr = [0, 0, 4, 8, 8, 10, 45, 0, 23, 3 ,8]; arr.filter(function (item, index, array) { return array.indexOf(item) !== array.lastIndexOf(item); // [0, 0, 8, 8, 0, 8] }); But, I need to create two-dimensional array for the individual matches. So, the result should be: [[0, 0, 0], [8, 8, 8]]
downvote count: 4
has title: How do I add a match in two-dimensional array?
answer count: 1
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/29820580

http://stackoverflow.com/q/29756576
tagged with: menuitem
score: 2
has comment: http://stackoverflow.com/comment/47645821
answer count: 0
downvote count: 0
type: Question
upvote count: 2
tagged with: javascript
has body: My page is divided into three sections and each section can be accessed by respective menu item. I am trying to achieve this in Javascript: when the user has reached any of the sections by scrolling, the font color of respective menu item should change. Here I call the function: &lt;body onscroll="detectScroll(); showPosition();"&gt; This is the function that detects scrolling and changes some items accordingly. It's working fine: function detectScroll() { var header = document.querySelector(".headerOrig"), header_height = getComputedStyle(header).height.split('px')[0], header_class = "changeHeader", logo = document.getElementById("logo") ; if( window.pageYOffset &gt; (parseInt(header_height) + 500)) { header.classList.add(header_class); logo.src = "images/logo2.png"; } if( window.pageYOffset &lt; (parseInt(header_height) + 500)) { header.classList.remove(header_class); logo.src = "images/logo1.png"; } } This JS function returns the position of an element. Works fine as well: function getPosition(element) { var xPosition = 0; var yPosition = 0; while(element) { xPosition += (element.offsetLeft - element.scrollLeft + element.clientLeft); yPosition += (element.offsetTop - element.scrollTop + element.clientTop); element = element.offsetParent; } return { x: xPosition, y: yPosition }; } And, finally, this is the JS function that is being called when scrolling: function showPosition() { var myElement = document.getElementById("posBIKES"); var position = getPosition(myElement); var bike = document.getElementById("bikesMenu"); //alert("The element is located at: " + position.x + ", " + position.y); if(window.pageYOffset &lt; position.y) { window.getElementById("bikesMenu").classList.remove("changeMenu"); } if(window.pageYOffset &gt; position.y) { window.getElementById("bikesMenu").classList.add("changeMenu"); } } The problem is everything works fine until I try to add or remove the class to the item selected (the last function). Any other statement works fine, for example,…
tagged with: menu
has title: Menu items changing color according to position of element
favorite count: 0
tagged with: position
type: UnansweredQuestion

http://stackoverflow.com/comment/47609725
type: AnswerComment
has text: I know how to check the value, and the website isn't going to be public, which is why I'm coding it front end. The website is for my family, to update their profile, etc.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29738269

http://stackoverflow.com/comment/47601691
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29734032
has text: Exactly. www.google.com is accessible by Facebot, your localhost is not. Try exposing your local development environment with [ngrok](https://ngrok.com) for example, and it should work just fine.

http://stackoverflow.com/a/29845339
accepted answer of: http://stackoverflow.com/q/29843042
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/47846674
has comment: http://stackoverflow.com/comment/47826490
answers question: http://stackoverflow.com/q/29843042
has body: You can use template helpers that return true/false directly in the template. The following explanation assumes your current data context (this) is your user or profile which has the data: Radio Buttons and Check Boxes Male and then declare a template helper: genderCheck: function(value) { return (this.profile.gender == value); } The disabled attribute works in the same way. Blaze (Meteor Templates) removes obsolete checked and disabled attributes when delivering the DOM. Selects Mr Mrs .. And the helper: checkSalutation: function(value) { return (this.profile.salutation == value); } If you have an {{#each ..}} loop you can pass the element or an attribute of the element to the helper if you like. If you don't you can still access it with this inside the Javascript code. Template helpers refer to this as the current data context (e.g. inside a loop the current loop element).
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29813005
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29821450
tagged with: javascript
tagged with: webgl
score: 0
has body: I want to get texture from webgl just like i can use getImageData()when the canvas context is 2d. how can i get texture form webgl context?
answer count: 1
tagged with: opengl-es
accepted answer: http://stackoverflow.com/a/29821450
has title: how to get texture in webgl?without Canvas.toDataUrl()

http://stackoverflow.com/comment/47759296
comment on: http://stackoverflow.com/q/29813144
type: Comment
type: QuestionComment
score: 0
has text: But am getting the following error " Attribute "id" was already specified for element "a4j:outputPanel".

http://stackoverflow.com/q/29838949
has comment: http://stackoverflow.com/comment/47804258
has comment: http://stackoverflow.com/comment/47805082
type: Question
has comment: http://stackoverflow.com/comment/47806311
tagged with: javascript
tagged with: jquery
score: 0
has title: Unable to create bootstrap multiselect dropdown
has answer: http://stackoverflow.com/a/29839286
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to create a Bootstrap MultiSelect dropdownlist. I am using JQuery to call my asmx service and based on the data , i am binding it to the control. But I dont know where and what I am missing. Below are my pieces of work. 1. Data Access Code /// /// Method used for creating and managing Expiration policy types /// /// /// /// public object ManagePointBasedRewards(PointBasedRewards rewards, int operationFlag) { var result = new object(); using (var connection = new SqlConnection(ConnectionString)) { connection.Open(); using (var command = new SqlCommand("spPointBasedRewards_ManagePointBasedRewards", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@Id", rewards.Id); command.Parameters.AddWithValue("@Name", rewards.Name); command.Parameters.AddWithValue("@Points", rewards.Points); command.Parameters.AddWithValue("@ShortDescription", rewards.ShortDescription); command.Parameters.AddWithValue("@CreatedBy", rewards.ModifiedBy); command.Parameters.AddWithValue("@Flag", operationFlag); switch (operationFlag) { case 1: case 2: case 3: var i = command.ExecuteNonQuery(); result = i > 0; break; case 4: case 5: using (var reader = command.ExecuteReader(CommandBehavior.CloseConnection)) { var dt = new DataTable(); dt.Load(reader); result = dt; reader.Dispose(); } break; case 6: using (var reader = command.ExecuteReader(CommandBehavior.CloseConnection)) { var dt = new DataTable(); dt.Load(reader); reader.Dispose(); result = (from DataRow row in dt.Rows select new GenericKeyValuePair {Text = row["text"].ToString(), Value = row["value"].ToString()}).ToList(); } break; } connection.Dispose(); } return JsonConvert.SerializeObject(result); } } 2. Webservice: [WebMethod] [ScriptMethod(UseHttpGet = true)] public object GetAllActivePointBasedRewards(int flag) { var rewards = new PointBasedRewards { Name = "name", Points = 0, ShortDescription = string.Empty, ModifiedBy = string.Empty, CreatedBy = string.Empty, IsActive = true }; …
answer count: 1
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: web-services

http://stackoverflow.com/comment/47830644
type: QuestionComment
comment on: http://stackoverflow.com/q/29840090
has text: Good point but I've tested that case in things i've tried number 3) and just tried it again with
score: 0
type: Comment

http://stackoverflow.com/comment/47676862
type: QuestionComment
has text: What if you use `body` as selector (just for debugging purposes). Will it find, and bind, to the other forms then? The _unobtrusive.parse()_ will look for form elements with attributes `data-val=true`, are these present on all elements?
comment on: http://stackoverflow.com/q/29772709
score: 0
type: Comment

http://stackoverflow.com/comment/47710487
has text: add 'app.use(function(req, res, next){req.db = db;next();});' before 'app.use('/', routes);app.use('/users', users);' and check. You need to make your db accessible to the routes.
comment on: http://stackoverflow.com/q/29790718
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29737777
has body: I looked at some of the other answers to this problem, but none of them seemed to work for me. I have an input field that uses typeahead. It works most of the time, returning the correct values, but sometimes it returns undefined. Here is the .js file: // Add entry item typeahead configuration $(document).ready(function() { var items = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace("add_entry_item_name"), queryTokenizer: Bloodhound.tokenizers.whitespace, remote: "items.php?add_entry_item_name=%QUERY" }); items.initialize(); $("#add_entry_item").typeahead({ hint: true, highlight: true, minLength: 2 }, { name: "items", displayKey: "item_name", source: items.ttAdapter() }); }); Here is the items.php file: // Getting an instance of the connection to the database server $DB = DB::get_instance(); // Setting the header header("Content-Type: application/json"); // Exiting if nothing is set if (!isset($_GET["add_entry_item_name"])) { echo json_encode([]); exit(); } // Querying the database and JSON encoding the result echo json_encode($DB-&gt;query("SELECT item_ID, item_name FROM mytable WHERE item_name LIKE ?", array("%{$_GET['add_entry_item_name']}%"))); I have created my own database query function, so that's what you're seeing above. It works very well, so I'm 99% sure the problem lies elsewhere... Here's a sample output (items.php?add_entry_item_name=tec): [ { "item_ID": 465, "item_name": "Tectonic energy" } ] However, typing in "tec" to my input field returns two undefineds. Any suggestions?
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has title: Typeahead Sometimes Returns Undefined
tagged with: typeahead.js
answer count: 1
has answer: http://stackoverflow.com/a/29737880
tagged with: php
accepted answer: http://stackoverflow.com/a/29737880
type: AnsweredQuestion

http://stackoverflow.com/comment/126457754
has text: I was able to make this work by using the `bytesWritten` property which is available since node v 10.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29724552
type: AnswerComment

http://stackoverflow.com/a/29767963
type: Answer
upvote count: 1
has body: Since you're setting the value in a jquery event, angular doesn't know that something has been updated and you need to call $scope.$apply(); after setting $scope.value. PS: I really hope this is just a test and not actual production code. Edit: Well there were a few problems: ng-app was missing from the body tag, I assume you meant to change the value with the slider ... I made a plunkr:
score: 1
accepted answer of: http://stackoverflow.com/q/29767870
answers question: http://stackoverflow.com/q/29767870
has comment: http://stackoverflow.com/comment/47669744
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47669243

http://stackoverflow.com/q/29842934
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29843218
has answer: http://stackoverflow.com/a/29843049
type: Question
possible better answer: http://stackoverflow.com/a/29843028
has answer: http://stackoverflow.com/a/29843028
tagged with: javascript
answer count: 6
tagged with: jquery
has answer: http://stackoverflow.com/a/29843245
accepted answer: http://stackoverflow.com/a/29843245
has answer: http://stackoverflow.com/a/29843202
upvote count: 2
has answer: http://stackoverflow.com/a/29843225
downvote count: 1
favorite count: 0
has body: I am trying to execute a function via onclick, but the appended links are not containing the correct quotes and random signs are added. $('#ip_list').append(" " + ip + " "); Turns out as following in Chrome Tools: 192.168.1.129 Where does the double quote come from where i simply used single quotes around the IP-address?
has title: Quotes not turning out as they should while appending with jQuery

http://stackoverflow.com/a/64285428
upvote count: 3
downvote count: 1
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/127311756
has body: jq.node looks pretty interesting and seems to be getting popular. Features include a mash of jq and javascript, claim is that "jq.node is JavaScript and Lodash in your shell" and "some features of jq are not currently implemented in jq.node". Not sure if it can be used in the browser. But it can be installed with npm: https://github.com/fgribreau/jq.node
has comment: http://stackoverflow.com/comment/113683576
answers question: http://stackoverflow.com/q/29815940

http://stackoverflow.com/a/60207944
type: Answer
has comment: http://stackoverflow.com/comment/107826457
has body: I'm not sure if anyone is still looking for solutions for this problem in 2020, but after trying a lot of things that didn't work, I found a very simple one. It's all about setting no height to the item that's not active. Like so: .owl-item {height: 0;} .owl-item.active {height: auto;} It's elegant and no javascript is needed. You can even play with transitions to set some cool animations. I hope I have helped someone here. PS: To use this method, keep autoHeight: false ... otherwise the carousel height will be set to 0 by the library
score: 18
upvote count: 18
has comment: http://stackoverflow.com/comment/114036348
downvote count: 0
has comment: http://stackoverflow.com/comment/116185386
has comment: http://stackoverflow.com/comment/107827149
answers question: http://stackoverflow.com/q/29769409

http://stackoverflow.com/q/29789833
has comment: http://stackoverflow.com/comment/50923958
tagged with: javascript
tagged with: ui-select
has title: How to show scrollbar inside ui-select dropdownlist
answer count: 1
has body: I am using ui-select for showing list of states. My state list is greater than ui-select dropdown height. How can I show the scrollbar inside ui-select drop down list so that user knows there are more items in the list?
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/46377138
has comment: http://stackoverflow.com/comment/47708838
score: 2
has comment: http://stackoverflow.com/comment/50985854
type: Question
has comment: http://stackoverflow.com/comment/47708935
downvote count: 0

http://stackoverflow.com/q/29744527
has comment: http://stackoverflow.com/comment/47622904
tagged with: node.js
favorite count: 0
has title: understanding require() with module.exports with javascript and browserify
type: Question
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/47621778
has answer: http://stackoverflow.com/a/29744660
has body: I am a c++ programmer at heart and I'm currently being thrown into the deep end with javascript and asked to swim very quick. I am using browserify so I am able to use the require function that node.js uses to get get access to code in other files. Now everything I have done seems to be working fine, I am just unsure that I am doing it correctly. //a.js module.exports = function(){ alert("hello world"); } //b.js var myClass = new MyClass(); module.exports = myClass; //c.js var a = require("./a.js"); a(); var b = require(./b.js"); b.prototype.test = 555; //d.js function () { var a = require("./a.js"); a(); var b = require(./b.js"); assert(b.test === 555); } function () { // duplicated require called inside same file but different function var a = require("./a.js"); a(); } So in every function and every file I want to use a.js do I have to put the require call? Seems like it will get a bit convoluted. Is there a better way to do this? Also assuming that c.js is ran before d.js will the assert pass or does it result in a copy being created of myClass so the objects are different between C and D? Thanks for any help.
downvote count: 0
tagged with: javascript
score: 1
accepted answer: http://stackoverflow.com/a/29744660
tagged with: browserify
type: AnsweredQuestion

http://stackoverflow.com/a/29800181
score: 1
answers question: http://stackoverflow.com/q/29798881
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29798881
type: Answer
upvote count: 1
has body: There is an answer Angular UI Router - Nested States with multiple layouts with a working plunker showing layout: http://plnkr.co/edit/I0BJ09BxR7nG9kZDeEIv?p=preview The point is that there is index.html with And the root state then injects into that ui-view="layout" its own template (layout) and also injects into layout views. So firstly the layout template: And here is state def $stateProvider .state('root', { url: '', views: { 'layout': { templateUrl: 'partials/layout/1-column.html' }, 'header@root': { templateUrl: 'partials/layout/sections/header.html' }, 'footer@root': { templateUrl: 'partials/layout/sections/footer.html' } } }) And how it is working? we are using the absolute and relative target names. View Names - Relative vs. Absolute Names Behind the scenes, every view gets assigned an absolute name that follows a scheme of viewname@statename, where viewname is the name used in the view directive and state name is the state's absolute name, e.g. contact.item. You can also choose to write your view names in the absolute syntax. For example, the previous example could also be written as: .state('report',{ views: { 'filters@': { }, 'tabledata@': { }, 'graph@': { } } })

http://stackoverflow.com/q/29832007
tagged with: javascript
tagged with: jquery
score: 4
has body: I'm trying to use materialize date picker (http://materializecss.com/forms.html). With that, I want to popup the date picker when I click on an icon. I have implemented two implementations where the only difference between the two is putting an alert('clicked') with the code. without the alert('clicked'): http://jsfiddle.net/1bnnkhbw/ with the alert('clicked'): http://jsfiddle.net/1bnnkhbw/1/ The second one works while the first one doesn't.. (in chrome)!!! Anybody knows the reason for this behavior? And a way to make the 1st one work?
answer count: 1
has title: Strange behaviour in Material datepicker
accepted answer: http://stackoverflow.com/a/29833129
favorite count: 0
tagged with: datepicker
upvote count: 4
has answer: http://stackoverflow.com/a/29833129
type: AnsweredQuestion
tagged with: material-design
type: Question
has comment: http://stackoverflow.com/comment/47792974
has comment: http://stackoverflow.com/comment/47791557
downvote count: 0

http://stackoverflow.com/q/29745586
downvote count: 1
type: Question
has body: I have a string with 12 hour formatted time only var time="12:10:12: PM" I want to convert this string to seconds. how can i do this in moment.js?
tagged with: javascript
tagged with: jquery
answer count: 3
has answer: http://stackoverflow.com/a/47219132
has comment: http://stackoverflow.com/comment/47623587
favorite count: 0
has title: Convert HH:MM:SS to seconds in momentjs
tagged with: angularjs
upvote count: 30
has comment: http://stackoverflow.com/comment/47623696
has comment: http://stackoverflow.com/comment/47623663
has answer: http://stackoverflow.com/a/29745757
score: 29
accepted answer: http://stackoverflow.com/a/29745757
tagged with: momentjs
has answer: http://stackoverflow.com/a/62818682
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/47219132
has comment: http://stackoverflow.com/comment/47623487
has comment: http://stackoverflow.com/comment/47623531
linked to: http://stackoverflow.com/q/3830244

http://stackoverflow.com/comment/47725635
has text: homework can be tough, eh? :/
score: 1
comment on: http://stackoverflow.com/q/29798248
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/134700045
type: AnswerComment
type: Comment
has text: 30 minutes wasted trying to convert to json an awaited response
comment on: http://stackoverflow.com/a/29778812
score: 0

http://stackoverflow.com/comment/47571473
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29715410
has text: you did not tell that you want a whole solution but i hope this helps you :)
type: AnswerComment

http://stackoverflow.com/q/29722721
type: Question
has answer: http://stackoverflow.com/a/29723154
score: 3
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/29722959
linked to: http://stackoverflow.com/q/29720716
has comment: http://stackoverflow.com/comment/47579895
downvote count: 0
tagged with: meteor
favorite count: 0
has title: Meteor reactive function for Template updates
has body: I want to solve the following problem in Meteor.js: I have a HTML element that appears in a template only if the user is logged in: {{#if currentUser}} &lt;input ...&gt; {{/if}}. After the HTML element appears I need to execute a JS command on it. Thus I need some kind of callback that happens after the Template is updated. How to achieve this? None of the reactive data sources I know of do the trick in this case as for example the Meteor.user() source triggers dependencies before the Template is updated. Also see my prior question here.
has comment: http://stackoverflow.com/comment/47579809
type: AnsweredQuestion
upvote count: 3
has answer: http://stackoverflow.com/a/29722959
possible better answer: http://stackoverflow.com/a/29723154

http://stackoverflow.com/comment/47561120
type: AnswerComment
type: Comment
has text: This is the closest to what I expected
score: 0
comment on: http://stackoverflow.com/a/29712577

http://stackoverflow.com/q/29800552
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/29801113
accepted answer: http://stackoverflow.com/a/29801113
has comment: http://stackoverflow.com/comment/47729710
type: Question
score: 3
has comment: http://stackoverflow.com/comment/47830454
has comment: http://stackoverflow.com/comment/47736906
has title: The color of selected item on AngularJS disappears
upvote count: 3
has comment: http://stackoverflow.com/comment/47729927
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47729566
favorite count: 0
has body: I need the color of the selected item not to disappear after I click any other part of the page. Index.html {{item.title}} app.js $rootScope.menu = [ { title: 'Product', url: 'product' }, { title: 'About', url: 'about' }, { title: 'Contact', url: 'contact' }, { title: 'Register', url: 'register' }, { title: 'Login', url: 'login' } ]; I add this code but he don't work App.controller('MainController', function ($scope, $rootScope) { $scope.isActive = function(item) { return $scope.selected === item; }; $rootScope.menu = [ { title: 'Product', url: 'product' }, { title: 'About', url: 'about' }, { title: 'Contact', url: 'contact' }, { title: 'Register', url: 'register' }, { title: 'Login', url: 'login' } ]; }); problem unresolved
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/a/29822367
answers question: http://stackoverflow.com/q/29822128
score: 0
has comment: http://stackoverflow.com/comment/47772259
type: Answer
has body: you just cant use .click() as some browser wont pick it up. please test after using . Open file dialog

http://stackoverflow.com/q/29763603
has comment: http://stackoverflow.com/comment/47658882
has comment: http://stackoverflow.com/comment/47658873
answer count: 2
has comment: http://stackoverflow.com/comment/47658794
has answer: http://stackoverflow.com/a/29763795
linked to: http://stackoverflow.com/q/518000
tagged with: javascript
has comment: http://stackoverflow.com/comment/47658837
has title: Making a local copy of a global variable in JavaScript
favorite count: 0
linked to: http://stackoverflow.com/q/13104494
has comment: http://stackoverflow.com/comment/47658901
score: 2
has comment: http://stackoverflow.com/comment/47658793
downvote count: 0
accepted answer: http://stackoverflow.com/a/29764600
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/10887291
possible better answer: http://stackoverflow.com/a/29763795
has answer: http://stackoverflow.com/a/29764600
has body: According to this question, if I pass a global variable as an argument to a function, that global becomes a local copy. If that is the case, why does this jfiddle behave the way it does? Shouldn't the alert show dog, cat and not just cat? I even went one further step than the example and specifically copied the global variable into a local variable, but the result is the same. I'd really like to be able to shift() the local while keeping the global intact.
upvote count: 2

http://stackoverflow.com/q/29703249
type: Question
score: 3
has body: I am using Uploadcare widget to upload profile images in an nodejs app. In Uploadcare widget once user is done uploading a single file, I want to go back to original widget state so the user can choose another image to replace the previous one. widget.onUploadComplete(function(info) { // assign image to image tag $('#avatar').attr('src', info.cdnUrl); // reset the widget to user can see the the "choose image" button again. widget.value(); } However the widget.value() doesn't seem to do anything although that is suggested on issue on uploadcare
tagged with: javascript
answer count: 1
tagged with: file-upload
favorite count: 0
upvote count: 3
tagged with: node.js
type: AnsweredQuestion
has title: how to reset uploadcare widget to original state after the file upload is complete
tagged with: uploadcare
downvote count: 0
has answer: http://stackoverflow.com/a/29703745
accepted answer: http://stackoverflow.com/a/29703745

http://stackoverflow.com/comment/47751132
score: 0
comment on: http://stackoverflow.com/q/29811431
has text: If you're hiding your tables on click, what's the purpose of setting it at the first place inside the parent? Than if you click the LI again it should appear at the old place...?!? I'm out of here, good luck!
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29714691
has answer: http://stackoverflow.com/a/29740010
accepted answer: http://stackoverflow.com/a/29740010
type: Question
tagged with: c#
has answer: http://stackoverflow.com/a/29714728
score: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/29714726
tagged with: word-cloud
has comment: http://stackoverflow.com/comment/47564516
upvote count: 4
answer count: 3
has comment: http://stackoverflow.com/comment/47663525
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/197769
linked to: http://stackoverflow.com/q/17037892
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29714728
has body: I am trying to implement jQCloud word cloud with click event handler. It requires me to pass a javascript function in JSON. In C#, I have made the dynamic JSON text foreach (var r in result) { sbChart.Append("{\"text\": \"" + r.Key + "\", \"weight\": " + r.Count().ToString() + ", "); sbChart.Append("\"handlers\": { \"click\": \"function() { alert('You clicked " + r.Key + "');}\"}}, "); } if (sbChart.Length != 0) { returnString = "[" + sbChart.ToString().Substring(0, sbChart.Length - 2) + "]"; } I return this through web method to javascript where my code is var words = JSON.parse(strJSON); $('#div').jQCloud(words); The JSON generated is [ {"text": "the", "weight": 111, "handlers": { "click": "function() { alert('You clicked the');}"}}, {"text": "in", "weight": 66, "handlers": { "click": "function() { alert('You clicked in');}"}} ] However, since my function is a string, it does not gets execute as a object. And if I remove the double quotes before and after the function statement, it gives me Invalid Character error during parse. Please can anyone help me as to how can I make this alert work?
tagged with: http://stackoverflow.com/tag/json
has title: Passing javascript function in JSON
downvote count: 1

http://stackoverflow.com/comment/47592443
type: Comment
comment on: http://stackoverflow.com/a/29728110
has text: The output is still like this -> var amount = 'package_amount'; where as It should get updated with some numbers
type: AnswerComment
score: 0

http://stackoverflow.com/q/29748005
has comment: http://stackoverflow.com/comment/47628497
downvote count: 0
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/995183
has answer: http://stackoverflow.com/a/76052170
type: AnsweredQuestion
score: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47628482
has answer: http://stackoverflow.com/a/29748170
favorite count: 0
possible better answer: http://stackoverflow.com/a/47447697
type: Question
has title: Only allow numbers, backspace and delete keys on input text
has answer: http://stackoverflow.com/a/47447697
has comment: http://stackoverflow.com/comment/47628964
has answer: http://stackoverflow.com/a/29748322
upvote count: 3
accepted answer: http://stackoverflow.com/a/29748170
has body: I have this input text in a HTML5 page: &lt;input type="text" class="quantity" onkeypress='return (event.charCode &gt;= 48 &amp;&amp; event.charCode &lt;= 57) || event.charCode == 8 || event.charCode == 46' required /&gt; Because I need an input text that does allow only numbers, but I could need also delete a number. When I press backspace or delete nothing happens. The code above only allows numbers. How can I allow also backspace and delete?
answer count: 4

http://stackoverflow.com/a/29702277
upvote count: 1
downvote count: 0
has body: In your function "search()", just before your "for" loop, declare a variable "searchResult", then concatenate each result line in this variable. At the end, put your result in the "main" div : function search() { var brandCheck=checkBrand(); var networkCheck=checkNetwork(); var model model = document.getElementById("phone_model"); //??? var f f = document.getElementById("internet"); //checkbox var g g = document.getElementById("upcost"); //auto var h h = document.getElementById("month_cost"); //auto ask var i i = document.getElementById("contract_length"); //dropdown // Declare your searchResult variable var searchResult = ""; for (var p=0;p<contract.length;p++) { var matches = 0; var total_number_of_conditions = 10; if (brandCheck == contract[p].brand) matches += 1; if (model.value == contract[p].model) matches += 1; if (networkCheck == contract[p].network) matches += 1; if (minutes >= contract[p].minutes) matches += 1; if (text >= contract[p].texts) matches += 1; if (f.value == contract[p].data) matches += 1; if (g.value == contract[p].upcost) matches += 1; if (h.value == contract[p].monthlycost) matches += 1; if (i.value == contract[p].length) matches += 1; if (matches > 0) { var percentage_matched = 100 * (matches / total_number_of_conditions); // Concatene lines of the table result searchResult += " " + contract[p].brand + " " + contract[p].model + " " + contract[p].network + " " + contract[p].minutes + " " + contract[p].texts + " " + contract[p].data + " " + contract[p].upcost + " " + contract[p].monthlycost + " " + contract[p].length + " " + percentage_matched + "% "; } } // Check if there is result if(searchResult != ""){ searchResult = " " + searchResult + " "; } // Put the result in the main div document.getElementsByClassName('main')[0].innerHTML = searchResult; }
has comment: http://stackoverflow.com/comment/47541413
has comment: http://stackoverflow.com/comment/47542220
has comment: http://stackoverflow.com/comment/47559106
has comment: http://stackoverflow.com/comment/47542634
has comment: http://stackoverflow.com/comment/47543157
type: Answer
has comment: http://stackoverflow.com/comment/47541685
answers question: http://stackoverflow.com/q/29699794
score: 1
has comment: http://stackoverflow.com/comment/47542760

http://stackoverflow.com/q/29737083
has comment: http://stackoverflow.com/comment/47607370
answer count: 1
favorite count: 0
downvote count: 5
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47607810
type: AnsweredQuestion
upvote count: 0
score: -5
has comment: http://stackoverflow.com/comment/47607374
has comment: http://stackoverflow.com/comment/47607620
type: Question
has title: javascript terms for functions for registration form
has body: I have an HTML registration page with a series of JavaScript validation functions. I want to add a condition that if all of the functions validate correctly => do something else. I want to make it so that I can run all of the validation functions inside a single function. function UserName() { var User = register.Username.value; var i; if (User.length == 0) alert("Please Enter First name"); else if (User.length &lt; 6) alert("your name most have a minimum of 6 digits/charachters"); } function Passw() { var Pass = register.password.value; var SCharCount = 0; var LCharCount = 0; var NCount = 0; var special = 0; var i; if (Pass == "") alert("Please enter a Password"); else if (Pass.length &gt; 5 &amp;&amp; Pass.length &lt; 15) { for (i = 0; i &lt; Pass.length; i++) { if ((Pass.charAt(i) &gt;= 'a') &amp;&amp; (Pass.charAt(i) &lt;= 'z')) SCharCount++; else if ((Pass.charAt(i) &gt;= 'A') &amp;&amp; (Pass.charAt(i) &lt;= 'Z')) LCharCount++; else if ((Pass.charAt(i) &gt;= '0') &amp;&amp; (Pass.charAt(i) &lt;= '9')) NCount++; else if ((Pass.charAt(i) &gt;= '!') &amp;&amp; (Pass.charAt(i) &lt;= '?')) special++; } } if ((SCharCount==0) || (LCharCount==0) || (NCount == 0) || (special==0)) { alert("Your password weak please notes that you most have at least 5-15 digits providen by one of each keys :1-9 , !-? , a-z , A-Z"); } else return true; } function ConfPassw() { var Pass = register.password.value; var CPass = register.Confirm_password.value; if (Pass != CPass) { alert("the password must match"); } } function FirstName() { var Fname = register.Input_Your_Name.value; if (Fname.length == 0) { alert("Enter First Name"); } } function Lastname() { var Lname = register.Input_Your_Name.value; if (Lname.length == 0) { alert("Enter Last Name"); } } function CountryColumn() { var Country = register.Country.value; var Count = 0; var i; if (Country.length == 0) alert("Country not found"); else for (i = 0; i &lt; Country.length; i++) { if ((Country.charAt(i) &gt;= '0') &amp;&amp; (Countr…
has comment: http://stackoverflow.com/comment/47608306
tagged with: javascript
has answer: http://stackoverflow.com/a/29738168
accepted answer: http://stackoverflow.com/a/29738168

http://stackoverflow.com/a/29768485
has comment: http://stackoverflow.com/comment/47668440
downvote count: 0
upvote count: 2
has body: Ajax is asynchronous. Move the modal body content update part inside success callback. $(function(){ $('.all-opps-updates').on('show.bs.modal', function (event) { var button = $(event.relatedTarget) // whatever that triggered the modal var my_id = button.data('myid') // Extract info from data-* attributes var url = "some url/"+my_id; var update_form = ''; $.ajax({ type: 'GET', url: url, success: function(resp){ update_form = resp; var modal = $(this); modal.find('.modal-title').text("title"); modal.find('.modal-body').html(update_form); modal.find('.modal-footer').html(" some content "); }); } }); });
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29768413

http://stackoverflow.com/comment/47835324
score: 0
comment on: http://stackoverflow.com/q/29818384
type: Comment
type: QuestionComment
has text: Ergo: not marty/flux/react related.

http://stackoverflow.com/comment/47594207
comment on: http://stackoverflow.com/q/29730106
type: Comment
type: QuestionComment
has text: [Jared Wyles](https://groups.google.com/forum/#!topic/google-chrome-developer-tools/x_QZEBydRhA) seems to have hacked together something like this back in 2013. However, he seems to have since gone silent?
score: 0

http://stackoverflow.com/comment/47732585
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29802192
has text: Oh nice, I didn't even catch that I had search higher up! Well how then do I display the `emails` that contain the same characters as what I search for?
type: AnswerComment

http://stackoverflow.com/q/29819286
has comment: http://stackoverflow.com/comment/47766111
favorite count: 0
possible better answer: http://stackoverflow.com/a/29819525
downvote count: 2
has answer: http://stackoverflow.com/a/29819525
has body: I could use some help here. I have a fullscreen app. I am looking to open a popup on load of the application and before the view is loaded. Based on the actions taken on the popup I want the view to be loaded. Any suggestions?
has answer: http://stackoverflow.com/a/33188606
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47772008
has comment: http://stackoverflow.com/comment/47765968
tagged with: sapui5
has title: Open popup before View is loaded and only load the view after the popup closes
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/33188606
upvote count: 0
score: -2
tagged with: sap-fiori
tagged with: javascript
has comment: http://stackoverflow.com/comment/47765391
has comment: http://stackoverflow.com/comment/47771845

http://stackoverflow.com/q/29790604
answer count: 2
score: 5
has answer: http://stackoverflow.com/a/29790757
accepted answer: http://stackoverflow.com/a/29790757
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29790770
has body: I have created Ruby Session Variable I need to access this variable in Javascript Lets take this scenario session[:note] = 'Some Notes' this is done in Ruby on Rails Now I want to access this is like var session_val = js-code for access above session variable. its not js.erb I know if it is js.erb we can access like var sesion_val = "&lt;%= session[:note] %&gt;" TIA
favorite count: 0
has answer: http://stackoverflow.com/a/29790770
tagged with: ruby
upvote count: 5
type: AnsweredQuestion
downvote count: 0
tagged with: session
has title: How to Access Ruby Session Variable in Javascript
type: Question

http://stackoverflow.com/comment/47712740
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29789591
type: AnswerComment
has text: you can write servlet like protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("application/text"); PrintWriter out=response.getWriter(); out.println("hii"); out.close(); out.flush(); }

http://stackoverflow.com/comment/47801076
comment on: http://stackoverflow.com/q/29837190
has text: Do you wish to make it narrower by removing letters, or by shrinking the text? Or, I suppose, by wrapping it?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47573888
comment on: http://stackoverflow.com/q/29719477
score: 0
type: QuestionComment
type: Comment
has text: @FabioCosta I have added demonstration.

http://stackoverflow.com/comment/47631522
type: AnswerComment
type: Comment
has text: yeah, i forgot the quotes. Added them now.
score: 0
comment on: http://stackoverflow.com/a/29749644

http://stackoverflow.com/a/29783968
score: 5
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47735716
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29772668
has body: This question is unfortunately controversial. I personally recommend opening the database each time. Others will disagree (and have, prolifically). If you can guarantee your database requests will always occur after a connection is established, it would be ok to use a single connection. If you are unsure of how indexedDB works in various browsers, or cannot guarantee the connection has been established yet, or cannot guarantee the connection is still open, then open a connection for each separate task. If you know how async code works in general, you are probably fine doing whatever you find best, as neither way is technically wrong.
type: Answer
has comment: http://stackoverflow.com/comment/47725490
upvote count: 5
has comment: http://stackoverflow.com/comment/47698599
answers question: http://stackoverflow.com/q/29772668

http://stackoverflow.com/q/29716773
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: css
score: 1
upvote count: 1
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/66183619
downvote count: 0
has comment: http://stackoverflow.com/comment/47575488
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47591796
has body: Long time reader, first time poster. I have recently started learning to use bootstrap. I am stuck trying to get the a Bootstrap carousel to preload showing a spinning wheel (or similar effect). I have pieced together the effect I'm going for, my first four images 'flick through' and the carrousel stops on my final image – but what I can't manage is to have the entire carousel content load behind a spinning wheel before the carousel starts. This is my work in progress – http://maxsendak.com/test/pu_v2/max.html – so you can see, it is the whole header tag that needs to load with a 'load in progress' before it fires the carousel script and starts flicking through the slides. Max Wilson Creative See More Script to fire carousel needs to fire after everything is loaded. As is often the case when I'm learning my way around these things, I think it might be that I am missing something simple – is this the case?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47578273
favorite count: 0
has answer: http://stackoverflow.com/a/29943154
has title: Preload an entire Bootstrap carousel

http://stackoverflow.com/q/29767055
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29767116
type: AnsweredQuestion
type: Question
tagged with: google-chrome-devtools
has title: How to check which line of Javascript issues HTTP request
has body: From Chrome Developers Tool, I can see there is a request to http://www.example.com/abc. I am sure it's an async request from my Javascript but I am not sure which line it is. How to check the exact source of this request using Chrome Developers Tool
accepted answer: http://stackoverflow.com/a/29767116
score: 0

http://stackoverflow.com/comment/47527313
has text: Since you are using jQuery, you can also listen for jQuery ready
type: AnswerComment
comment on: http://stackoverflow.com/a/29695579
score: 0
type: Comment

http://stackoverflow.com/q/29840099
tagged with: datepicker
has comment: http://stackoverflow.com/comment/47806490
answer count: 1
has comment: http://stackoverflow.com/comment/47806525
has body: I have a peculiar problem. The datepicker does not work when I load a particular javascript function. Code: Datepicker $(function() { $('input.datepicker').datepicker(); }); $(function () { $("#txtFrom").datepicker({ numberOfMonths: 1, onSelect: function (selected) { var dt = new Date(selected); dt.setDate(dt.getDate() + 1); $("#txtTo").datepicker("option", "minDate", dt); } }); $("#txtTo").datepicker({ numberOfMonths: 1, onSelect: function (selected) { var dt = new Date(selected); dt.setDate(dt.getDate() - 1); $("#txtFrom").datepicker("option", "maxDate", dt); var a = $("#txtTo").datepicker('getDate').getTime(); b = $("#txtFrom").datepicker('getDate').getTime(); c = (a - b) / (1000 * 60 * 60 * 24); $("#rem").val(c); } }); }); Javascript Function(this executes onLoad) init(); var a; function init(){ var db = openDatabase('CBDB', '1.0', 'mySpecialDatabaseThatWontWork',10*1024*1024); db.transaction(function (tx) { tx.executeSql('SELECT * FROM user',[], function (tx, results) { var rows = results.rows; for (var index = 0; index < rows.length; index++) { var x = rows.item(index); a = results.rows.item(index).empid; } next(); });}); } function next(){ var db = openDatabase('CBDB', '1.0', 'mySpecialDatabaseThatWontWork',10*1024*1024); db.transaction(function (tx) { console.log("global"+a); tx.executeSql('SELECT * FROM login WHERE manager=?',[a], function (tx, results) { var rows = results.rows; var msg=" "; for (var index = 0; index < rows.length; index++) { msg +=" "+results.rows.item(index).name+","+results.rows.item(index).empid+" " } var total= " Employee "+msg+" "; document.querySelector('#status').innerHTML += total; });}); } I'm not able to spot the mistake. Also the javascript function loads after the HTML content is loaded on to the page.
has comment: http://stackoverflow.com/comment/47809513
upvote count: 1
has comment: http://stackoverflow.com/comment/47811132
has answer: http://stackoverflow.com/a/29842482
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
favorite count: 0
type: Question
has title: Datepicker(jQuery) not loading on loading specific javascript function

http://stackoverflow.com/a/29784541
upvote count: 1
type: Answer
downvote count: 0
has body: You can use the optionsText and optionsValue bindings, but you'll need to change lengthTypes to an observableArray with objects at each index. For example - JSFiddle if you're interested HTML &lt;select data-bind="options: lengthTypes,optionsText:'label',optionsValue:'value', value: length" /&gt; JavaScript var Furniture = function (data) { var self = this; self.name = ko.observable(''); self.size = ko.observable(''); self.length = ko.observable(); self.lengthTypes = ko.observableArray([{label: 'Short', value: 0 },{label: 'Long', value: 1 },{label: 'Very Long', value: 2 }]); } http://knockoutjs.com/documentation/options-binding.html
score: 1
has comment: http://stackoverflow.com/comment/47705272
accepted answer of: http://stackoverflow.com/q/29784365
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47699454
answers question: http://stackoverflow.com/q/29784365

http://stackoverflow.com/comment/47600885
type: AnswerComment
score: 0
type: Comment
has text: Would it be the same thing for the words/text underneath? Because I've tried applying it to each tag inside there but they always disappear when re-sizing.
comment on: http://stackoverflow.com/a/29732248

http://stackoverflow.com/q/29770701
possible better answer: http://stackoverflow.com/a/29770738
answer count: 2
has title: jQuery ScrollTo anchor link but class not ID
has answer: http://stackoverflow.com/a/29770738
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29770791
type: AnsweredQuestion
score: 2
upvote count: 2
type: Question
has body: How can I modify this so that I can make it scroll to the class rather than an ID? JS: // Scroll To # Links $('a[href^="#"]').on('click',function (e) { e.preventDefault(); var target = this.hash; var $target = $(target); $('html, body').stop().animate({ 'scrollTop': $target.offset().top }, 700, 'swing', function () { window.location.hash = target; }); }); HTML: test link testing content JSFIDDLE.
accepted answer: http://stackoverflow.com/a/29770791
tagged with: javascript

http://stackoverflow.com/a/29734230
answers question: http://stackoverflow.com/q/29734135
has body: Event handlers this context refers to the element that fired the event. You can fix this by using the classic var that = this construct. var audio1 = new Audio("http://jplayer.org/audio/m4a/Miaow-07-Bubble.m4a", "audio/mpeg"); function Audio(src, type) { //create audioElement this.audioElement = document.createElement("audio"); this.audioElement.setAttribute("src", src); this.audioElement.setAttribute("type", type); document.getElementById("main").appendChild(this.audioElement); //create audioControls this.audioControls = document.createElement("div"); this.audioControls.setAttribute("class", "play button"); document.getElementById("main").appendChild(this.audioControls); this.playing = false; var that = this; this.audioControls.onclick = function () { if (that.playing) { that.pause(); } else { that.play(); } } this.play = function() { this.audioElement.play(); this.playing = true; this.audioControls.setAttribute("class", "pause button"); }; this.pause = function() { this.audioElement.pause(); this.playing = false; this.audioControls.setAttribute("class", "play button"); }; } @font-face { font-family:"Ionicons"; src:url("http://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.eot?v=2.0.1"); src:url("http://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.eot?v=2.0.1#iefix") format("embedded-opentype"), url("http://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.ttf?v=2.0.1") format("truetype"), url("http://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.woff?v=2.0.1") format("woff"), url("http://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.svg?v=2.0.1#Ionicons") format("svg"); font-weight:normal; font-style:normal; } .button { font-family:"Ionicons"; font-size:48px; } .play:before { content:'\f488' } .pause:before { content:'\f478' } &lt;div id="main"&gt;&lt;/div&gt;
accepted answer of: http://stackoverflow.com/q/29734135
type: AcceptedAnswer
type: Answer
score: 0

http://stackoverflow.com/q/29809593
has answer: http://stackoverflow.com/a/29827267
score: 0
has body: Respected Javascript users, I am using CEF to bind JS with C++.I am running into the issue that OnWebKitInitialized is not being invoked at all. The native code binding is solely depending on this callback (correct me if I am wrong. But the only way the JS can call C++ is via this OnWebKitInitialized and Execute methods). Here is the pseudo code for the initialization process: void OnInit(){ HINSTANCE instance = wxGetInstance(); CefMainArgs main_args(instance); CefRefPtr&lt;CefApp&gt; app = new MainHandler(); int exit_code = CefExecuteProcess(main_args, app, nullptr); if (exit_code &gt;= 0) { // The sub-process has completed so return here. return false; } // Specify CEF global settings here. CefSettings settings; settings.no_sandbox = true; settings.multi_threaded_message_loop = true; settings.ignore_certificate_errors = true; // Initialize CEF. CefInitialize(main_args, settings, app, nullptr); } Then in MainHandle class : class MainHandle : public CefApp, public CefBrowserProcessHandler, public CefRenderProcessHandler { virtual OnContextCreated //full syntax virtual void OnContextInitialized() override; virtual void OnWebKitInitialized(); void OnRenderProcessThreadCreated(CefRefPtr&lt;CefListValue&gt; extra_info) ; ..other related code } Here OnContextInitialized and OnRenderProcessThreadCreated are being called, because the MainHandle is a subclass of browser process handler. But none of render process handler callbacks are being called. Any one know how to make the OnWebKitInitialized get invoked? or if something might be wrong with the code above that might hinder the callback calling?
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has title: Rg. OnWebKitInitialized not being invoked
type: Question
tagged with: c++

http://stackoverflow.com/a/29837061
has comment: http://stackoverflow.com/comment/47800851
accepted answer of: http://stackoverflow.com/q/29836988
type: AcceptedAnswer
downvote count: 0
score: 6
type: Answer
upvote count: 6
has body: You can try be using pure CSS to achieve a triangle: Markup: &lt;div class="triangle"&gt;&lt;/div&gt; Style: .triangle { width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 10px solid black; } As result, you have a solid down arrow that you can use. If you want to go beyond, you can override this property with another similar triangle over it and make an exactly caret in a "V" format: Markup: &lt;div class="triangle"&gt; &lt;div class="over-triangle"&gt;&lt;/div&gt; &lt;/div&gt; Style: .triangle { width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 10px solid black; } .over-triangle { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid white; position: relative; top: -10px; left: -5px; } This way you can get the exact form of a caret: You can apply it to another element by making the triangle display: inline-table to align to the same line. Now, it goes to you implement it on links!
answers question: http://stackoverflow.com/q/29836988

http://stackoverflow.com/q/29709919
has body: I am trying to code the dice game Yahtzee in Javascript for fun. I have a basic interface set up with images of dice. In reference to my problem, a few Yahtzee rules to know would be: There are 5 dice After 3 rolls, the player has to pick a points category to score with Here is the code that is not working: var die1 = Math.floor((Math.random() * 6) + 1), die2 = Math.floor((Math.random() * 6) + 1), die3 = Math.floor((Math.random() * 6) + 1), die4 = Math.floor((Math.random() * 6) + 1), die5 = Math.floor((Math.random() * 6) + 1), dieArray = ["", die1, die2, die3, die4, die5], optionResult1 = 0; document.getElementById("option1").onclick = function() { if (rollCount == 3 &amp; option1 == false) { for (i=0; i &lt; 5; i++) { i++; if (dieArray[i] == 1) { optionResult1++; } if (i = 5) { option1 = true; document.getElementById("optionResult1").innerHTML = optionResult1; console.log("finished"); } } console.log(optionResult1); } else if (rollCount != 3) { document.getElementById("dialogue").innerHTML = "You cannot pick this yet because you have not rolled 3 times."; } else if (option1 == true) { document.getElementById("dialogue").innerHTML = "You cannot pick this because you have already used this category."; } } What should happen (assuming it's the third roll and this points category has not already been chosen previously): The for loop should go through the dieArray and for each die that is a "one", add 1 to the optionResult1 variable. If there were three "ones" out of five dice, optionResult1 should be "3", etc. What instead happens is that it usually comes back as 1 less than what it should be. Even if I can see in the console that the array clearly shows three "ones", it will give me "2", or sometimes "0". Is there anything wrong with the code you see? There is obviously other code in the document, but I am fairly certain the problem is within this function. Sorry if this was confusing, it's probably easier to understand if you have played Yahtzee... I know that I coul…
score: 0
has comment: http://stackoverflow.com/comment/47555841
tagged with: for-loop
has comment: http://stackoverflow.com/comment/47555662
has comment: http://stackoverflow.com/comment/47555788
favorite count: 0
has comment: http://stackoverflow.com/comment/47555590
has title: JS for loop not working correctly, trying to loop through an array of variables
has comment: http://stackoverflow.com/comment/47555854
has comment: http://stackoverflow.com/comment/47555813
answer count: 0
type: UnansweredQuestion
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47555560
has comment: http://stackoverflow.com/comment/47555805
has comment: http://stackoverflow.com/comment/47555979
tagged with: arrays
has comment: http://stackoverflow.com/comment/47555485
tagged with: javascript

http://stackoverflow.com/q/29783111
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47696169
downvote count: 0
has comment: http://stackoverflow.com/comment/47696792
type: Question
accepted answer: http://stackoverflow.com/a/29802845
has title: How to destroy a Bootstrap Carousel for mobile resolutions
has comment: http://stackoverflow.com/comment/47696358
tagged with: javascript
has answer: http://stackoverflow.com/a/58765204
has comment: http://stackoverflow.com/comment/47696242
score: 4
has answer: http://stackoverflow.com/a/38575161
favorite count: 0
has answer: http://stackoverflow.com/a/29802845
answer count: 3
has comment: http://stackoverflow.com/comment/47697246
tagged with: carousel
possible better answer: http://stackoverflow.com/a/38575161
upvote count: 4
tagged with: twitter-bootstrap-3
has comment: http://stackoverflow.com/comment/47696875
has body: Is it possible to remove a bootstrap carousel (V 3.0.0 ) just when the resolution is below 768? I used to do it on CaroufredSel plugin but doesn't seem to work on bootstrap. I am showing 4 elements per slide, but if i set the #myCarousel to display:block; i get one element below the other but only 4 elements are shown. EDIT Seems my question was missunderstood, I do not want to remove the elements or the carousel, i want to remove the functionality of the carousel itself, so the 12 elements overflow and are shown in block one below the other.
has comment: http://stackoverflow.com/comment/47696340

http://stackoverflow.com/a/29831184
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47788991
score: 0
answers question: http://stackoverflow.com/q/29830235
has comment: http://stackoverflow.com/comment/47789884
type: Answer
has comment: http://stackoverflow.com/comment/47789595
has comment: http://stackoverflow.com/comment/47789232
has comment: http://stackoverflow.com/comment/47789181
accepted answer of: http://stackoverflow.com/q/29830235
has comment: http://stackoverflow.com/comment/47792404
has comment: http://stackoverflow.com/comment/47790047
has comment: http://stackoverflow.com/comment/47791518
has comment: http://stackoverflow.com/comment/47789942
has body: Try this(you don't need var ajaxRequest variable you can directly call like this: $.ajax({ type: "POST", url: "http://localhost:1894/api/Values", dataType: "json", data: data, success: function(dataTest) { //dataTest should contain your data in a javascript object for(var i = 0; i &lt; dataTest.First.length; i++) { window.alert("" + dataTest.First[i]); } for(var i = 0; i &lt; dataTest.Sec.length; i++) { window.alert("" + dataTest.Sec[i]); } //etc... //this should print the values returned if you showed me exactly how your JSON is... } }); The javascript object will contain properties with an array as the value for each property. Think of it like a map of &lt;String, String[]&gt;. So your returned object dataTest will have properties First and Sec and for First the value associated with the key First will be ["Name","Link","User","Pass"] which is just an array. Same for Sec. So `dataTest.First[0] will equal "Name" and dataTest.First[1] will equal "Link" etc... *****************************************UPDATE************************************** You can save your dataTest to a global variable in this example (myObject) then you can access like this: var key = "First"; // Or if you want to get your key from a dropdown (select) element then you could do like this: var key = document.getElementById("myselect").options[document.getElementById("myselect").selectedIndex].innerHTML; if(myObject[key] != undefined) { //That means there is values for this key. //Loop through values or do whatever you want with myObject[key]. for(var i = 0; i &lt; myObject[key].length; i++) { window.alert("" + myObject[key][i]); } }
has comment: http://stackoverflow.com/comment/47790304
has comment: http://stackoverflow.com/comment/47788958
has comment: http://stackoverflow.com/comment/47789655
has comment: http://stackoverflow.com/comment/47790640
has comment: http://stackoverflow.com/comment/47789027

http://stackoverflow.com/comment/47727235
type: Comment
has text: you haven't passed test into your second function func2() uses a different scope, so you need to pass the variable into it
score: 0
comment on: http://stackoverflow.com/q/29799528
type: QuestionComment

http://stackoverflow.com/q/29720286
score: 4
tagged with: angularjs-controller
has answer: http://stackoverflow.com/a/29720375
type: AnsweredQuestion
has body: My code: AMOUNT TALKTIME VALIDITY DESCRIPTION {{ x.Amount }} {{x.Talktime }} {{ x.Validity }} {{ x.Description}} As you can see I am able to get the data, check if the returned data is null, but do to show another div in the null case. Please help me I am new to angularjs.
type: Question
upvote count: 4
accepted answer: http://stackoverflow.com/a/29720375
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: How do you check if the data is null in http.get in angularjs AND do something?
tagged with: angularjs
tagged with: angularjs-http

http://stackoverflow.com/comment/47834567
score: 0
type: AnswerComment
type: Comment
has text: Model.populate returns Promise, so execAsync should be removed after Agent.populate. Please try again with my edited code.
comment on: http://stackoverflow.com/a/29834612

http://stackoverflow.com/comment/123408998
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29750936
type: Comment
has text: Forgive me if i'm asking a very basic question but sending message to the serviceworker doesn't seem to wake up the serviceworker. What could be the reason?

http://stackoverflow.com/q/29840557
has body: I have been working with JSON for quite a while now. I know that JSON is stringified JavaScript Object. I also know what makes JSON, as discussed in the below thread. What is the difference between JSON and Object Literal Notation? Question: But, I want to know if there is typeof kind of way that would tell me if a given string is JSON or just any other string. What I have observed so far: 1. var data = {"name":"JS"}; alert(typeof(data)); // object. Agree! 2. // I know this is JSON, by looking at the syntax var data = '{"name":"JS"}'; alert(typeof(data)); // string. 3. // I know this is just any other string (NOT JSON), by looking at the syntax. var data = "AnyOtherString"; alert(typeof(data)); // string Is there any way,in JavaScript, that I could differentiate between Point 2 &amp; Point 3 above. Possibly, something similar to typeof that would tell me if its just a string or a JSON(also a string).?
score: 2
possible better answer: http://stackoverflow.com/a/29840603
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29840586
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/2904131
linked to: http://stackoverflow.com/q/3710204
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47807372
has comment: http://stackoverflow.com/comment/47807387
linked to: http://stackoverflow.com/q/9804777
accepted answer: http://stackoverflow.com/a/29840586
has answer: http://stackoverflow.com/a/29840615
answer count: 3
linked to: http://stackoverflow.com/q/10174898
duplicate of: http://stackoverflow.com/q/9804777
downvote count: 0
has title: How to differentiate between a String and JSON
favorite count: 0
has answer: http://stackoverflow.com/a/29840603
upvote count: 2
linked to: http://stackoverflow.com/q/2583472

http://stackoverflow.com/q/29761048
tagged with: jquery
has answer: http://stackoverflow.com/a/29761216
has comment: http://stackoverflow.com/comment/47654175
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/11069278
type: Question
has body: The value of !$catalog.hasClass('catalog-fixed') in line 6 is always true $(window).scroll(function(){ var $catalog = $(".catalog-brief"); var sideTop = $catalog.offset().top; if (sideTop &lt; 1000){ // always true if (!$catalog.hasClass('catalog-fixed')) $catalog.addClass("catalog-fixed"); } else { if ($catalog.hasClass('catalog-fixed')) $catalog.removeClass("catalog-fixed"); } }) But this works fine var $catalog = $(".catalog-brief"); var sideTop = $catalog.offset().top; $(window).scroll(function(){ if (sideTop &lt; 1000){ if (!$catalog.hasClass('catalog-fixed')) $catalog.addClass("catalog-fixed"); } else { if ($catalog.hasClass('catalog-fixed')) $catalog.removeClass("catalog-fixed"); } }) Did I make any mistakes?
has answer: http://stackoverflow.com/a/29784937
has title: Anything wrong with hasClass
score: 0
answer count: 2
tagged with: javascript

http://stackoverflow.com/q/29737628
tagged with: ember.js
answer count: 1
has title: Edit in Ember with Ember data an object and its sub-collection in one form
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29737974
accepted answer: http://stackoverflow.com/a/29737974
type: Question
has body: I am working on an application with Ember + Ember Data. I have a model "Tax" with a collection of "Sub-Regions". I also created a list of tax objects, with an Edit button. When a user goes to edit, I have created a form, that has fields for the properties of Tax, as well as a list of Subregions with a text input field to modify the default tax rate for the subregion. What I would like to do is to be able to save in one action the object Tax and all the items of the sub-collection. I'm stuck creating that action, not sure how to approach that problem. I've put a sample here: http://emberjs.jsbin.com/jinovi/6/ I come from a back-end background and I know how I would solve it using MVC with page refresh, but not sure how to do it in Ember.
tagged with: javascript
score: 0

http://stackoverflow.com/a/29787644
has comment: http://stackoverflow.com/comment/47720668
accepted answer of: http://stackoverflow.com/q/29787573
has body: Instead of using eval, use functions as follows: var obj = {}; obj.a = 2; obj.b = 5; obj.avg = function() { return (this.a + this.b) / 2; }; obj.rounded = function() { return Math.floor(this.avg()); }; console.log("rounded avg: " + obj.rounded()); obj.a = Math.floor(Math.random() * 10); obj.b = Math.floor(Math.random() * 10); console.log("rounded avg: " + obj.rounded()); If you don't have to support old browsers, to avoid having to use parentheses when calling the functions, you could use getters as follows: var obj = { a: 2, b: 5, get avg() { return (this.a + this.b) / 2; }, get rounded() { return Math.floor(this.avg) } } console.log("rounded avg: " + obj.rounded); obj.a = Math.floor(Math.random() * 10); obj.b = Math.floor(Math.random() * 10); console.log("rounded avg: " + obj.rounded);
answers question: http://stackoverflow.com/q/29787573
has comment: http://stackoverflow.com/comment/47704758
score: 12
has comment: http://stackoverflow.com/comment/47704732
upvote count: 12
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47706124

http://stackoverflow.com/a/29841110
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29817190
has body: After I've passed my file through ng-annotate and diff with original file found out that one of di annotations was missing in state declaration. I'll use ng-annotate from now on instead of trying to convert my Angular apps minification safe myself.

http://stackoverflow.com/q/29707613
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29707711
favorite count: 0
tagged with: client-side-validation
has title: class member 'required' data attribute not throwing error but not saving to db either
has body: I have a class 'YogaSpaceOverview' here with a title property that has a required attribute. My problem! When I pass in a title that's blank "", nothing happens, it doesn't get saved to the db, but no error or exception is thrown from the '[required]' attribute like it should. NOTE - there is no form submit and I'm doing everything in a jquery .post. Is my only option to check in jquery if there is a value and if not throw a error message and not save to db?? What are my options here? I thought there would be more options for using server side and client side validation with asp mvc! public class YogaSpaceOverview { [Required] [MaxLength(35, ErrorMessage = "Title cannot be greater then 35 characters.")] public string Title { get; set; } //other members left out for space saving } I have a page that allows you to edit the title, but there is no form submit, the saving takes place with a jQuery .change() event like below. $('#Overview_Title').change(function() { var id = $(this).data('id'); var url = $(this).data('url'); var title = $(this).val(); $.post(url, { ID: id, Title: title }, function(data) { // do something with the returned value e.g. display a message? // // for example - if(data) { // OK } else { // Oops } //alert("success"); $("#successmessage").show().delay(5000).fadeOut(); }) .fail(function() { alert("error"); }); }); &lt;div id="overview"&gt; &lt;div class="form-group"&gt; @Html.LabelFor(model =&gt; model.Overview.Title, new { @class = "control-label" }) @Html.EditorFor(model =&gt; model.Overview.Title, new { htmlAttributes = new { @class = "form-control", data_id = Model.YogaSpaceId, data_url = Url.Action("UpdateTitle", "ManageSpaces") } }) @Html.ValidationMessageFor(model =&gt; model.Overview.Title, "", new { @class = "text-danger" }) &lt;/div&gt; &lt;div class="form-group"&gt; @Html.LabelFor(model =&gt; model.Overview.Summary, new { @class = "control-label" }) @Html.EditorFor(model =&gt; model.Overview.Summary, new { htmlAttributes = new { @class =…
type: UnansweredQuestion
downvote count: 1
type: Question
tagged with: c#
tagged with: asp.net-mvc
score: -1
upvote count: 0
answer count: 1

http://stackoverflow.com/a/29824045
has body: Here you go: If your variable is empty, it will initialize it with zero, else it will remain the same ;-) &lt;?php if(!$_SESSION['var']) $_SESSION['var'] = 0; ?&gt;
score: 0
answers question: http://stackoverflow.com/q/29823870
type: Answer

http://stackoverflow.com/a/29883009
has body: So, it transpires that you can't inject '$urlRouterProvider' into a function and expect the $injector to find it. i.e. this won't work: beforeEach(inject(function ($urlRouterProvider) { Instead, you have to do it using module, like so: beforeEach(module(function($urlRouterProvider) { console.log('in', $urlRouterProvider); $urlRouterProvider.deferIntercept(); }));
has comment: http://stackoverflow.com/comment/64832595
type: Answer
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29809436
answers question: http://stackoverflow.com/q/29809436
type: AcceptedAnswer
upvote count: 3

recursion
type: Tag
tag name: recursion
tags question: http://stackoverflow.com/q/29821057
tags question: http://stackoverflow.com/q/29790933
tags question: http://stackoverflow.com/q/29693132
tags question: http://stackoverflow.com/q/29827796
tags question: http://stackoverflow.com/q/29832450
tags question: http://stackoverflow.com/q/29786535
tags question: http://stackoverflow.com/q/29844124
tags question: http://stackoverflow.com/q/29739499
tags question: http://stackoverflow.com/q/29723201

http://stackoverflow.com/q/29742909
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/47618873
linked to: http://stackoverflow.com/q/418799
has body: Why next code doesn't occur errors? var bar = 1, foo = {}; foo: { bar: 2; baz: ++bar; }; It returns 2 It known that javascript has labels, it helps to manage loops and if-statements. Could this code be useful? I saw that AngularJS framework with :: operator provide one-time binding. Maybe do you hear some another example of using that strange operator.
has comment: http://stackoverflow.com/comment/47618750
type: Question
has comment: http://stackoverflow.com/comment/47618839
downvote count: 0
tagged with: javascript
favorite count: 0
has title: How : operator works in Javascript
answer count: 1
has answer: http://stackoverflow.com/a/29743014
has comment: http://stackoverflow.com/comment/47618765
upvote count: 3
accepted answer: http://stackoverflow.com/a/29743014
has comment: http://stackoverflow.com/comment/47618993

http://stackoverflow.com/comment/47742859
comment on: http://stackoverflow.com/a/29806419
type: AnswerComment
score: 0
type: Comment
has text: See [DEMO](https://regex101.com/r/uR7eE8/1).. problem could be with spaces or quotes.. am i using correct inputs that you are getting?

http://stackoverflow.com/comment/47792090
has text: @Jagadish: Yes I need to show all entries on the page and use the datatables plugin from jquery to display the paginated entries.
comment on: http://stackoverflow.com/q/29829529
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47537247
comment on: http://stackoverflow.com/a/29700445
type: AnswerComment
has text: Yep best answer of the 3.
score: 0
type: Comment

http://stackoverflow.com/a/29732627
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29732436
has body: You can intercept the form submit via Javascript, calculate window.pageYOffset || document.body.scrollTop - cross-browser way of calculating the document's current offset, and modify the action parameter of the form to cgupdate.php?offset=716 (eg if your document is scrolled 716px from the top). var myforms = document.querySelectorAll('[action="cgupdate.php"]'); for(var i=0;i&lt;myforms.length;i++) myforms[i].onsubmit = function(){ var scrolled = parseInt(window.pageYOffset || document.body.scrollTop); event.target.action = "cgupdate.php?offset="+scrolled; } The above intercepts submission of all forms that will submit to cgupdate.php and passes it a parameter which rounds out the value of the current offset to integer (otherwise values can sometimes end up like 72.44444). Then inside cgupdate.php access this $_GET variable and pass it back to the URL like: $scrolled = $_GET["offset"]; header('Location: http://www.jpegchaos.com/cgadmin.php?scroll='.$scrolled); At the bottom of the cgadmin.php page, add code that gets this parameter (how to get URL parameters in Javascript) and scrolls your window to that number, which is simple: function getParameterByName(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&amp;]" + name + "=([^&amp;#]*)"), results = regex.exec(location.search); return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } var scrollTo = getParameterByName('scroll'); if(scrollTo) document.body.scrollTop = parseInt(scrollTo); parseInt is used again because the parameter value is always a string while scrollTop accepts a number. It should work but I have not tested it, so I'd be interested to know if you run into any problems with this approach.
score: 2
accepted answer of: http://stackoverflow.com/q/29732436
upvote count: 2
has comment: http://stackoverflow.com/comment/47601884
has comment: http://stackoverflow.com/comment/47601984
has comment: http://stackoverflow.com/comment/47598569
has comment: http://stackoverflow.com/comment/47601993

http://stackoverflow.com/a/29727366
type: AcceptedAnswer
has body: As with all other attributes with Angular (such as directives), you need to changed it to lower cases and dashes: Content
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29727322
score: 2
answers question: http://stackoverflow.com/q/29727322
upvote count: 2

http://stackoverflow.com/comment/47661993
has text: The redirect is to another HTTPS URL, so I don't see why SSL would be an issue.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29764323
type: Comment

http://stackoverflow.com/q/29776448
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: How it should work: button "Show photo" opens "Content 1", "Show video" opens "Content 2", "Show map" opens "Content 4" Switch-1 "Show photo" <-> "Show video".This mode works correctly Switch-2 "Show map" -> "Show photo" or "Show video" (depending on Switch-1). After click button "Show map" instead "Close map" shown "Show photo" or "Show video" button When "Content 4" is active, then it's possible to open "Content 1" or "Content 2 by click on "Show photo" or "Show video" Nav structure is free to change. $(function() { $('.j-lst-toggle').each(function() { var $this = $(this); $this.on('click', 'button', function(e) { e.preventDefault(); $this.children().toggleClass('active'); if ($this.hasClass('j-media-toggle')) { $this.closest('.j-multimedia-cnt').find('.j-media').children().toggleClass('active'); } else if ($this.hasClass('j-map-toggle')) { $this.closest('.j-multimedia-cnt').find('.j-multimedia').children().toggleClass('active'); } }); }); }); .j-multimedia-cnt { border: 3px solid black; } .lst-c-actions { list-style: none; } .j-lst-toggle__btn { display: none; } .j-lst-toggle__btn.active { display: block; } .lst-c-actions__btn { display: none; } .lst-c-actions__btn.active { display: block; } .j-media__item { display: none; } .j-media__item.active { display: block; } .j-multimedia__item { display: none; } .j-multimedia__item.active { display: block; } .cols { display: flex; } .cols__item--left { width: 70%; } .cols__item--right { width: 30%; } icon-video Show video icon-photo Show photo icon-map Show on map icon-map Close map Content 1 Content 2 Content 3 Content 4 "
has comment: http://stackoverflow.com/comment/47684748
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47684065
has answer: http://stackoverflow.com/a/29779288
type: Question
has title: JQuery switch statement (hide/show logic)
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/29779288

http://stackoverflow.com/a/29744041
type: Answer
answers question: http://stackoverflow.com/q/29743729
score: -2
has comment: http://stackoverflow.com/comment/47621320
upvote count: 0
has body: Try with this code to know the length of video. var duration = document.getElementById("duration"); var vid_duration = Math.round(document.getElementById("video").duration); //alert(vid_duration); duration.innerHTML = vid_duration; //duration.firstChild.nodeValue = vid_duration;
downvote count: 2
has comment: http://stackoverflow.com/comment/47621238

http://stackoverflow.com/comment/47778947
type: Comment
has text: its giving me runtime error not compiled time.In my actual code,there is a drop down inside repeater.I tried passing an integer hard coded value and it was working fine. I think there is a problem in passing index as an argument.
type: AnswerComment
comment on: http://stackoverflow.com/a/29824399
score: 0

http://stackoverflow.com/q/29765882
score: 1
has title: elementExplorer character escape regressed on Protractor 1.8.0 and 2.0.0?
type: Question
has comment: http://stackoverflow.com/comment/47689232
has body: I am using Node version 0.10.30. On Protractor 1.6.1, I was able to escape a single quote character inside the ng-show to return a value. for example: element.all(by.css('[ng-if="user"]')).all(by.css('[ng-show="user.name === \'Jhonny\'"]').getText() However after upgrading to protractor 1.8.0 and 2.0.0, the character escaping doesn't work anymore (I rolled back to Protractor 1.6.1 after the upgrade and it worked again). I then try another code element.all(by.css('[ng-if="user"]')).map(function(ele) {return ele;}); The code above crashes elementExplorer with the following error: (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. Trace at Client.addListener (events.js:160:15) at CommandRepl.evaluate_ (C:\Users\test\AppData\Roaming\npm\node_modules\protractor\lib\debugger\modes\commandRepl.js:111:15) at CommandRepl.stepEval (C:\Users\test\AppData\Roaming\npm\node_modules\protractor\lib\debugger\modes\commandRepl.js:33:8) at WdRepl.stepEval_ (C:\Users\test\AppData\Roaming\npm\node_modules\protractor\lib\debugger\clients\explorer.js:48:16) at Interface.&lt;anonymous&gt; (repl.js:239:12) at Interface.emit (events.js:95:17) at Interface._onLine (readline.js:202:10) at Interface._line (readline.js:531:8) at Interface._ttyWrite (readline.js:760:14) at ReadStream.onkeypress (readline.js:99:10) I have tried running the elementExplorer using Node or directory from Protractor --elementExplorer and both have the same issue. Anyone else experiencing this?
downvote count: 0
tagged with: javascript
answer count: 1
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/46161306
tagged with: selenium-webdriver
tagged with: protractor

http://stackoverflow.com/q/29740963
has title: js output in php code
tagged with: forms
has comment: http://stackoverflow.com/comment/47615028
type: Question
has body: From the dynamic html form, I get the following inputs in js manner in php code : $sl = $_POST['sl']; // input: 12 $name = $_POST['name']; // input: Jhon $code = $_POST['code']; // input: 456 $val = $_POST['val']; // input: 10023 for ($i = 0; $i &lt; count($sl); $i++) { $email_body .= "SL_No: " . $sl[$i] . "\n". "Name: " . $name[$i] . "code: " . $code[$i] . " Value: " . $val[$i] . "\n\n"; } The out put is: SL_No: 12 Name: Jhon Code:456 Value: 10023 Whereas I need in the output following manner: SL[12]; Name[Jhon][456]="10023"; Can anybody help ne in correcting the PHP code
upvote count: 0
score: -2
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47615564
has answer: http://stackoverflow.com/a/29741081
has comment: http://stackoverflow.com/comment/47615113
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47615851
downvote count: 2
tagged with: php

http://stackoverflow.com/comment/116152850
type: AnswerComment
has text: @jfriend00 - If the application defines "equivalence" as being the same object (===) then it is trivial to add an uuid to each object and use that as the index. In the non-trivial case non-identical (!==) objects can be defined as "equivalent" by the application as needed. That definition of equivalence is application specific and it is therefore impossible to define it a priori at the language level.
type: Comment
comment on: http://stackoverflow.com/a/29759699
score: 0

http://stackoverflow.com/comment/47690098
comment on: http://stackoverflow.com/a/29779504
type: AnswerComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/75861/discussion-between-pankajparkar-and-abdi).
type: Comment
score: 0

http://stackoverflow.com/q/29831243
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I am just getting into JS, so I may be missing something. I am trying to animate an SVG rectangle with a mouseover so that the shape appears to be 'fleeing' the mouse. When I try to change x and y by adding to them, the shape disappears. If I subtract, it behaves as expected. Any help would be greatly appreciated. HTML &lt;svg width="1200" height="600"&gt; &lt;rect x="100" y="100" width="100" height="100" id="firstShape" onmouseover="moveShape(firstShape);"&gt; &lt;/svg&gt; Javascript function moveShape(obj) { var newX = obj.getAttribute("x") + 5; var newY = obj.getAttribute("y") + 5; obj.setAttribute("x", newX); obj.setAttribute("y", newY); }
type: Question
accepted answer: http://stackoverflow.com/a/29831531
tagged with: http://stackoverflow.com/tag/svg
upvote count: 2
has title: Javascript Animation - SVG shape disappearing
answer count: 1
has answer: http://stackoverflow.com/a/29831531
score: 2
type: AnsweredQuestion

http://stackoverflow.com/a/29718436
accepted answer of: http://stackoverflow.com/q/29717860
score: 0
answers question: http://stackoverflow.com/q/29717860
type: Answer
has body: I was wondering how the == operator works. Will it convert the integer to string and then do the comparison or the opposite? No, it will convert the string to a number and then do the comparison. You can read the exact Abstract Equality Algorithm in the spec if you want.
type: AcceptedAnswer

http://stackoverflow.com/comment/47708717
has text: That question is fascinating, but this is not a duplicate: OP is asking an image with some transparent areas
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29755311

http://stackoverflow.com/a/29696680
has body: Well I would suggest this: var success = false; $.when( $.ajax({ type: "POST", url: page, xhrFields: { withCredentials: true }, success: function (html) { $('#CarrierList').empty(); $('#CarrierList').append($.parseHTML(html)); success=true;//set a success message here }, error: function () { var error = "Error occured during loading Carrier items..."; $('#errorMessage').empty(); $('#errorMessage').append(error); $('#errorModal').modal('show'); }, complete: function () { $('#loaderImg').modal('hide'); } })).then(function(){ if(success) //if its success then call this initializations { $("#sortable").sortable({ connectWith: ".connectedSortable", cursor: "move", stop: function (event, ui) { var ChildIdsArray, SpanIdsArray, ChildId, Divid, SpanID, SpanText; ChildIDsArray = $("#sortable &gt; div").map(function () { return this.id }); for (var i = 0; i &lt; ChildIDsArray.length; i++) { ChildId = ChildIDsArray[i]; SpanIdsArray = $("#" + ChildId + "&gt; span").map(function () { return this.id }); } } }).disableSelection(); $("#sortable2").sortable({ connectWith: ".connectedSortable", handle: "span", cursor: "move", stop: function (event, ui) { } }).enableSelection(); } });;
accepted answer of: http://stackoverflow.com/q/29696302
answers question: http://stackoverflow.com/q/29696302
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47529531
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/47543884
comment on: http://stackoverflow.com/a/29699256
type: AnswerComment
score: 0
type: Comment
has text: Sure! Gimme a few minutes to make some edits. The major issue is addressed here: http://stackoverflow.com/a/11246131/769971

odata
tag name: odata
type: Tag
tags question: http://stackoverflow.com/q/29699765
tags question: http://stackoverflow.com/q/29792871
tags question: http://stackoverflow.com/q/29770704

http://stackoverflow.com/a/47810314
has comment: http://stackoverflow.com/comment/82582732
answers question: http://stackoverflow.com/q/29839755
score: 0
type: Answer
has body: Template.registerHelper('var', name =&gt; { const data = Template.instance().data || {}; return data[name]; }); Inside template: {{var 'someVariableFromTemplate'}}

http://stackoverflow.com/comment/47597713
has text: Try testing it in Firefox as well to rule out a browser issue. One obvious observation is that the scollbars may disappear if the content fits on the page, but this is not it? It is likely that something else is applying some CSS like 'overflow: hide' when handling the AJAX (?) response. Maybe make a simple HTML page, no AJAX/server calls, just a button that removes a row and see if that works as you expect.
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/29732166

http://stackoverflow.com/a/29760132
answers question: http://stackoverflow.com/q/29754657
type: AcceptedAnswer
has body: If you are compiling your files to Javascript and running them in a browser, then you don't need to require Mithril. Just make sure it's added before your script. For example: # file.ls element = document.get-element-by-id 'example' m.module element app Then run lsc -c file.ls // file.js (function() { var element = document.getElementById('example'); m.module(element, app); }).call(this); This is now just a regular JS file with some references to Mithril variables. We need to remember that when we link them to our HTML. &lt;script src='https://cdnjs.cloudflare.com/ajax/libs/mithril/0.1.34/mithril.js'&gt;&lt;/script&gt; &lt;script src='file.js'&gt;&lt;/script&gt; It's important that Mithril comes first. If you want to require Mithril, in order to use it outside of the browser, then you'll have to slightly readjust your require statement. If you look line 34 of the Mithril source, you'll see that m is just a local function. Then on line 1066 it tries to create a global variable m, if window exists. It won't do in Node/IO.js so instead it attaches the value to module.exports. This means you'll have to use the value returned by require: m = require 'mithril.js' m.module! # works!
upvote count: 1
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29754657

http://stackoverflow.com/q/29692134
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29693165
has title: How to delete only a line from the canvas, not all the drawings?
has comment: http://stackoverflow.com/comment/47521170
favorite count: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29692247
score: 2
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/47539530
has comment: http://stackoverflow.com/comment/47521260
linked to: http://stackoverflow.com/q/6629386
has answer: http://stackoverflow.com/a/29693165
type: Question
tagged with: qt
has body: The solution I found is to clear the whole canvas, but I only want to delete one line not all drawings on the canvas. What should I do?
possible better answer: http://stackoverflow.com/a/29704300
tagged with: qml
has answer: http://stackoverflow.com/a/29704300
linked to: http://stackoverflow.com/q/2142535
tagged with: canvas

http://stackoverflow.com/comment/47637665
has text: So it all works now ? :)
score: 1
type: Comment
comment on: http://stackoverflow.com/q/29752216
type: QuestionComment

http://stackoverflow.com/q/29789262
tagged with: javascript
has comment: http://stackoverflow.com/comment/47712685
tagged with: servlets
tagged with: ajax
answer count: 2
has comment: http://stackoverflow.com/comment/47711945
has title: Passing value from a jsp button click to a servlet
has comment: http://stackoverflow.com/comment/47712116
has comment: http://stackoverflow.com/comment/47708432
has comment: http://stackoverflow.com/comment/47712442
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47711306
has answer: http://stackoverflow.com/a/29789591
has answer: http://stackoverflow.com/a/29789290
has comment: http://stackoverflow.com/comment/47712258
has comment: http://stackoverflow.com/comment/47712541
score: 0
tagged with: java
type: Question
has body: ininI am bit new to jsp and servlet. I need to pass a value to a servlet on a button click. below I have mentioned my code. web.xml Login org.wso2.carbon.identity.application.authentication.endpoint.oauth2.OAuth2Login Login /login test.jsp function ok() { $.ajax({ url: "/login", data: 'test=' +'test', type: "GET", async: false, success: function (data) { } }); } below is my html code in test.jsp OK The servelet public class OAuth2Login extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.print("========do get fires==========="); } } But when my test.jsp is loading it invokes the doget() of the servlet. But at the button click it does not. I dont need to invoke the servlet at the page load. But I need it on the button click. Help me to solve this out. Sorry for the ignorance. :)
tagged with: jsp

http://stackoverflow.com/comment/47669535
type: QuestionComment
comment on: http://stackoverflow.com/q/29768713
score: 0
has text: The clicked input type should opening a Modal Dialog. When user type some name, the name typed should as a value on parent input type.
type: Comment

http://stackoverflow.com/comment/47722741
type: QuestionComment
has text: My favourite bit is `function nana() {}`
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29796450

virtual-earth
type: Tag
tag name: virtual-earth
tags question: http://stackoverflow.com/q/29811413

http://stackoverflow.com/comment/47538467
type: QuestionComment
comment on: http://stackoverflow.com/q/29700641
score: 1
has text: Well, I guess my next question would be then why are they logging in at all if you're not capturing & saving data to associate with unique visitors to your site? It seems to me, perhaps naively, like this is gating users for no reason. Is the intention to grant g+ users to special content that isn't otherwise available?
type: Comment

http://stackoverflow.com/q/29698072
has answer: http://stackoverflow.com/a/62357231
type: Question
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/51691765
tagged with: javascript
score: 4
accepted answer: http://stackoverflow.com/a/29699256
possible better answer: http://stackoverflow.com/a/62357231
upvote count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/29699256
linked to: http://stackoverflow.com/q/1601933
has title: Truncate Text with JavaScript with "Read More" and "Read Less"
has body: My apologies if I've framed this question incorrectly or if it's been asked and answered previously, my search turned up similar Q&amp;A's which were based around JQuery and I'm looking for a pure JavaScript solution. var len = 100; var p = document.getElementById('shrinkMe'); if (p) { var trunc = p.innerHTML; if (trunc.length &gt; len) { trunc = trunc.substring(0, len); trunc = trunc.replace(/\w+$/, ''); trunc += '&lt;a href="#" ' + 'onclick="this.parentNode.innerHTML=' + 'unescape(\''+escape(p.innerHTML)+'\');return false;"&gt;' + 'Read More&lt;\/a&gt;'; p.innerHTML = trunc; } } JSFiddle The fiddle truncates text with JavaScript, however in it's current state it's for a single occurrence which isn't quite what I need. I have multiple occurrences of 'shrinkMe' as a div id in the body of my html and as .getElementById is used this will need to be tweaked as at the moment when "Read More" is clicked it expands all occurrences simultaneously. I believe that changing to .getElementsByClassName may be the solution to enable me to have multiple occurrences of a class name opposed to being restricted to one instance of .getElementById but I'm unsure quite how to make the switch. I'm also looking for a clickable "Read Less" to be shown once "Read More" is clicked, with "Read Less" returning the text back to the truncated state, with "Read More" then being visible once again and so on. In summary I'm asking for assistance to: Switch .getElementById to .getElementsByClassName Add "Read Less" to show post "Read More" click. Thanks for taking the time to read this - sorry if I've been unintentionally unclear in anyway. If so please let me know and I'll try to explain further.
type: AnsweredQuestion

http://stackoverflow.com/comment/47673217
score: 0
type: AnswerComment
type: Comment
has text: You should have different URLs for each post with og-tags connected with them and just share that URLs.
comment on: http://stackoverflow.com/a/29768627

http://stackoverflow.com/comment/47538334
type: Comment
has text: Definitely at a certain point it makes more sense to say _"these are not special, everything else is"_ rather than _"these characters are special, everything else isn't"_.
comment on: http://stackoverflow.com/a/29700843
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47658458
type: Comment
comment on: http://stackoverflow.com/a/29763031
type: AnswerComment
has text: @tpie If you had seen my comment in the question, i hope it would have been clear. I have edited the answer and add what the developer needs to do with `output`
score: 0

http://stackoverflow.com/q/29819033
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/29819127
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/29819127
has answer: http://stackoverflow.com/a/29819109
has title: Click function still working for previous class which is already replaced by other
has comment: http://stackoverflow.com/comment/47764709
upvote count: 3
type: Question
type: AnsweredQuestion
score: 3
has body: I am having a problem with jQuery click event. When I replace the class of a div the click function is still working for the previous class. Here is the code I am working with: $(this).removeClass('edit_agent_val').addClass('edit_agent_val2'); The click function is still working for edit_agent_val instead of edit_agent_val2. // This should not work $('.edit_agent_val').on('click', function(e) { // some code... }); // This should work $('.edit_agent_val2').on('click', function(e) { // some code... }); Can anyone help me fix this issue?
linked to: http://stackoverflow.com/q/29820088
accepted answer: http://stackoverflow.com/a/29819109

http://stackoverflow.com/a/29748242
has body: You can use removeAttr, which will find all the matched elements and will remove the given attribute. In your case this code will find all elements with class someClass and will remove the attribute class. And the good in this code is that it will not leave an empty attribute. $('.someClass').removeAttr( "class" );
has comment: http://stackoverflow.com/comment/47647028
has comment: http://stackoverflow.com/comment/47635125
score: 4
has comment: http://stackoverflow.com/comment/47659704
answers question: http://stackoverflow.com/q/29747997
upvote count: 4
downvote count: 0
type: Answer

http://stackoverflow.com/a/29759706
has body: A better way might be to cache selector on the object: this._selector || (this._selector = "value"); That way, there's less magic and you still have access to all of the old data instead of making it disappear. What you also might want to checkout is the technique known as memoization, something that's been solved many times (to avoid having to do it yourself).
answers question: http://stackoverflow.com/q/29759554
upvote count: 1
type: Answer
downvote count: 0
score: 1

web
tags question: http://stackoverflow.com/q/29797819
tags question: http://stackoverflow.com/q/29693531
tags question: http://stackoverflow.com/q/29764078
tags question: http://stackoverflow.com/q/29748995
tags question: http://stackoverflow.com/q/29787932
tags question: http://stackoverflow.com/q/29723183
tags question: http://stackoverflow.com/q/29799444
tags question: http://stackoverflow.com/q/29710834
tags question: http://stackoverflow.com/q/29720186
tags question: http://stackoverflow.com/q/29710626
type: Tag
tags question: http://stackoverflow.com/q/29772121
tags question: http://stackoverflow.com/q/29691848
tags question: http://stackoverflow.com/q/29731731
tags question: http://stackoverflow.com/q/29773614
tags question: http://stackoverflow.com/q/29744893
tags question: http://stackoverflow.com/q/29808285
tags question: http://stackoverflow.com/q/29697165
tags question: http://stackoverflow.com/q/29734290
tag name: web
tags question: http://stackoverflow.com/q/29757124
tags question: http://stackoverflow.com/q/29741889
tags question: http://stackoverflow.com/q/29806815
tags question: http://stackoverflow.com/q/29724885
tags question: http://stackoverflow.com/q/29719341
tags question: http://stackoverflow.com/q/29836686
tags question: http://stackoverflow.com/q/29844230
tags question: http://stackoverflow.com/q/29819781
tags question: http://stackoverflow.com/q/29723089
tags question: http://stackoverflow.com/q/29831335

http://stackoverflow.com/comment/66473254
comment on: http://stackoverflow.com/a/29739169
score: 0
type: AnswerComment
has text: @DavidJohnSmith it is in app.js
type: Comment

http://stackoverflow.com/comment/47608616
comment on: http://stackoverflow.com/q/29715612
has text: showModalDialog has been flagged as depreciated. http://status.modern.ie/#showmodaldialog For future proofing/interoperability you should use the jquery dialog plugin or create your own with popup divs.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29744233
tagged with: three.js
has comment: http://stackoverflow.com/comment/47683777
type: AnsweredQuestion
tagged with: matrix-transform
accepted answer: http://stackoverflow.com/a/29793074
downvote count: 0
score: 1
has body: I'm trying to learn Three.js, beeing new to those technologies. I achieved a sun with planet orbitting around, with moon orbitting around planet. What am I concerned of, is to do what i have so far i have to make quite a lot of objects and perform quite a lot of calculations during rendering loops. 1. Sourcecodes: WestLangley provided us with fiddles presenting problem in more easy-to-understand way so: this fiddle presents more like it is looking right now - planet has its parent inside sun, and rotating that parent will make planet orbit. But along with one extra object per planet/moon, theres an issue that parent rotation spins planet in place too, during to updateMatrixWorld Object3D method. So it will spin a bit faster than you may assume by looking at mesh2.rotateOnAxis( AXIS, 0.01 ); bit. this fiddle shows one parent-less approach. Case is, I'm trying to find way, where I can configure planet positions/spins-speed/orbit-speed at system start and than just feed it with server time, so it will make it feel synchronised between players being at same location. 3. Question itself As far as I travelled through manuals, I found there may be a possibility of performing such animation using Three.js matrix logic. I'm willing to reduce usage of ::animate() inside objects as far as possible (maybe by overriding updateMatrix and updateMatrixWorld methods). Unfortunately my english nor math are not good enough to understand, whats going around with those matrixes. If somebody can help me, I would really appreciate this. 4. Current work progress Working fiddle is here. I was able to create a Planet and have almost all I want. One left issue is that, a would like to planet orbit at more random-looking degrees.
linked to: http://stackoverflow.com/q/11966779
has comment: http://stackoverflow.com/comment/47683078
has comment: http://stackoverflow.com/comment/47638424
type: Question
has answer: http://stackoverflow.com/a/29793074
tagged with: javascript
has comment: http://stackoverflow.com/comment/47665245
has title: Animating planet orbiting it's parent idependent on parent's rotation state
upvote count: 1
tagged with: matrix
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47684119

http://stackoverflow.com/q/29696925
type: AnsweredQuestion
has body: &lt;script&gt; var tdt= new Date(); t=tdt.getFullYear()+"-"+(tdt.getMonth()+1)+"-"+tdt.getDate() // 2015-04-17 var tody = new Date(t).getTime(); /* 1429209000000 */ document.write(tody); &lt;script&gt; When I execute this code in Mozilla Firefox, I get 'NaN', but when I execute this code in Google Chrome, I get '1429209000000'. Does anyone know how to get the value '1429209000000' to be printed when I execute in Firefox and Opera?
has title: How to convert a date to a string in JavaScript?
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/3066586
has answer: http://stackoverflow.com/a/29696990
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/29696990
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/47529915
score: 2

http://stackoverflow.com/a/29735322
answers question: http://stackoverflow.com/q/29735172
score: 1
has comment: http://stackoverflow.com/comment/47604237
has comment: http://stackoverflow.com/comment/47604471
has body: The quick and dirty solution using your work is as follows below. If you wanted the green dropdown to be below the parent nav item, you should add ul#nav_animations inside the li.navlistitems. That's what I've done below. I also modified your CSS a little to take this into consideration. And here is a JSFiddle I threw together for you: http://jsfiddle.net/84amnjz7/1/ CSS: #navlist { margin: 0; padding: 0; list-style-type: none; font-family: 'Dhurjati', sans-serif; font-size: 45px; position: relative; } .navlistitems { position: relative; padding: 25px 0 0; display:block; float: left; color: #000; } #nav_animations { display: block; position: absolute; top: 0; left: 0; margin: 0; padding: 0; list-style-type: none; width: 100%; } #greenHome { display: none; } .nav_square { background-color: green; width: 100%; height: 15px; z-index: 22; position: relative; } jQuery: $(document).ready(function(){ $('#home').hover(function(){ $('#greenHome').stop(true, true).slideToggle('fast'); /* ADDED .stop(true, true) */ }); }); Modified HTML: Home
type: Answer
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47603948
accepted answer of: http://stackoverflow.com/q/29735172
type: AcceptedAnswer

http://stackoverflow.com/q/29736102
favorite count: 0
upvote count: 2
tagged with: utc
tagged with: python
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29737017
possible better answer: http://stackoverflow.com/a/29736458
type: Question
has answer: http://stackoverflow.com/a/29736458
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47605811
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29737017
has title: Convert Python UTC time stamp to local time in JavaScript
has comment: http://stackoverflow.com/comment/47606234
has body: Im trying to convert a UTC timestamp generated with python to connecting clients local time. But, the time never converts correctly. Python import time, datetime utc_time = datetime.datetime.utcnow() utc_time = int(time.mktime(utc_time.timetuple())) * 1000 JavaScript function Time(time) { var month = {} month[0] = "Jan"; month[1] = "Feb"; month[2] = "Mar"; month[3] = "Apr"; month[4] = "May"; month[5] = "Jun"; month[6] = "Jul"; month[7] = "Aug"; month[8] = "Sept"; month[9] = "Oct"; month[10] = "Nov"; month[11] = "Dec"; day = {} day[0] = "Sunday"; day[1] = "Monday"; day[2] = "Tuesday"; day[3] = "Wednesday"; day[4] = "Thursday"; day[5] = "Friday"; day[6] = "Saturday"; var b = new Date(); var d = new Date(time); var c = d.getTime() + (b.getTimezoneOffset() * 60000); var offset = -(b.getTimezoneOffset() /60); var res = c + (3600000 * offset); d.setTime(res); var days = day[d.getDay()]; var mon = d.getMonth(); var year = d.getFullYear(); var hour = d.getHours(); var minute = d.getMinutes(); var seconds = d.getSeconds(); var date = d.getDate(); return days + ' - ' + month[mon] + '/' + date + '/' + year + " - " + hour + ":" + minute + ":" + seconds; } console.log(Time(1429490580*1000)); // time stamp generated: Sunday - Apr/19/2015 at 4:43PM Is my math wrong or is it something I did wrong on the python side?

http://stackoverflow.com/q/29775712
score: 15
upvote count: 15
has answer: http://stackoverflow.com/a/31248980
answer count: 3
tagged with: canvas
downvote count: 0
tagged with: jquery
has title: Double display of canvas element
favorite count: 0
has body: The drawn lines appear not only in the Canvas-Element but also at the top of the page it is displayed again. This happens when a touch event is been released. Here you can find the source code and the result (PhoneGap and Jquery Mobile is used). Do anybody has an idea what’s the reason for this fault? http://gomami.ch/bugs/screenshot.png http://gomami.ch/bugs/screenshot.png JavaScript (loaded in header after includes to jQuery/PhoneGap): //********************************************************* // Wait for Cordova to Load //********************************************************* document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { canvas("aufprallstelleA","test"); } // function to setup a new canvas for drawing function canvas(canvas, element){ //define and resize canvas width = $(window).width(); width = (width/100)*90; height = width/1.6901408; $("#content").width(width); $("#"+element).height(height); $("#"+element).width(width); var html = 'This is de Canvas field wehre you can draw '; $("#"+element).html(html); // setup canvas ctx=document.getElementById(canvas).getContext("2d"); ctx.strokeStyle = "red"; ctx.lineWidth = 5; // setup to trigger drawing on mouse or touch $("#"+canvas).on("touchstart", start); $("#"+canvas).on("touchmove", move); } function start(e){ e = e.originalEvent; x = e.changedTouches[0].pageX-20; y = e.changedTouches[0].pageY-$(this).position().top; ctx.moveTo(x,y); } function move(e){ e.preventDefault(); e = e.originalEvent; x = e.changedTouches[0].pageX-20; y = e.changedTouches[0].pageY-$(this).position().top; ctx.lineTo(x,y); ctx.stroke(); } function clearcanvas(id) { var canvas = document.getElementById(id); var context = canvas.getContext('2d'); context.clearRect(0, 0, canvas.width, canvas.height); } HTML: Hello, this is JQuery Mobile running in PhoneGap 2 copyright
has answer: http://stackoverflow.com/a/31220732
has comment: http://stackoverflow.com/comment/50421762
has comment: http://stackoverflow.com/comment/50422713
tagged with: cordova
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/33896151
type: Question
tagged with: javascript

http://stackoverflow.com/q/29793106
downvote count: 1
type: Question
has body: colspan: &lt;td colspan="4"&gt; &lt;/td&gt; column-span &lt;td style="column-span:4"&gt; &lt;/td&gt; The colspan does working properly. but column-span does not working. I have little bit confusion with the full name : because colspan full name is column span. but column-span is different from colspan. Please explain the meaning of colspan and column-span And tell me the difference.
has title: Difference between colspan and column-span in css
tagged with: javascript
upvote count: 4
has answer: http://stackoverflow.com/a/29793199
score: 3
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47714766
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/29793199
type: AnsweredQuestion

http://stackoverflow.com/comment/92133256
comment on: http://stackoverflow.com/a/29726000
has text: I think this is a good answer but still an expensive operation. We could return the function `handleScroll` without having to call the `setState` per each scroll executed, in this way you could set the state only when needed.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47573253
has text: So, the snippet works in your browser, but your offline file doesn't work in the same browser?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29719278
type: Comment

http://stackoverflow.com/a/41414773
type: Answer
answers question: http://stackoverflow.com/q/29769923
score: 0
has body: you must set grid Selectable and GridSelectionMode set Single like : .Selectable(s=&gt; s.Mode(GridSelectionMode.Single)) and you can use Navigate envent in grid events : .Events(evt=&gt; evt.Navigate("navigate")); and in js function : function navigate(e) { var grid = e.sender; grid.select(grid.tbody.find(e.element.parent())); }

http://stackoverflow.com/q/29693128
tagged with: css-shapes
has comment: http://stackoverflow.com/comment/47524295
has comment: http://stackoverflow.com/comment/47522763
possible better answer: http://stackoverflow.com/a/30418446
tagged with: css
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/30418446
score: -1
has title: Trapezium responsive Div with CSS or jQuery
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29693941
accepted answer: http://stackoverflow.com/a/29693941
has body: I have to build this website and I am faced with a unique challenge of alternating Trapezium Divs. I have never come across anything like this before and I have no idea how to achieve this. To make things more complicated, this is going to be a responsive website. Any ideas?
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
favorite count: 0

http://stackoverflow.com/q/29692162
accepted answer: http://stackoverflow.com/a/29692436
type: Question
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29692436
tagged with: javascript
tagged with: phonegap-pushplugin
answer count: 1
favorite count: 0
upvote count: 3
tagged with: google-cloud-messaging
tagged with: http://stackoverflow.com/tag/html
has title: GCM push notification not working in Android Phonegap application
tagged with: cordova
has body: Am working in HTML5 Phonegap android GCM push notification application. But I tried several times but not getting any results :-( Please help me.. Am trying this to work from last three days. Am using Push plugin : com.phonegap.plugins.PushPlugin ** My Js code: document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { alert('deviceready'); // result contains any message sent from the plugin call var app = { successHandler: function(result) { alert('Callback Success! Result = '+result) }, errorHandler:function(error) { alert(error); }, onNotificationGCM: function(e) { alert('onNotificationGCM'); switch( e.event ) { case 'registered': if ( e.regid.length > 0 ) { console.log("Regid " + e.regid); alert('registration id = '+e.regid); } break; case 'message': // this is the actual push notification. its format depends on the data model from the push server alert('message = '+e.message+' msgcnt = '+e.msgcnt); break; case 'error': alert('GCM error = '+e.msg); break; default: alert('An unknown GCM event has occurred'); break; } } } setTimeout(function(){ var pushNotification = window.plugins.pushNotification; pushNotification.register(app.successHandler, app.errorHandler,{"senderID":"236728063055","ecb":"app.onNotificationGCM"}); },2000); } ** Manifest file <?xml version='1.0' encoding='utf-8'?> <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" /> <uses-permission android:name="android.permission.INTERNET" /> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <category android:name="com.test.pushDummy" /> <service android:name="com.plugin.gcm.GCMIntentService" /> <uses-sdk android:minSdkVersion="10" android:targetSdk…
downvote count: 0

http://stackoverflow.com/q/29742330
answer count: 1
has title: Is there any easy way to add serial key input text field in Extjs
tagged with: textfield
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29791752
has comment: http://stackoverflow.com/comment/47620031
type: Question
has body: I'd like to add a text field by Extjs to let user input serial number, the text field should looks like: XXXX-XXXX-XXXX-XXXX Is there any easy way to achieve this ?
tagged with: javascript
tagged with: extjs
score: 0

http://stackoverflow.com/comment/47554045
has text: getUserMedia does not *return* the constraints object. You pass it to the function. There is no way of getting notified. The size/bitrate will be adjusted overtime.
comment on: http://stackoverflow.com/q/29708442
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47776915
type: Comment
type: QuestionComment
score: 1
has text: Yes, because the `style.opacity` property returns the value of the inline style. It doesn't return the opacity set via the stylesheet. Try using `window.getComputedStyle()`.
comment on: http://stackoverflow.com/q/29825063

http://stackoverflow.com/q/29797560
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47723205
tagged with: twitter-bootstrap-3
has comment: http://stackoverflow.com/comment/47723486
tagged with: twitter-bootstrap
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/27467349
upvote count: 1
has answer: http://stackoverflow.com/a/30513596
has title: Twitter Bootstrap Carousel buttons not working
has body: I'm trying to implement the bootstrap 3 carousel into my site however the slide buttons for left and right are not working and so are the slide dots. Can anyone spot a problem in my code? Test page! Previous Next
score: 1
has comment: http://stackoverflow.com/comment/47723907
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29810173

http://stackoverflow.com/q/29758498
score: 1
tagged with: innerhtml
upvote count: 1
tagged with: dom
type: Question
has answer: http://stackoverflow.com/a/29758564
has body: I want to add a box with individual boxes inside it with every age when the function is run. I tried doing it by splitting the innerHTML and using the for loop on just the agebox section so it will loop and create a new age box each time and not create a whole outerbox as well everytime like if you try loop the entire thing. I thought this would work but now it creates an age box for each loop but its placed outside the outer box and i cant figure out how to get it to loop within the outer box. If i remove the loop and just create one innerHTML then the age boxes i made manually are inside the outer box so im assuming theres a problem with the actual splitting up of the innerHTML. Thanks in advance!! function Age(gender){ if (gender!==undefined){ el1 = document.getElementById('userdata'); el1.innerHTML += gender +" "; } el1 = document.getElementById('farespage'); el1.innerHTML += " "; for(var i=13; i<=18; i++){ el1.innerHTML +=" "+i+" "; } el1.innerHTML += " back "; }
tagged with: for-loop
tagged with: javascript
answer count: 2
downvote count: 0
possible better answer: http://stackoverflow.com/a/29758638
accepted answer: http://stackoverflow.com/a/29758564
favorite count: 0
has title: Using a for loop within innerHTML
has answer: http://stackoverflow.com/a/29758638
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47649598
type: AnsweredQuestion

http://stackoverflow.com/a/29748060
answers question: http://stackoverflow.com/q/29747997
upvote count: 2
score: 0
downvote count: 2
has body: You can use this. For more info see this https://stackoverflow.com/a/2156090/909535 rect.classList.remove("CLASS_NAME");
type: Answer

http://stackoverflow.com/a/29764600
upvote count: 6
has comment: http://stackoverflow.com/comment/47699798
has body: JavaScript only has pass-by-value. I just wanted to make it clear from the beginning. To keep things simple, the code below illustrates the difference between pass-by-value and pass-by-reference. Pass-by-value function change (x) { x = 7; } var x = 1; change(x); console.log(x); // 1 Pass-by-reference (not available in JavaScript) function change (x) { x = 7; } var x = 1; change(x); console.log(x); // 7 Now, you need to understand that some types are allocated on the heap, while others are allocated on the stack. So what does that mean? Well, let's suppose you have a variable. var x = 5; Here the value lives on the stack. Which means, if I do var y = x; I will have two variables on the stack, both with their own copy of 5. Simple types are always allocated on the stack. Objects, on the other hand, live on the heap. When I do, var o1 = {x: 5}; the object will be allocated on the heap, but the value within o1 variable, which is a reference to the object in the heap (let's call #ref1 the value within o1 variable), will be allocated on the stack. Which means, if I do var o2 = o1; I will have two variables on the stack, both with their own copy of #ref1, but only one object allocated on the heap. Now, you can use the reference to access object's members, and because both o1 and o2 contain a reference to the same object, they will be able to locate the object in the heap an change it's x value. If, however, I do the following o2 = {x: 7}; this will change the value stored on the stack for the variable o2 (will call the new value #ref2). Now, there are two objects on the heap and two references stored on the stack. Finally, let's talk about your problem: // The array (which is an object) is allocated on the heap // {animals} variable will contain a reference to that object (#ref1) var animals = ["dog", "cat"]; // Pass-by-value pushSearchList(animals); // Local variable {passedAnimals} will contain a copy of #ref1, // but both {passedAnimals} and {animals} can modify the sam…
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29763603
answers question: http://stackoverflow.com/q/29763603
type: Answer
score: 6

angularjs-scope
tags question: http://stackoverflow.com/q/29838059
tags question: http://stackoverflow.com/q/29751161
tags question: http://stackoverflow.com/q/29707603
tags question: http://stackoverflow.com/q/29783189
tags question: http://stackoverflow.com/q/29730361
tags question: http://stackoverflow.com/q/29843523
tags question: http://stackoverflow.com/q/29736857
tags question: http://stackoverflow.com/q/29736942
tags question: http://stackoverflow.com/q/29823468
tags question: http://stackoverflow.com/q/29779962
tags question: http://stackoverflow.com/q/29767476
tags question: http://stackoverflow.com/q/29816538
tags question: http://stackoverflow.com/q/29813573
tags question: http://stackoverflow.com/q/29776402
tags question: http://stackoverflow.com/q/29800843
tags question: http://stackoverflow.com/q/29724300
tags question: http://stackoverflow.com/q/29825938
tags question: http://stackoverflow.com/q/29765640
tags question: http://stackoverflow.com/q/29795203
tags question: http://stackoverflow.com/q/29736274
tags question: http://stackoverflow.com/q/29725499
tags question: http://stackoverflow.com/q/29819137
tags question: http://stackoverflow.com/q/29798877
tags question: http://stackoverflow.com/q/29737922
tag name: angularjs-scope
tags question: http://stackoverflow.com/q/29819432
tags question: http://stackoverflow.com/q/29765012
tags question: http://stackoverflow.com/q/29767603
tags question: http://stackoverflow.com/q/29721214
tags question: http://stackoverflow.com/q/29792248
tags question: http://stackoverflow.com/q/29742388
tags question: http://stackoverflow.com/q/29793295
tags question: http://stackoverflow.com/q/29734523
tags question: http://stackoverflow.com/q/29769188
tags question: http://stackoverflow.com/q/29714416
tags question: http://stackoverflow.com/q/29743931
tags question: http://stackoverflow.com/q/29812095
tags question: http://stackoverflow.com/q/29693893
tags question: http://stackoverflow.com/q/29732153
type: Tag

http://stackoverflow.com/a/29720816
answers question: http://stackoverflow.com/q/29720643
type: Answer
has body: Here in the code-editor your code works pretty well! function changeSrc() { if (document.getElementById("bunnybutton").checked) { document.getElementById("picture").src = "https://pbs.twimg.com/profile_images/447374371917922304/P4BzupWu.jpeg"; } else if (document.getElementById("kittybutton").checked) { document.getElementById("picture").src = "http://cutewallpaperss.com/wp-content/uploads/2015/01/cute_cats__cats_picture_cute_wallpaperss_hd_for_mobile.jpg"; } } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"&gt;&lt;/script&gt; &lt;form action="" id="animals"&gt; &lt;input type="radio" id="bunnybutton" name="animal" value="bunny" onClick="changeSrc()"&gt;bunny&lt;br&gt; &lt;input type="radio" id="kittybutton" name="animal" value="kitty" onClick="changeSrc()"&gt;kitty &lt;/form&gt; &lt;img src="https://pbs.twimg.com/profile_images/447374371917922304/P4BzupWu.jpeg" id="picture" width=600px&gt;
downvote count: 0
score: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47576211
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29720643
has comment: http://stackoverflow.com/comment/47576572

http://stackoverflow.com/a/29840163
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/29840021
upvote count: 1
answers question: http://stackoverflow.com/q/29840021
type: AcceptedAnswer
downvote count: 0
has body: Using the selector expression $('#txtFirstName') is equivalent to document.getElementById('txtFirstName') .So using index later on i.e. $('#txtFirstName')[0] will not yield you any result i.e. it is undefined. Use indexer if you are going for 'class' selector (.) That's why you function will be breaking on the first line itself.

http://stackoverflow.com/q/29722601
favorite count: 0
has body: I am trying to solve first problem on this site, and since I am new to JS I have difficulties.. This is my code: var a = function(){ var array = []; for(var i=1;i&lt;10;i++){ if(i % 3 == 0 || i % 5 == 0){ array.push(i); document.write(array); }; }; }; a(); It prints this: 33,53,5,63,5,6,9 I want find multiplies of 3 and 5, put them in array and then sum those numbers(i am not there yet). What am I doing wrong and do I need to put loop inside function?
has comment: http://stackoverflow.com/comment/47579537
type: Question
linked to: http://stackoverflow.com/q/29381899
score: 0
has answer: http://stackoverflow.com/a/29726946
upvote count: 1
answer count: 1
downvote count: 1
duplicate of: http://stackoverflow.com/q/29381899
tagged with: arrays
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47582915
has comment: http://stackoverflow.com/comment/47579536
has title: Task 1 on projecteluler.net

http://stackoverflow.com/comment/47736137
score: 0
type: AnswerComment
has text: Yeah, that's it.. It solved my problem, One more lesson learned!! my table is dynamic. Thank you very much.
type: Comment
comment on: http://stackoverflow.com/a/29803999

http://stackoverflow.com/q/29830520
tagged with: javascript
has body: I'm trying to brush up on my JavaScript by doing some exercises. I wrote a range function that takes two arguments, start and end, and returns an array containing all the numbers from start up to (and including) end. Then I wrote a sum function that takes an array of numbers and returns the sum of these numbers. The problem is when I'm returning a value from range and passing to sum on line 27(Or console.log(sum(range(1, 10)));). However I'm getting zero as the return value. I check my sum function by passing the array test and it worked as expected. What am I overlooking? function range(start, end, step){ if(step === undefined){ step = 1; } var arr = []; for(var i = start; i &gt;= end; i += step){ arr.push(i); } return arr; } function sum(nums){ var total = 0; for(var i = 0; i &lt; nums.length; i++){ total += nums[i]; } return total; } var test = [1, 3, 5]; console.log(sum(test)); // → returns 9 console.log(range(5, 2, -1)); // → returns [5, 4, 3, 2] console.log(sum(range(1, 10))); // → should return 55, but returns 0
has title: Return value not being passed to other function
possible better answer: http://stackoverflow.com/a/29830740
answer count: 3
favorite count: 0
has comment: http://stackoverflow.com/comment/47787794
has answer: http://stackoverflow.com/a/29830836
has comment: http://stackoverflow.com/comment/47787693
score: 2
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/47787547
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/29830740
has comment: http://stackoverflow.com/comment/47787635
has answer: http://stackoverflow.com/a/29830629
accepted answer: http://stackoverflow.com/a/29830629

http://stackoverflow.com/a/29724144
score: 3
upvote count: 3
has body: When you start playing a song you could watch the play event of the audio and already start preloading the next song in the queue. This is the function I use for preloading audio, you can use it any time, not only in the first time the page being loaded: function preloadAudio (filename) { var sound = new Audio(); sound.preload = 'auto'; sound.addEventListener('canplaythrough', function () { // now the audio is ready to play through }); document.body.appendChild(sound); sound.src = filename; sound.load(); }
accepted answer of: http://stackoverflow.com/q/29723089
has comment: http://stackoverflow.com/comment/47588068
has comment: http://stackoverflow.com/comment/47590906
has comment: http://stackoverflow.com/comment/47591250
answers question: http://stackoverflow.com/q/29723089
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47591081
has comment: http://stackoverflow.com/comment/47591006

http://stackoverflow.com/comment/47719628
score: 0
has text: can u please update the answer, i checked but now no error, but no event triggered
type: Comment
comment on: http://stackoverflow.com/a/29795394
type: AnswerComment

http://stackoverflow.com/q/29697360
tagged with: ajax
has answer: http://stackoverflow.com/a/29697575
has comment: http://stackoverflow.com/comment/47531808
has comment: http://stackoverflow.com/comment/47531569
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/47530833
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47530803
upvote count: 2
has comment: http://stackoverflow.com/comment/47530923
has comment: http://stackoverflow.com/comment/47530957
has comment: http://stackoverflow.com/comment/47530936
accepted answer: http://stackoverflow.com/a/29697575
type: Question
score: -2
has comment: http://stackoverflow.com/comment/47532605
has body: I'm trying to submit a HTML from using AJAX. My HTML: lyrics I have dynamic form. so it can more than 1 form. My Javascript: $(function() { $(".lyrics").bind("submit", function() { var value = $("#song").val(); alert(value); $.post("lihat_lirik.php", { value: value }, function(data) { $("#lyric_results").html(data); }); return false; }); }); How can I get the song value from the form input as var? Here jsfidle Its work in first form but not on the second one,
has comment: http://stackoverflow.com/comment/47530877
has comment: http://stackoverflow.com/comment/47532363
has title: Get value via class in AJAX form submit
downvote count: 4
answer count: 3
has comment: http://stackoverflow.com/comment/47530823
possible better answer: http://stackoverflow.com/a/29697839
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29698319
has answer: http://stackoverflow.com/a/29697839
favorite count: 0

http://stackoverflow.com/q/29765227
score: 4
favorite count: 0
has answer: http://stackoverflow.com/a/29767070
has answer: http://stackoverflow.com/a/29766298
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29767070
has body: I'm writing a file processor in JavaScript (Node.js). Simplified pseudo code as below. For each line in file it prints to output and if the line is an include indicator it recursively handle the included file. function fileProcessor (file) { // read lines from file lines.forEach( function (line) { // #1 - include processor: if line matches "#include includefile" fileProcessor(includefile); // #2 - output processor: // write line to output }); } The next step I want to improve its design by decoupling the file processor and line processor. I'm familiar with OO, it should look like below class diagram. But now I want to try it in FP way. Define a function that returns the fileProcessor, which line processors are applied. var fileProcessorGen = function (lineProcessors) { return function (file) { // read lines from file lines.forEach( function (line) { lineProcessors.forEach( function (processor) { processor.call(this, line); }); }); }; }; My purpose is to achieve separation of concerns. In the example there are only two line processors but actually there will be more. And the caller will pick some line processors into use on its purpose. So I don't hard code them into file processor or any line processors. var fileProcessor = fileProcessorGen([includeProcessor, outputProcessor]); Now my problem is how can I call fileProcessor (which is partial application) inside my include processor? function includeProcessor(line) { if line matches "#include includefile" fileProcessor(includefile); // &lt;--- how to get fileProcessor ? }; function outputProcessor(line) { // write line to output } Maybe I have to pass the fileProcessor as argument into includeProcessor, but how? function includeProcessor(line, fileProcessor) { if line matches "#include includefile" fileProcessor(includefile); }; var fileProcessorGen = function (lineProcessors) { return function (file) { // read lines from file lines.forEach( function (line) { lineProcessors.forEach( function (processor) { processor.c…
type: Question
upvote count: 4
has title: JavaScript - recursive call partial applied function
answer count: 2
tagged with: functional-programming
accepted answer: http://stackoverflow.com/a/29766298
downvote count: 0
tagged with: javascript

graphics
tag name: graphics
type: Tag
tags question: http://stackoverflow.com/q/29780779
tags question: http://stackoverflow.com/q/29821057

http://stackoverflow.com/comment/47799542
comment on: http://stackoverflow.com/q/29836445
score: 1
has text: `js.constructor === Js`, hence `js.constructor.prototype === Js.prototype`. `Js` is a function and `Js.prototype` is an object. Not sure what your question really is. You can read about `prototype` in the [spec](http://www.ecma-international.org/ecma-262/5.1/#sec-15.3.5.2) if that's what you want.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47844365
comment on: http://stackoverflow.com/a/29833879
type: Comment
has text: You miss the part that Kevin said.
score: 0
type: AnswerComment

http://stackoverflow.com/a/29792089
has body: If you want to get the text of selected option, you need to get the jquery object of selected option and then use .text() or .html() to get inner content in it: $('.productOptionViewSelect option:selected').text();
answers question: http://stackoverflow.com/q/29792045
score: 0
type: Answer

http://stackoverflow.com/a/29798037
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47780531
has body: Updated: fixed bug on arrows. Demo Is this what you want? I just hid the buttons when the animation is played, and when a hover is detected they are shown again. If you want the buttons can just be disabled instead of hidden. var jq = $.noConflict(); var siId = -1, si = function () { //hidding buttons siId = setInterval(function () { var leftPos = jq('#browser').scrollLeft(); if (leftPos == 5400) { jq('#browser').animate({ scrollLeft: 0 }, 800); } else { jq('#browser').animate({ scrollLeft: leftPos + 900 }, 800); } }, 3000); } //hidding arrows initially jq('.rightarrow, .leftarrow').hide(); jq('#scrolldiv_container').mouseenter(function(){ jq('.rightarrow, .leftarrow').show('fast'); clearInterval(siId); }) jq('#scrolldiv_container').mouseleave(function(){ jq('.rightarrow, .leftarrow').hide('fast'); si(); }); jq('.rightarrow').click(function () { var leftPos = jq('#browser').scrollLeft(); if (leftPos == 5400) { jq('#browser').animate({ scrollLeft: 0 }, 800); } else { jq('#browser').animate({ scrollLeft: leftPos + 900 }, 800); } }); jq('.leftarrow').click(function () { var leftPos = jq('#browser').scrollLeft(); if (leftPos == 0) { jq('#browser').animate({ scrollLeft: 5400 }, 800); } else { jq('#browser').animate({ scrollLeft: leftPos - 900 }, 800); } }); //starting slider here si();
type: Answer
answers question: http://stackoverflow.com/q/29797265
accepted answer of: http://stackoverflow.com/q/29797265
score: 0

http://stackoverflow.com/q/29829882
has title: Getting socket.io namespace from anywhere in the project
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29834332
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29834332
has body: After my REST call and some database inserts I want to emit a new notification to the frontend via socket.io like this: socket.broadcast.emit('send notification', notification); Since the function I'm doing this in was triggered via REST and not via socket.io I don't have the variable 'socket'. I thought at first I can just get 'io' like: var io = require('socket.io') // or like: require('socket.io')(3000) from here I thought I can get the namespace like: var nsp = io.of('/notification-list'); nsp.on('connection', function (socket) { ... } But io seems to be undefined (or if I use it with port 3000 I get EADDRINUSE, because obviously socket.io is connected to 127.0.0.1:3000 This might be a very silly question, but since I can't figure it out on my own: How can I get the socket ready to use in this function? Any help would be much appreciated! edit: I tried friend00's solution, but I still can't figure out on how to do this. in my server.js I create the server &amp; import my socketIO stuff like this: var server = http.createServer(app).listen(app.get('port'), function () { }); require('./socketio_listener/socketIoListener')(server); then my socketIoListener.js var sockio = require("socket.io"); var io; function initIO(server) { if (!server) { throw new Error("ERR"); } if (!io) { io = sockio.listen(server); } return io; } module.exports.getIO = function () { if (!io) { throw new Error("ERR"); } return io; }; module.exports = function (server) { io = initIO(server); var nspNotification = io.of('/notification-list'); nspNotification.on('connection', function (socket) { socket.on('get notificationList', function (data) { notification.findNotifications(socket, data); }); // ... }); now I tried in the function I wanted to emit something via socket.io: var io = require("socket.io").getIO(); I also tried: var ioServer = require('../socketio_listener/socketIoListener'); ioServer.getIO(); But I still always get: TypeError: undefined is not a function SOLUTION I found the solu…
tagged with: node.js
type: AnsweredQuestion
score: 3
upvote count: 3
tagged with: socket.io
type: Question

momentjs
tags question: http://stackoverflow.com/q/29719631
tags question: http://stackoverflow.com/q/29770431
tags question: http://stackoverflow.com/q/29745586
tags question: http://stackoverflow.com/q/29810233
tags question: http://stackoverflow.com/q/29689507
tags question: http://stackoverflow.com/q/29768582
tags question: http://stackoverflow.com/q/29768082
tags question: http://stackoverflow.com/q/29819652
tags question: http://stackoverflow.com/q/29812511
tags question: http://stackoverflow.com/q/29805667
tag name: momentjs
tags question: http://stackoverflow.com/q/29773161
tags question: http://stackoverflow.com/q/29747550
type: Tag
tags question: http://stackoverflow.com/q/29745596
tags question: http://stackoverflow.com/q/29745873
tags question: http://stackoverflow.com/q/29752990
tags question: http://stackoverflow.com/q/29757162
tags question: http://stackoverflow.com/q/29815149
tags question: http://stackoverflow.com/q/29782362

http://stackoverflow.com/comment/47605142
score: 1
has text: You defined `R1Value` function inside `window.onload` function, hence making it local variable and not accessible globally. Fixed demo http://jsfiddle.net/2ufnK/53/
type: QuestionComment
comment on: http://stackoverflow.com/q/29735990
type: Comment

http://stackoverflow.com/q/29725608
type: AnsweredQuestion
has title: How would I make the color of squares change when they are clicked using Javascript?
accepted answer: http://stackoverflow.com/a/29725787
has body: I have written it out using an event listener but it does not work and the squares remain black even when they are clicked. I found a few typos that I fixed but I am not sure whether I was correct in using getElementsByClassName. html: and Javascript: var squares = document.getElementsByClassName('square'); for(var i = 0; i < squares.length; i++) { squares[0].addEventListener("click", changeColor); } function changeColor(event) { event.style.backgroundColor = randomColor(); } function randomColor() { var randomRed = Math.floor(Math.random() * 255); var randomGreen = Math.floor(Math.random() * 255); var randomBlue = Math.floor(Math.random() * 255); //create the string that is the ‘random color’ var randomColor = "rgb("+randomRed+","+randomGreen+","+randomBlue+")"; return randomColor; }
type: Question
tagged with: javascript
tagged with: event-handling
tagged with: dom-events
possible better answer: http://stackoverflow.com/a/29725874
has answer: http://stackoverflow.com/a/29725874
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29725787
has answer: http://stackoverflow.com/a/29725653
answer count: 4
tagged with: onclicklistener
has answer: http://stackoverflow.com/a/29725686

http://stackoverflow.com/q/29829470
tagged with: javascript
favorite count: 0
tagged with: google-maps-api-3
has answer: http://stackoverflow.com/a/50715336
has comment: http://stackoverflow.com/comment/47785706
has answer: http://stackoverflow.com/a/29831923
type: UnansweredQuestion
has body: I'm trying to get range-rings on my map, with the position of the image above the user's location, but the map doesn't appear when I test it and the user's location doesn't seem to show up on the map. I don't know what went wrong, I followed a tutorial on a website. This is the code: Radar Wat went wrong with my code? **Edit: Ik now know the fault occurs in this portion of the code: var coords = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); It gives a reference error saying "position is not defined" while earlier in the code i've written this: function success(position) { var lat = position.coords.latitude; var long = position.coords.longitude; }
tagged with: geolocation
score: -1
has title: GeoLocation Google Maps not working
type: Question
has comment: http://stackoverflow.com/comment/47785790
downvote count: 2
answer count: 2
tagged with: google-maps
upvote count: 1

http://stackoverflow.com/q/29690707
score: 2
tagged with: video
tagged with: audio
type: AnsweredQuestion
type: Question
linked to: http://stackoverflow.com/q/32312505
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
tagged with: webrtc
favorite count: 0
linked to: http://stackoverflow.com/q/29217361
upvote count: 2
has title: WebRTC : Chrome not recording video/audio
has body: I am trying to recording audio and video from a webcam. I stumbled upon HTML5 getUserMedia and further googling led me to WebRTC [Oh! This is really cool by the way]. I implemented it and its working fine on firefox, able to record both audio and video perfectly.But On chrome either the audio or the video gets recorded depending on the configuration passed. Further googling led me to this post, which clearly says that one thread blocks the other. Now i've seen demos for chrome that demonstrate both audio video capture simultaneously. This is what my code looks like: // Start recording captureUserMedia(function(stream) { localStream = stream; window.audioVideoRecorder = window.RecordRTC(stream, { type : 'video/webm' }); window.audioVideoRecorder.startRecording(); }); // Stop recording window.audioVideoRecorder.stopRecording(function(url) { videoElement.src = url; videoElement.onended = function() { videoElement.pause(); videoElement.src = URL.createObjectURL(audioVideoRecorder.getBlob()); }; }); The above code is for starting and recording the media on button click. The blob that i get back after recording when console logged shows video/webm for firefox and audio/wav for Chrome. This clearly shows that one is blocking the other. Is there any solution for recording both or any other javascript that i am missing should be added to make it work. Update: As @mido22 suggested below that is the workaround. Link can be found here.
has answer: http://stackoverflow.com/a/29691211
accepted answer: http://stackoverflow.com/a/29691211
has comment: http://stackoverflow.com/comment/92093615

http://stackoverflow.com/comment/47704285
type: QuestionComment
comment on: http://stackoverflow.com/q/29786105
score: 0
has text: no,i checked package.json and version is 0.12.2
type: Comment

http://stackoverflow.com/a/29709620
has comment: http://stackoverflow.com/comment/47555487
has comment: http://stackoverflow.com/comment/47556617
accepted answer of: http://stackoverflow.com/q/29709513
has comment: http://stackoverflow.com/comment/47556481
has comment: http://stackoverflow.com/comment/47556114
has comment: http://stackoverflow.com/comment/47556176
has comment: http://stackoverflow.com/comment/47555694
upvote count: 4
has comment: http://stackoverflow.com/comment/47556574
has comment: http://stackoverflow.com/comment/47555835
has comment: http://stackoverflow.com/comment/47555850
has comment: http://stackoverflow.com/comment/47554907
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47556528
score: 4
has body: If you want to make a redirect using ajax you can return a url, than make a window.location = response
type: Answer
answers question: http://stackoverflow.com/q/29709513
has comment: http://stackoverflow.com/comment/47555621
has comment: http://stackoverflow.com/comment/47556769
has comment: http://stackoverflow.com/comment/47556658
has comment: http://stackoverflow.com/comment/47555567
has comment: http://stackoverflow.com/comment/47555330
has comment: http://stackoverflow.com/comment/47555121

http://stackoverflow.com/q/29702649
favorite count: 0
possible better answer: http://stackoverflow.com/a/29702843
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29702843
upvote count: 3
tagged with: loops
has body: As a way to learn more about jQuery, I'm trying to make a function that will scroll to the bottom of the page, back to the top and then start again in an infinite loop. so far I have got this var scroll = $(document).scrollTop(); setInterval(function(){ scroll += 5; $(document).scrollTop(scroll); }, 10); This will scroll to the bottom of the page. When it hits the bottom it needs to set a flag, maybe var direction = 1 where 1 is down and 0 is up. Now I need to add something like if(direction){ // scroll down } else { // scroll up } So I the IF would constantly check the value of direction and increment the scroll var by either += 5 or -=5 Does that sound logical or is there a much simpler way to achieve this? EDIT Here is a working version of somethinghere's suggestion https://jsfiddle.net/Panomosh/evkxou3e/
has answer: http://stackoverflow.com/a/29702757
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Toggle between two loops
accepted answer: http://stackoverflow.com/a/29702757

node.js
tags question: http://stackoverflow.com/q/29766119
tags question: http://stackoverflow.com/q/29694647
tags question: http://stackoverflow.com/q/29814940
tags question: http://stackoverflow.com/q/29726090
tags question: http://stackoverflow.com/q/29833849
tags question: http://stackoverflow.com/q/29783275
tags question: http://stackoverflow.com/q/29766417
tags question: http://stackoverflow.com/q/29725395
tags question: http://stackoverflow.com/q/29795127
tags question: http://stackoverflow.com/q/29725011
tags question: http://stackoverflow.com/q/29767618
tags question: http://stackoverflow.com/q/29720109
tags question: http://stackoverflow.com/q/29745227
tags question: http://stackoverflow.com/q/29714175
tags question: http://stackoverflow.com/q/29695574
tags question: http://stackoverflow.com/q/29713505
tags question: http://stackoverflow.com/q/29705951
tags question: http://stackoverflow.com/q/29784549
tags question: http://stackoverflow.com/q/29727233
tags question: http://stackoverflow.com/q/29693249
tags question: http://stackoverflow.com/q/29771728
tags question: http://stackoverflow.com/q/29840169
tags question: http://stackoverflow.com/q/29799301
tags question: http://stackoverflow.com/q/29833676
tags question: http://stackoverflow.com/q/29764873
tags question: http://stackoverflow.com/q/29708442
tags question: http://stackoverflow.com/q/29837788
tags question: http://stackoverflow.com/q/29810250
tags question: http://stackoverflow.com/q/29768203
tags question: http://stackoverflow.com/q/29759226
tags question: http://stackoverflow.com/q/29760614
tags question: http://stackoverflow.com/q/29828470
tags question: http://stackoverflow.com/q/29830259
tags question: http://stackoverflow.com/q/29833998
tags question: http://stackoverflow.com/q/29710394
tags question: http://stackoverflow.com/q/29786671
tags question: http://stackoverflow.com/q/29693789
tags question: http://stackoverflow.com/q/29715422
tags question: http://stackoverflow.com/q/29829316
tags question: http://stackoverflow.com/q/29792771
tags question: http://stackoverflow.com/q/29743395
tags question: http://stackoverflow.com/q/29793683
tags question: http://stackoverflow.com/q/29820519
tags question: http://stackoverflow.com/q/29714062
tags question: http://stackoverflow.com/q/29711905
tags question: http://stackoverflow.com/q/29767221
tags question: http://stackoverflow.com/q/29714713
tags question: http://stackoverflow.com/q/29755625
tags question: http://stackoverflow.com/q/29705135
tags question: http://stackoverflow.com/q/29722932
tags question: http://stackoverflow.com/q/29717774
tags question: http://stackoverflow.com/q/29832450
tags question: http://stackoverflow.com/q/29759290
tags question: http://stackoverflow.com/q/29781855
tags question: http://stackoverflow.com/q/29764902
tags question: http://stackoverflow.com/q/29838183
tags question: http://stackoverflow.com/q/29837366
tags question: http://stackoverflow.com/q/29796416
tags question: http://stackoverflow.com/q/29773970
tags question: http://stackoverflow.com/q/29782878
tags question: http://stackoverflow.com/q/29692155
tags question: http://stackoverflow.com/q/29783478
tags question: http://stackoverflow.com/q/29755065
tags question: http://stackoverflow.com/q/29760443
tags question: http://stackoverflow.com/q/29773091
tags question: http://stackoverflow.com/q/29766415
tags question: http://stackoverflow.com/q/29716098
tags question: http://stackoverflow.com/q/29712051
tags question: http://stackoverflow.com/q/29809838
tags question: http://stackoverflow.com/q/29766025
tags question: http://stackoverflow.com/q/29690152
tags question: http://stackoverflow.com/q/29760313
tags question: http://stackoverflow.com/q/29704189
tags question: http://stackoverflow.com/q/29746028
tags question: http://stackoverflow.com/q/29756573
tags question: http://stackoverflow.com/q/29786433
tags question: http://stackoverflow.com/q/29744717
tags question: http://stackoverflow.com/q/29814850
tags question: http://stackoverflow.com/q/29815306
tags question: http://stackoverflow.com/q/29712197

http://stackoverflow.com/comment/47538532
comment on: http://stackoverflow.com/q/29701216
has text: @jeroen Ah yes... the "exception" to the rule ;-)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29773768
type: Question
has answer: http://stackoverflow.com/a/29775489
downvote count: 0
tagged with: javascript
has body: I'm working with a force labelled graph layout in D3 and one of my project requirements is that the text associated with each node should show up in a div/p element that occupies a fixed position on the web page instead of showing up directly adjacent to the concerned node (currently it activates on mouse hover). So every time a user hovers on any node, the corresponding text should show up in the div tag and not right next to the node in the graph. The following code snippets show how I'm currently working with my nodes and labels: var node = vis.selectAll(".node") .data(nodes) .enter().append("g") .attr("class", "node") .attr("cx", function(d) { return d.x; }) .attr("cy", function(d) { return d.y; }) .call(force.drag); node.append("text") .text(""); force.on("tick", function() { nodes[0].x = w / 2; nodes[0].y = h / 2; link.attr("x1", function(d) { return d.source.x; }) .attr("y1", function(d) { return d.source.y; }) .attr("x2", function(d) { return d.target.x; }) .attr("y2", function(d) { return d.target.y; }); node.attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; }); node.on("mouseover", function(d){ node.classed("node-active", function(o) { thisOpacity = isConnected(d, o) ? true : false; this.setAttribute('fill-opacity', thisOpacity); return thisOpacity; }); link.classed("link-active", function(o) { return o.source === d || o.target === d ? true : false; }); d3.select(this).classed("node-active", true); d3.select(this).select("circle").transition() .duration(500) .attr("r", 20); d3.select(this).select("text") .attr("dx", 12) .attr("dy", ".35em") .text(function(d) { return d.label; }); d3.select(this).select("circle") .on("click", function(d){ var win = window.open(d.label, '_blank'); win.focus(); }); }) .on("mouseout", function(d){ node.classed("node-active", false); link.classed("link-active", false); d3.select(this).select("circle").transition() .duration(750) .attr("r", 10); d3.select(this).select("text") .text(""); }); I have a di…
answer count: 3
favorite count: 0
has answer: http://stackoverflow.com/a/29774286
has answer: http://stackoverflow.com/a/29773923
tagged with: d3.js
type: UnansweredQuestion
has title: How to read D3 node label text into a div/paragraph element?
upvote count: 1
score: 1

http://stackoverflow.com/q/29815075
answer count: 2
tagged with: jsp
has answer: http://stackoverflow.com/a/29815235
tagged with: jquery
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29815194
has body: I want to access javascript code in my jsp file. I have included that javascript file in my jsp page. javascript file abc.js has following line of code: var dynamicDiv = 'Your leave is approved'; and my jsp file aaa.jsp has &lt;script src="abc.js"&gt; &lt;/script&gt; &lt;% String st = "&lt;script&gt; dynamicDiv &lt;/script&gt;"; out.println(" value = " + st); %&gt;
score: 2
upvote count: 3
tagged with: java
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47757549
has title: How to access javascript variable in a jsp page
tagged with: javascript

http://stackoverflow.com/q/29720573
tagged with: jquery
has comment: http://stackoverflow.com/comment/47576747
score: 4
favorite count: 0
has title: Bootstrap : Slider not working
has comment: http://stackoverflow.com/comment/47576100
has comment: http://stackoverflow.com/comment/47588929
has comment: http://stackoverflow.com/comment/47576276
has comment: http://stackoverflow.com/comment/47576374
tagged with: css
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/47576861
has comment: http://stackoverflow.com/comment/47576885
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47589188
linked to: http://stackoverflow.com/q/29719344
type: Question
upvote count: 4
has body: i am using this tabbed slider. Please visit link to see it in action. this is my CODE $(document).ready(function() { $('#myCarousel').carousel({ interval: 4000 }); var clickEvent = false; $('#myCarousel').on('click', '.nav a', function() { clickEvent = true; $('.nav li').removeClass('active'); $(this).parent().addClass('active'); }); $('#myCarousel').bind('slid', function() { // Get currently selected item var item = $('#myCarousel .carousel-inner .item.active'); // Deactivate all nav links $('#myCarousel .nav li').removeClass('active'); // Index is 1-based, use this to activate the nav link based on slide var index = item.index() + 1; $('#myCarousel .nav li:nth-child(' + index + ')').addClass('active'); }); }); #myCarousel .nav a small { display: block; } #myCarousel .nav { background: #eee; } .nav-justified > li > a { border-radius: 0px; } .nav-pills>li[data-slide-to="0"].active a { background-color: #16a085; } .nav-pills>li[data-slide-to="1"].active a { background-color: #e67e22; } .nav-pills>li[data-slide-to="2"].active a { background-color: #2980b9; } .nav-pills>li[data-slide-to="3"].active a { background-color: #8e44ad; } Headline Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscing elitr. Headline Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscing elitr. Headline Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscing elitr. Headline Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Lorem ipsum dolor sit a…
answer count: 1
has comment: http://stackoverflow.com/comment/47576528
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29721399
accepted answer: http://stackoverflow.com/a/29721399

http://stackoverflow.com/a/29723729
has body: This should do what you want: &lt;form method="GET"&gt; &lt;input type="text" class="form" name="name" placeholder="Enter your name!" id="name"&gt; &lt;input type="submit" onclick="return clicked();" value="I'm ready!"&gt; &lt;/form&gt; &lt;script&gt; function clicked() { var name = document.getElementById('name').value; return confirm('Hiya,' + name); } var email = document.getElementById('name').value; &lt;/script&gt;
has comment: http://stackoverflow.com/comment/47581827
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/70766194
score: 1
answers question: http://stackoverflow.com/q/29723690
has comment: http://stackoverflow.com/comment/47581878
has comment: http://stackoverflow.com/comment/47581790
accepted answer of: http://stackoverflow.com/q/29723690
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/70799295

http://stackoverflow.com/comment/47590647
type: Comment
type: QuestionComment
has text: You have some syntax errors on `innerHTML`
comment on: http://stackoverflow.com/q/29728367
score: 0

http://stackoverflow.com/a/29834540
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/29834313
type: Answer
has body: The reason for your error message is that @foreach becomes a server-side directive with Razor. The server is only interpreting the contents of the @foreach block, not rest of your myFunction. Because of this, there is no valid definition for c on the server when it executes the @foreach logic. If you use Array.forEach instead, it will run on the client side. You can then pass an anonymous function to it in line with the method call, which will close over your original definition of c. Also as others have said, don't pass the return value of myFunction to $(document).ready - pass the function itself (see comment below). Finally, a word on best practices. It's usually an antipattern to use innerHTML unless you're writing some modularized UI widget. This is especially true when you have server-side template rendering built into your stack. By that I mean that beautifulcoder's advice is more correct for this particular example below. That is, you are likely better off to use Razor for rendering your HTML on the server side directly. Client side rendering wouldn't be too egregious however if you were using it to update data w/o a page refresh rather than as a one-shot when the ready event fires (though in that case you're better off to use a JS lib with proper data binding such as knockoutjs). &lt;script&gt; // note: pass function to handler, not return of function $(document).ready(myFunction) function myFunction() { var table = document.getElementById("tbVideos"); var c = 5; Model.forEach(function(item) { if (c == 5) { c = 0; var row = table.insertRow(c); } var cell1 = row.insertCell(c); call1.innerHTML = Html.DisplayFor(modelItem =&gt; item.ID_TERCEIRO); c = c + 1; }); } &lt;/script&gt;
accepted answer of: http://stackoverflow.com/q/29834313
upvote count: 4
type: AcceptedAnswer

http://stackoverflow.com/comment/47727499
has text: is there a way to do it where it doesnt go left all the way back to 1; however continues going right and just starts #1 again? Looks bad to see all the other images/text sliding fast. Also, any way to add the ability to choose slide/fade?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29799526
type: AnswerComment

http://stackoverflow.com/comment/47786898
has text: I not using Web Browser control. Do you have any suggestion to do that?
score: 0
comment on: http://stackoverflow.com/q/29829780
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29818554
type: Question
has body: beginner to JavaScript here. I've made a simple slideshow script, which functions by changing the CSS for background-image on the imgcontainer div. Below is a simplified version of my code and HTML. Prev img Next img The slideshow itself seems to function fine... except for a giant memory leak it has in Chrome. Each time the image changes, the tab memory usage increases by large amounts, sometimes 10mb, sometimes 50mb. This trend continues until the memory usage seems to cap out at some certain point. Firefox doesn't seem to exhibit this behavior, instead cycling through the images with no memory issues at all. Is this some weakness in my coding, or is it a Chrome issue? I've tried both setting the background-image CSS as above, and directly setting the source of an image tag. Any help with this issue or comments on the code itself would be much appreciated!
tagged with: javascript
has title: Memory leak with simple slideshow code when changing image
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29818723
accepted answer: http://stackoverflow.com/a/29818723
favorite count: 0
tagged with: memory-leaks
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: google-chrome

css
tags question: http://stackoverflow.com/q/29716019
tags question: http://stackoverflow.com/q/29728058
tags question: http://stackoverflow.com/q/29691423
tags question: http://stackoverflow.com/q/29709783
tags question: http://stackoverflow.com/q/29733029
tags question: http://stackoverflow.com/q/29694784
tags question: http://stackoverflow.com/q/29790996
tags question: http://stackoverflow.com/q/29818695
tags question: http://stackoverflow.com/q/29803036
tags question: http://stackoverflow.com/q/29693128
tags question: http://stackoverflow.com/q/29712800
tags question: http://stackoverflow.com/q/29749708
tags question: http://stackoverflow.com/q/29816645
tags question: http://stackoverflow.com/q/29799182
tags question: http://stackoverflow.com/q/29691077
tags question: http://stackoverflow.com/q/29691480
tags question: http://stackoverflow.com/q/29735680
tags question: http://stackoverflow.com/q/29807517
tags question: http://stackoverflow.com/q/29743932
tags question: http://stackoverflow.com/q/29752485
tags question: http://stackoverflow.com/q/29736374
tags question: http://stackoverflow.com/q/29827627
tags question: http://stackoverflow.com/q/29768402
tags question: http://stackoverflow.com/q/29717765
tags question: http://stackoverflow.com/q/29805854
tags question: http://stackoverflow.com/q/29695884
tags question: http://stackoverflow.com/q/29840823
tags question: http://stackoverflow.com/q/29743974
tags question: http://stackoverflow.com/q/29696716
tags question: http://stackoverflow.com/q/29829277
tags question: http://stackoverflow.com/q/29749773
tags question: http://stackoverflow.com/q/29805198
tags question: http://stackoverflow.com/q/29789935
tags question: http://stackoverflow.com/q/29813714
tags question: http://stackoverflow.com/q/29779635
tags question: http://stackoverflow.com/q/29802832
tags question: http://stackoverflow.com/q/29712322
tags question: http://stackoverflow.com/q/29727483
tags question: http://stackoverflow.com/q/29835229
tags question: http://stackoverflow.com/q/29759812
tags question: http://stackoverflow.com/q/29800058
tags question: http://stackoverflow.com/q/29811552
tags question: http://stackoverflow.com/q/29716260
tags question: http://stackoverflow.com/q/29759957
tags question: http://stackoverflow.com/q/29815978
tags question: http://stackoverflow.com/q/29726271
tags question: http://stackoverflow.com/q/29701803
tags question: http://stackoverflow.com/q/29826448
tags question: http://stackoverflow.com/q/29768338
tags question: http://stackoverflow.com/q/29840859
tags question: http://stackoverflow.com/q/29833238
tags question: http://stackoverflow.com/q/29753151
tags question: http://stackoverflow.com/q/29748292
tags question: http://stackoverflow.com/q/29823766
tags question: http://stackoverflow.com/q/29735781
tags question: http://stackoverflow.com/q/29790582
tags question: http://stackoverflow.com/q/29734308
tags question: http://stackoverflow.com/q/29800425
tags question: http://stackoverflow.com/q/29740728
tags question: http://stackoverflow.com/q/29799509
tags question: http://stackoverflow.com/q/29803836
tags question: http://stackoverflow.com/q/29756835
tags question: http://stackoverflow.com/q/29767004
tags question: http://stackoverflow.com/q/29722118
tags question: http://stackoverflow.com/q/29836016
tags question: http://stackoverflow.com/q/29713037
tags question: http://stackoverflow.com/q/29695523
tags question: http://stackoverflow.com/q/29768056
tags question: http://stackoverflow.com/q/29795325
tags question: http://stackoverflow.com/q/29767286
tags question: http://stackoverflow.com/q/29714662
tags question: http://stackoverflow.com/q/29701689
tags question: http://stackoverflow.com/q/29740966
tags question: http://stackoverflow.com/q/29813499
tags question: http://stackoverflow.com/q/29836343
tags question: http://stackoverflow.com/q/29811178
tags question: http://stackoverflow.com/q/29699794
tags question: http://stackoverflow.com/q/29793102
tags question: http://stackoverflow.com/q/29813974
tags question: http://stackoverflow.com/q/29805659

http://stackoverflow.com/comment/47551194
has text: I recommend using .toggle() instead of .hide() and .show(). $().toggle() automatically determines if the object is visible or not
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29707706

http://stackoverflow.com/q/29752566
has comment: http://stackoverflow.com/comment/47645569
has title: Prevent auto clicked link XSS attack using CSP
has comment: http://stackoverflow.com/comment/47883421
has comment: http://stackoverflow.com/comment/47646154
has comment: http://stackoverflow.com/comment/47637342
tagged with: content-security-policy
tagged with: javascript
type: UnansweredQuestion
has body: Whilst using CSP for a slightly different purpose (sandboxing) I realized that a very simple auto clicked link seems to bypass even relatively strict CSP. What I am describing is the following: Content security policy: default-src 'none'; script-src 'unsafe-inline'; And the body: test Obviously in a real attack you would include the cookie information into the href field first and probably wrap this in a hidden self-embedding iframe or make the domain redirect you back to where you came from (potentially with additional url parameters thus creating a sort of XMLHttpRequest bypassing connect-src), but this basic example does show the problem. Is there any way to prevent this with CSP (which still does allow the execution of Javascript)? Similar attacks The same thing can obviously be done with some other navigation methods as well. The reason why I was asking specifically about this method actually has more to with my secondary goals than XSS exploits. Either way, open to any and all real solutions. Irrelevant side explanation Because of all the confusion how this could still be applicable even without script-src: 'unsafe-inline'. Imagine the following file named api.ext print URLParameters.method [...] This file could then be called like api.ext?method= <!-- (except you would need additional URL encoding and stuff, this is just to get the point across). Finding exploits like this is hard and they are quite rare, but things like connect-src seem to exist to prevent leakage of information even in those cases.
score: 16
favorite count: 0
tagged with: xss
type: Question
has answer: http://stackoverflow.com/a/29886253
has answer: http://stackoverflow.com/a/29921078
has comment: http://stackoverflow.com/comment/47646069
has comment: http://stackoverflow.com/comment/47645193
has comment: http://stackoverflow.com/comment/47883236
has answer: http://stackoverflow.com/a/29882481
has comment: http://stackoverflow.com/comment/47639482
has comment: http://stackoverflow.com/comment/47645388
has comment: http://stackoverflow.com/comment/47719902
answer count: 3
has comment: http://stackoverflow.com/comment/47645465
downvote count: 1
upvote count: 17

http://stackoverflow.com/q/29833901
type: Question
score: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/29834031
has body: I have the following code: var User = { get: function (options) { var self = this; $.ajax({ url: options.url, success: function (data, response) { self.nextPageUrl = data.pagination.next_page; options.success(data, response); } }); }, nextPage: function (success) { this.get({ url: this.nextPageUrl, success: success }); } } User.get({ url: 'https://cache.getchute.com/v2/albums/aus6kwrg/assets', success: function (data, response) { // Through `data.pagination.next_page` I can get the URL // of the next page. } }); User.nextPage({ success: function (data, response) { // Here I want to make the same request but using the next_page // based on the next related to the previous' one. } }); The problem Basically, I want to perform the nextPage() operation based on the antecessor request (User.get()), but due to its asynchronousity, the nextPage() method doesn't know the this.nextPageUrl property—it returns undefined as expected. Finally, the question is: can someone think in a way to keep the current syntax flow but solving this approach? Actually, is there a way? And no, I'm not available to make a synchronous request. General knowledge I thought to use an event mechanism to deal with this: when the request is made and .nextPage() is called, then try to listen to an event to be emitted for x seconds, then I expected the this.nextPageUrl property to be available in that event-based scope. What do you guys think? DISCLAIMER: The logic of next_page is preprocessed by the server and only then is sent to the client. I have no option to use an increment/decrement behavioral operation. If you want to play with this problem, click here for the jsFiddle.
has comment: http://stackoverflow.com/comment/47794780
answer count: 3
has comment: http://stackoverflow.com/comment/47794633
has comment: http://stackoverflow.com/comment/47794529
downvote count: 1
has comment: http://stackoverflow.com/comment/47795222
has answer: http://stackoverflow.com/a/29834348
accepted answer: http://stackoverflow.com/a/29834348
has comment: http://stackoverflow.com/comment/47795064
favorite count: 0
tagged with: ajax
upvote count: 4
possible better answer: http://stackoverflow.com/a/29834031
has comment: http://stackoverflow.com/comment/47794775
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29836040
has title: Dealing with out-of-scope variable against an AJAX call

http://stackoverflow.com/comment/47676273
type: AnswerComment
comment on: http://stackoverflow.com/a/29772645
type: Comment
score: 0
has text: I have made an edit to my answer, you should look into `replaceWith` in your case (instead of previous append).

http://stackoverflow.com/q/29779764
has answer: http://stackoverflow.com/a/29781089
score: 6
type: Question
has comment: http://stackoverflow.com/comment/47690650
has comment: http://stackoverflow.com/comment/47690280
tagged with: javascript
has body: I'm actually using this button group structure with bootstrap. Now I need to add class active to each button when I click on it. And remove from it when I click on another button. This is my HTML structure, is something like that: Provatoscana15 12345 12345 12345 12345 12345 12345 Someone who could help me? Thanks.
has answer: http://stackoverflow.com/a/29780212
has answer: http://stackoverflow.com/a/29780477
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/29779802
favorite count: 0
has title: Add and remove class active on button with jquery onclick function
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29779802
upvote count: 6
answer count: 4
accepted answer: http://stackoverflow.com/a/29780477
type: AnsweredQuestion

http://stackoverflow.com/a/29793896
type: Answer
has body: The <s:actionmessage/> tag generates an HTML like the following: Your Message 1 Your Message 2, and so on... This will break your javascript function with invalid JS code: alert(' ... '); The solution is to manually iterate over your messages, and build the output by yourself, with <s:property/>, instead of using <s:actionmessage/>: <s:if test="actionMessages!=null && actionMessages.size > 0"> </s:if> Also remember to wrap the single quotes from your actionMessages.
answers question: http://stackoverflow.com/q/29788779
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/29718846
has answer: http://stackoverflow.com/a/29719653
has answer: http://stackoverflow.com/a/29719268
type: Question
upvote count: 4
downvote count: 0
tagged with: javascript
score: 4
possible better answer: http://stackoverflow.com/a/29719268
has comment: http://stackoverflow.com/comment/47572221
answer count: 3
linked to: http://stackoverflow.com/q/3127429
favorite count: 0
has body: I am learning javascript and would love help understanding the snippet of code. From Object.DefineProperties definition, the first parameter is an object. Is MyObjectConstructor a declaration or an object. With a constructor function I would expect to call new to make it an object. This is what is confusing me. Or as I read in Javascript functions are objects so do I treat it as an object and the this property is where all staticProps and instanceProps are added to? var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps){ Object.defineProperties(child, staticProps) }; if (instanceProps) { Object.defineProperties(child.prototype, instanceProps); } }; function myFunction() { function MyObjectConstructor(element) { this.element = element; this.initialized = false; } _prototypeProperties(MyObjectConstructor, {...}, {...}); }
has answer: http://stackoverflow.com/a/29719011
accepted answer: http://stackoverflow.com/a/29719011
has title: Am I passing an object to object.defineProperties?
linked to: http://stackoverflow.com/q/336859
type: AnsweredQuestion

http://stackoverflow.com/comment/47749813
has text: Mike: This is only a script I wrote to show the problematic behavior of particles, In my "clouds" code I move the camera, but that code is way too long and complex to be added here.
comment on: http://stackoverflow.com/q/29810048
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47598266
type: AnswerComment
comment on: http://stackoverflow.com/a/29732263
type: Comment
score: 0
has text: I think you just haven't understood the approach I've suggested, which does indeed use AJAX. My recommendation to try some AJAX tutorials is the best way forward from here, I think - it is a very broad topic, and it is better for you to read a book than for me to write one in an answer.

http://stackoverflow.com/comment/47528127
type: AnswerComment
type: Comment
has text: Dude, it is `Handlebars.compile` not `handlebars.compile`
score: 1
comment on: http://stackoverflow.com/a/29695579

http://stackoverflow.com/comment/47793992
type: Comment
score: 21
comment on: http://stackoverflow.com/a/29828190
type: AnswerComment
has text: @Touffy I think I'd stick with `mm-1`, so that `months.length==12`.

http://stackoverflow.com/comment/47532546
comment on: http://stackoverflow.com/q/29693785
type: QuestionComment
has text: no I did not get you
type: Comment
score: 0

http://stackoverflow.com/a/29716366
has body: var str = '[{"album_desc":"","id":1,"album_title":"","album_creation_date":"2015-04-18T10:42:38.519Z","album_pics":["{\"media_type\":\"image/jpeg\",\"last_modified_date\":\"Sat Apr 18 2015 16:12:31 GMT+0530 (IST)\",\"thumnail_pic_loc\":\"LostFile_JPG_63901.jpg\",\"large_pic_loc\":\"LostFile_JPG_63901.jpg\",\"filter_type\":\"image/jpeg\",\"pic_id\":\"d5bd\"},{\"media_type\":\"image/jpeg\",\"last_modified_date\":\"Sat Apr 18 2015 16:12:31 GMT+0530 (IST)\",\"thumnail_pic_loc\":\"LostFile_JPG_67677.jpg\",\"large_pic_loc\":\"LostFile_JPG_67677.jpg\",\"filter_type\":\"image/jpeg\",\"pic_id\":\"d5bd\"},"]}]'; var finalData = str.replace(/\\/g, ""); console.log(finalData); Remove Backslashes from Json Data in JavaScript This might helps you :)
answers question: http://stackoverflow.com/q/29716184
type: Answer
score: 0

http://stackoverflow.com/a/29781384
has body: I think you are trying to achieve something like this. here is the fiddle https://jsfiddle.net/4mcej5fk/ &lt;input type="text" id="name" /&gt; &lt;a href="#" id="display"&gt;&lt;/a&gt; $('#name').keyup(function() { $('#display').html($(this).val()); }); to change href attribute you can simply do $('#name').keyup(function() { $('#display').attr("href",$(this).val()); }); Here is the fiddle https://jsfiddle.net/qswur2bz/
score: 0
has comment: http://stackoverflow.com/comment/47715262
has comment: http://stackoverflow.com/comment/47709233
type: Answer
answers question: http://stackoverflow.com/q/29781166

http://stackoverflow.com/comment/47791518
has text: @user384496 I just posted an update hopefully that helps...If this answer is helpful can you please upvote it and accept it as correct answer thanks!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29831184

http://stackoverflow.com/comment/47650218
comment on: http://stackoverflow.com/q/29758791
type: Comment
type: QuestionComment
has text: Echo out what? You can not "echo" a JavaScript variable from PHP with out getting it server side first.. Anyone else back me up here?
score: 0

http://stackoverflow.com/q/29822056
answer count: 1
has comment: http://stackoverflow.com/comment/47771484
tagged with: javascript
tagged with: flask
score: 0
accepted answer: http://stackoverflow.com/a/29823292
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47771960
type: AnsweredQuestion
has body: I started learning AngularJS and trying to make a very simple skeleton application with multiple views. I am using Flask for the back-end. Problem: When I load the page it does not show the appropriate view - I get a blank page. The relevant folder structure is like this: app/ | static/ | | js/ | | | app.js | | | controllers.js | | partials/ | | | landing.html | templates/ | | index.html | views/ | | views.py Basically my index.html looks like this: My App My python index function: @app.route('/') @app.route('/index') def index(): return make_response(render_template('index.html')) My 'app.js': 'use strict'; angular.module('MyApp', ['ngRoute']) .config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) { $routeProvider .when('/', { templateUrl: 'static/partials/landing.html', controller: IndexController }) .otherwise({ redirectTo: '/' }); $locationProvider.html5Mode(true); }]); And my IndexController in controllers.js which does nothing: 'use strict'; /* Controllers */ function IndexController($scope) { } The landing.html file simply contains some text. Where am I going wrong with this? All I get is an empty page. I noticed it does not complain or throw any errors if I put any path in templateUrl: path/to/landing.html, so I am not sure this is the correct way reference these files. Is it possible to somehow use the flask url_for function here? EDIT I tried using a template directly instead of a template URL. So I have ..... .when('/', { template: 'Hello', controller: IndexController }) .... This is still giving me a blank page.
has comment: http://stackoverflow.com/comment/47770597
type: Question
has comment: http://stackoverflow.com/comment/47770773
has answer: http://stackoverflow.com/a/29823292
has title: AngularJS view not loading
has comment: http://stackoverflow.com/comment/47771183

http://stackoverflow.com/comment/47624395
comment on: http://stackoverflow.com/a/29746033
has text: Moment constructor like this is discouraged and will be removed in future. Try to use with format :)
type: AnswerComment
type: Comment
score: 2

http://stackoverflow.com/comment/47739144
comment on: http://stackoverflow.com/a/29805191
type: AnswerComment
has text: True! my goal is to use jQuery UI to pop up some form when the user will click on the circle/text. Is that also feasible?
score: 0
type: Comment

http://stackoverflow.com/q/29838311
score: 2
downvote count: 0
favorite count: 0
has body: According to Is JavaScript a pass-by-reference or pass-by-value language? JavaScript passes string objects by value. Because of that, calling the indexOf method will trigger copying the content. In my case, I am parsing a big string to look for data. I heavily use indexOf to find data. String can big as long as 100-200KB and I could need to call indexOf up to 1000 times per full scan. I'm afraid this will cause polluting 'memory' with unnecessarily copied string and could impact performance. Am I correct in my conclusion? If so, what is the proper way to deal with my task? Potentially, I could use regular expressions, but at the moment that looks too complex.
has answer: http://stackoverflow.com/a/29838389
type: Question
has title: 'indexOf' method performance optimization
has comment: http://stackoverflow.com/comment/47942987
has comment: http://stackoverflow.com/comment/47804181
upvote count: 2
answer count: 2
tagged with: string-parsing
has answer: http://stackoverflow.com/a/29839258
tagged with: performance
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47803022
linked to: http://stackoverflow.com/q/518000

http://stackoverflow.com/q/29732640
tagged with: http://stackoverflow.com/tag/html
tagged with: twitter-bootstrap-3
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/47598690
has comment: http://stackoverflow.com/comment/47598715
has comment: http://stackoverflow.com/comment/47598672
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29732896
possible better answer: http://stackoverflow.com/a/29732786
has comment: http://stackoverflow.com/comment/47598485
has comment: http://stackoverflow.com/comment/47598629
has answer: http://stackoverflow.com/a/29732786
type: Question
accepted answer: http://stackoverflow.com/a/29732975
has comment: http://stackoverflow.com/comment/47598781
has title: Allow people to click on links under bootstrap modal when modal backdrop is not present
has comment: http://stackoverflow.com/comment/47599187
tagged with: javascript
tagged with: jquery
has body: I have a very basic page made with Bootstrap. Using javascript I made an auto-loading modal that appears when the page loads and disappears after 3 seconds. I removed the grey backdrop that usually comes along Bootstrap modals. What I'd like it for people to be able to click on the text and links that are really placed on the page. Bascially, while the modal stays open (3 sec), all the links below become unclickable (the mouse becomes a pointer even!) Here is a fiddle to show you the situation (note that I don't mange to make the modal appear on this jsfiddle while it does work on computer): http://jsfiddle.net/DTcHh/6808/ (I'd like to be able to click on the button called 'Here is for example a link I'd like people to be able to click while modal is open') HTML Bootstrap 3 Twitter Bootstrap 3.0 Starter template with CSS and JS included. Here is for example a link I'd like people to be able to click while modal is open How to take part in the deal? some explanations JS $(window).load(function(){ $('#notificationModal').modal('show'); $('#notificationModal').fadeTo(3000, 500).slideUp(500, function(){ $(this).remove(); }); }); How to achieve this?
has answer: http://stackoverflow.com/a/29732975
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47598565

http://stackoverflow.com/comment/47695440
type: QuestionComment
comment on: http://stackoverflow.com/q/29782735
type: Comment
has text: Sadly if you want to support all the way back to IE6 or before and have this test done in _JavaScript_, you may need to consider bouncing off an intermediate page which sets a cookie based upon some feature support tests, then reading this cookie as the next page is served. Other choices include using the server to decide based on the client's user agent header or always including the code via the old _IE conditional comments_ `<!--[if lt IE 9]>foo<![endif]-->`
score: 0

http://stackoverflow.com/comment/47774848
type: Comment
has text: @Enjoyted - but axaj should send the data to the php function (delete.php) but it appears that it is not sending anything....
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29823476

http://stackoverflow.com/a/31898507
upvote count: 2
has body: I had the same issue, worked around it with this line, and didn't have to disable turbolinks: google.maps.event.addDomListener(document, 'page:change', initialize);
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/51712214
answers question: http://stackoverflow.com/q/29728056

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

http://stackoverflow.com/a/29756346
answers question: http://stackoverflow.com/q/29756287
score: 7
upvote count: 7
has comment: http://stackoverflow.com/comment/47644978
has body: Rule #1 of list-based menus: Style the links, not the wrappers. Only style the list for positioning (display/float etc.). Use display:block on your A-tags and put all styling on that tag, not the list itself. Home Move background-color: #333 to the .link class in your css, and add display:block to that declaration.
has comment: http://stackoverflow.com/comment/47645885
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47645620
type: Answer
accepted answer of: http://stackoverflow.com/q/29756287

http://stackoverflow.com/comment/47547190
has text: Firstly, you're adding elements with the ID `target` in a loop, and ID's are unique. Secondly, you can't split elements across `append()` calls, you have to insert "whole" elements, right now you ***are*** hiding the first element with the ID `target`, but that element has no children.
comment on: http://stackoverflow.com/q/29705698
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29698161
downvote count: 1
answers question: http://stackoverflow.com/q/29692155
has body: Did you try to run in debug like simple node.js? node --debug app.js
score: 0
upvote count: 1
type: Answer

http://stackoverflow.com/comment/47725375
score: 0
type: Comment
has text: You should change `.yourselector` to the button that triggers the drawer to open/close. Also, try adding that line to each of your `onclick()` functions. I don't know how your code works.
type: AnswerComment
comment on: http://stackoverflow.com/a/29795248

http://stackoverflow.com/a/29775997
has comment: http://stackoverflow.com/comment/47719337
type: Answer
upvote count: 3
score: 3
has body: The first problem is you need to fix your use of &lt;= in the loop, it is causing your loop to iterate one too many times (explaining the undefined messages). Change to &lt; not &lt;=: for(i=0; i&lt;t.length; i++) It appears you just want to get a handle on the element, in the click event. In that case, the this context will refer to the clicked element. t[i].onclick= function() { console.log( this ); } If you really need the index then you'll need a closure, because otherwise i will always be the last iteration, by the time any click event occurs. Closure example: for(i=0; i&lt;t.length; i++){ (function(protectedIndex){ t[i].onclick= function() { console.log( t[protectedIndex] ); } })(i); } Note: document.querySelectorAll has better browser support than document.getElementsByClassName so you could change to: var t = document.querySelectorAll(".table")
downvote count: 0
answers question: http://stackoverflow.com/q/29775765

http://stackoverflow.com/comment/47530471
type: QuestionComment
comment on: http://stackoverflow.com/q/29696856
has text: @Phylogenesis please provide it as an answer so he can accept it and the question doesn't show as 'unanswered' anymore.
score: 0
type: Comment

http://stackoverflow.com/comment/47642290
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29709495
has text: Nope, you read that issue wrong. We're speaking about the legacy file system helpers, `this.copy`, `this.write`, etc. `this.fs` is the new shiny way to handle files in Yeoman.

http://stackoverflow.com/comment/47608829
comment on: http://stackoverflow.com/q/29737554
score: 0
type: Comment
type: QuestionComment
has text: A todo list app can be a large subject! It can be a good project to approach several concepts. see some ideas: http://codepen.io/gaelb/pen/bdbMgL

http://stackoverflow.com/comment/47656141
type: Comment
comment on: http://stackoverflow.com/q/29762174
has text: what are you really trying to do
score: 0
type: QuestionComment

http://stackoverflow.com/comment/48062909
has text: I have withCredentials but the PUT/OPTIONS is not sending cookie (GET/POST do send cookie). Any reason why this would be true?
comment on: http://stackoverflow.com/a/29824341
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/comment/47542125
has text: Why use `.prop` when you can set `scrollTop` directly... `target.scrollTop(this.scrollTop)`.
comment on: http://stackoverflow.com/q/29702952
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47622619
comment on: http://stackoverflow.com/a/29745101
type: AnswerComment
score: 0
type: Comment
has text: Thanks! Now I got you. And thanks for mentioning the need to call $digest. This probably saved me a half-day's work to figure out why things aren't updated on the screen :)

http://stackoverflow.com/a/29974517
answers question: http://stackoverflow.com/q/29837282
has body: The answer is "yes", but it depends on the particulars of each authentication strategy. Is it a GET or POST request? Do you have to set custom HTTP headers? Send cookies? This article is my de-facto guide for everything CORS related: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Overview
score: 0
type: Answer

http://stackoverflow.com/q/29810170
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has body: Im probably miles off but can anyone tell me if this is possible. function myFunction(){ var myArray = (localStorage.getItem("storedArray")); myArray = jQuery.makeArray( myArray ); myArray.push(['someone@myemail','15','myUsername']); localStorage.setItem("storedArray", JSON.stringify(grabArray)); localStorage.removeItem("storedArray"); } Every time this function is ran i'm wanting to get an array from local storage push values to it and then store it back, so like updating it. The idea is that once an event happens in my application, this item will be cleared, to start logging again. When i've got the item from local storage i've attempted to turn it back into an array but i don't think this is the way to do it as it isn't returning anything. Can anything be done with JSON? Thanks.
has answer: http://stackoverflow.com/a/29810192
type: Question
answer count: 2
tagged with: arrays
downvote count: 0
tagged with: javascript
tagged with: variables
has answer: http://stackoverflow.com/a/29810355
accepted answer: http://stackoverflow.com/a/29810355
favorite count: 0
possible better answer: http://stackoverflow.com/a/29810192
upvote count: 2
has title: Converting string back to an array from local storage
tagged with: local-storage
score: 2

http://stackoverflow.com/q/29812511
answer count: 3
tagged with: date
tagged with: javascript
has answer: http://stackoverflow.com/a/29812619
has answer: http://stackoverflow.com/a/29812561
type: AnsweredQuestion
has body: I have this code where I want to get next 15 days from the start date var fortnightStart = moment("15 04 2015", "DD MM YYYY"); for (var i = 1; i &lt;= 15; i++) { dates.push(fortnightStart.add(i, "days").format("D MMM")); } console.log(dates); This is the output ["16 Apr", "18 Apr", "21 Apr", "25 Apr", "30 Apr", "6 May", "13 May", "21 May", "30 May", "9 Jun", "20 Jun", "2 Jul", "15 Jul", "29 Jul", "13 Aug"] I don't know why its missing a few days.
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47753026
favorite count: 0
possible better answer: http://stackoverflow.com/a/29812619
type: Question
has answer: http://stackoverflow.com/a/29812662
has title: Days are not added properly with momentJS in JavaScript
upvote count: 1
tagged with: momentjs
accepted answer: http://stackoverflow.com/a/29812561

http://stackoverflow.com/q/29820749
has comment: http://stackoverflow.com/comment/47768499
has title: How to access multidimensional array data?
has comment: http://stackoverflow.com/comment/47767846
type: Question
accepted answer: http://stackoverflow.com/a/29821052
has body: I have an array that I can't access the data of. $.get("url"), function(data) { console.log(data); } Console output: Array( [0] =&gt; Array ( [element0] =&gt; 1 [element1] =&gt; value1 [element2] =&gt; value2 ) [1] =&gt; Array ( [element0] =&gt; 2 [element1] =&gt; value1 [element2] =&gt; value2 ) ) Now I'm trying to access the elements with data[0], data[0]["element0"] and what not, but I either get nothing or it returns the characters at that position instead of the data. How do I access the elements properly?
tagged with: arrays
linked to: http://stackoverflow.com/q/988363
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47768340
score: 0
tagged with: multidimensional-array
has comment: http://stackoverflow.com/comment/47767848
answer count: 1
has comment: http://stackoverflow.com/comment/47767803
has comment: http://stackoverflow.com/comment/47767806
has comment: http://stackoverflow.com/comment/47767898
upvote count: 1
has comment: http://stackoverflow.com/comment/47768267
downvote count: 1
has comment: http://stackoverflow.com/comment/47767941
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29821052

http://stackoverflow.com/q/29835734
tagged with: jquery
has answer: http://stackoverflow.com/a/29836170
accepted answer: http://stackoverflow.com/a/29836170
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Get a piece of Javascript to work on my Jquery slide form
type: AnsweredQuestion
has body: I have a problem that has been driving me crazy! I am using slide in forms for a step by step ordering page for pizza, My javascript makes it so I can specify how many toppings People can click on. Here is a working example without my site. http://jsfiddle.net/SQdNQ/195/ This is the javascript actual function: $(document).ready(function () { $("input[name='toppingtypes']").change(function () { var maxAllowed = 2; var cnt = $("input[name='toppingtypes']:checked").length; if (cnt &gt; maxAllowed) { $(this).prop("checked", ""); alert('You can select ' + maxAllowed + ' Toppings'); } }); }); The problem is that I cannot get it working on my actual page. Here is a Github repository of Some of my code. (Click On The Pizza Button when on index.php) https://github.com/dhierholzer/onlineordering.git Note: The piece of Javascript is at the bottom of my index page that limits how many boxes can be checked. I think it has something to do with my version of jquery being outdated on my webpage but if I try to use updated jquery code, the site breaks. Please let me know if you can find out why I cant get my javscript to run on the Checkbox form. Thanks again, please note if you need more details.
type: Question
possible better answer: http://stackoverflow.com/a/29835772
has answer: http://stackoverflow.com/a/29835772
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/q/29770967
upvote count: 10
type: Question
tagged with: split
linked to: http://stackoverflow.com/q/16396124
tagged with: arrays
downvote count: 0
score: 10
has comment: http://stackoverflow.com/comment/47672500
tagged with: javascript
has answer: http://stackoverflow.com/a/29771055
accepted answer: http://stackoverflow.com/a/29771105
answer count: 3
has title: String with Comma separated numbers to array of integer in javascript
has body: I am converting String with Comma separated numbers to a array of integer like, var string = "1,2,3,4"; var array = string.replace(/, +/g, ",").split(",").map(Number); it returns array = [1,2,3,4]; But when , var string = ""; var array = string.replace(/, +/g, ",").split(",").map(Number); it returns array = [0]; I was expecting it to return array = []; can someone say why this is happening.
has comment: http://stackoverflow.com/comment/47672505
has answer: http://stackoverflow.com/a/33896201
favorite count: 0
possible better answer: http://stackoverflow.com/a/29771055
has answer: http://stackoverflow.com/a/29771105
has comment: http://stackoverflow.com/comment/128451335
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47672667

http://stackoverflow.com/a/29805312
answers question: http://stackoverflow.com/q/29804319
upvote count: 7
has comment: http://stackoverflow.com/comment/47740592
type: AcceptedAnswer
has body: PrimeFaces provides a powerful client side API. Make use of it! Add a widgetName to your calendar. This way it is way easier to handle to component on the client side &lt;p:calendar widgetVar="mycalendar" ... /&gt; write your custom JS, using the PrimeFaces client side API &lt;h:form&gt; &lt;p:calendar widgetVar="mycal1" timeOnly="true" /&gt; &lt;p:calendar widgetVar="mycal2" timeOnly="true" /&gt; &lt;p:commandButton onclick="var d = PF('mycal1').getDate(); d.setHours(d.getHours() + 1); PF('mycal2').setDate(d);" /&gt; &lt;/h:form&gt; Inside JS, you are able to modify the returned date according to your requirements and afterwards use the .setDate() function to set your date in the other calendar.
downvote count: 0
score: 7
has comment: http://stackoverflow.com/comment/47739370
accepted answer of: http://stackoverflow.com/q/29804319
type: Answer

http://stackoverflow.com/q/29693785
tagged with: meteor
has comment: http://stackoverflow.com/comment/47658323
answer count: 0
upvote count: 2
type: UnansweredQuestion
downvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/47523998
has comment: http://stackoverflow.com/comment/47532556
has comment: http://stackoverflow.com/comment/47532546
has body: How can we select multiple images in a meteor application? I could not find anything in https://github.com/sylvaingi/meteor-imagemagick Can a jquery script run in meteor application? $('img').live('click', function(){ var $this = $(this); $this.toggleClass('selected'); if($this.hasClass('selected')) $this.next(':hidden').val($this.data('id')) else $this.next(':hidden').val('');});$('form').submit(function(){ console.log($(this).serialize()); return false; })
tagged with: image
tagged with: mongodb
has comment: http://stackoverflow.com/comment/47534878
has title: How to select multiple images in meteor
has comment: http://stackoverflow.com/comment/47524697
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 0
has comment: http://stackoverflow.com/comment/47524373

http://stackoverflow.com/comment/47761882
type: AnswerComment
comment on: http://stackoverflow.com/a/29817157
type: Comment
has text: That's not obvious from the question. The OP asks when it's safe to use $apply, which it is never so I provide an alternative. Using $q would of course also solve this issue but using `$timeout` is a much easier way to force your changes into the next cycle.
score: 0

http://stackoverflow.com/q/29719289
accepted answer: http://stackoverflow.com/a/29719304
type: Question
has body: I am working with an AngularJS powered page, and I need to display a running clock inside a read-only input text field (two way bound with data-ng-model). To simulate a running clock, I am using a JavaScript scheduler with setTimeout to call a function every 1000 milliseconds, which updates the $scope'd property value which in turn is bound to that input text field. Somehow the value in the input field is not getting updated. So I placed a &lt;pre /&gt; tag and updated its content using a jQuery selector. That is working fine, so I need help getting the input text field value to also get updated every second. I have set up a jsFiddle for this example. The HTML is below: &lt;body data-ng-app="formApp"&gt; &lt;div data-ng-controller="FormCtrl"&gt; Current Date and Time &lt;input type="text" data-ng-model="formData.currentDateTime" readonly="readonly" size="60" /&gt; &lt;/div&gt; &lt;pre id="currentDateTime" style="font-size:1.5em;"&gt; &lt;/pre&gt; &lt;/body&gt; The AngularJS app module and controller are declared as follows: (function() { var formApp = angular.module("formApp", []); formApp.controller("FormCtrl", function ($scope) { $scope.formData = {}; $scope.formData.currentDateTime = new Date().toString(); (function updateCDT() { $scope.formData.currentDateTime = new Date().toString(); document.getElementById("currentDateTime").innerHTML = $scope.formData.currentDateTime; setTimeout(updateCDT, 1000); })(); }); })();
score: 9
upvote count: 9
has answer: http://stackoverflow.com/a/29719365
downvote count: 0
has answer: http://stackoverflow.com/a/29719304
possible better answer: http://stackoverflow.com/a/29719342
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29719306
has title: AngularJS Input field not updating from setTimeout inside controller
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29719342
answer count: 4
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
tagged with: settimeout

http://stackoverflow.com/q/29735851
has comment: http://stackoverflow.com/comment/47604831
has answer: http://stackoverflow.com/a/29735993
has answer: http://stackoverflow.com/a/29735897
answer count: 2
score: 2
tagged with: jquery-selectors
downvote count: 0
has body: I'm trying to select a checkbox with value "foo" and check it. I tried this: But nothing seems to be happening. Is there something I'm missing? I'm very new at this.
favorite count: 0
has title: Basic jQuery Selector Issue
accepted answer: http://stackoverflow.com/a/29735897
has comment: http://stackoverflow.com/comment/47604868
type: AnsweredQuestion
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/47604890
possible better answer: http://stackoverflow.com/a/29735993
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/47599356
comment on: http://stackoverflow.com/a/29733050
has text: Not sure why it was downvoted, because it does work: http://jsfiddle.net/v39zs2wh/1/
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/29746807
upvote count: 3
has body: As A. Wolff says, you'd need what is known as a jQuery Plugin to do this, i.e. add your function into the jQuery namespace: $.fn.AddCreatePopoverBinding = function() { return this.webuiPopover({ placement: 'bottom', title: 'Link Item to Button', content: '123', animation: 'pop', delay: { show: null, hide: 300 }, }); } That should also allow for chaining: var button = $('.button').AddCreatePopoverBinding(); console.log(button.text());
score: 3
answers question: http://stackoverflow.com/q/29746703
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47626050
type: Answer
has comment: http://stackoverflow.com/comment/47625963
accepted answer of: http://stackoverflow.com/q/29746703

http://stackoverflow.com/comment/47759864
has text: at server side validation instead of calling the id #someid call it as as dot(classname which is declared to the html element) you will get it...!!
comment on: http://stackoverflow.com/a/29816059
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29825868
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29824675
score: 1
upvote count: 1
has body: Everything put together with slightly modified Jakubs suggestion. See on Plunkr. function superTD(id, str, tooltip, callback) { var td = $('&lt;td/&gt;', { id: id, title: tooltip, text: str }); var up = $('&lt;span/&gt;'); // &lt;-- this elm will be replaced td.append(up); $('#container').append(td); callback(up, str); } function onCreated(elm, fname) { elm.uploadFile({ url: '/url', fname: fname }); } $(document).ready(function() { superTD(1, 'foo', 'bar', onCreated); superTD(2, 'bar', 'foo', onCreated); });

http://stackoverflow.com/a/29812447
upvote count: 1
has body: try to change your wrapper css to #wrapper { width: 100%; height: auto; overflow:auto; margin:0 0 0 20%; /* ### */ }
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29811934
score: 1

http://stackoverflow.com/q/29761672
has comment: http://stackoverflow.com/comment/47655477
tagged with: web-applications
tagged with: history.js
score: 3
tagged with: hashbang
type: Question
has title: Better to use Hashbangs or History API with history.js for single-page application?
downvote count: 0
tagged with: javascript
upvote count: 3
has body: The way I see it, it seems like hashbangs were a 'hacky' fix that actually do quite well! However, it seems like the History API (pushstate popstate) is the RIGHT way to make a single page application and is actually reasonable now that History.js provides such a clean/simple framework for states. I know the largest issue: 1) Backwards compatibility issues with History API - HTML 4 browsers cannot utilize the History API. However, history.js has that solved now, as it automatically converts to be compatible with HTML 4 browsers (changes to hashes). I know this is a debate that changes by the month like any programming debate, but as of April 2015 which is the better option? And which is more likely to withstand the test of time? I am currently using History.js with my single page application, however my management is somewhat skeptical and prefers hashbangs. Any input?
tagged with: single-page-application
has comment: http://stackoverflow.com/comment/47655395
favorite count: 0
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/29756643
has comment: http://stackoverflow.com/comment/47645798
favorite count: 0
has body: I'm using the jQueryUI SelectMenu with a themeroller and it's working great in Chrome and Firefox. However, in IE8 (my lowest version needed and first IE to test), when I click the menu, the screen jumps to the top of the page, as if I had a bookmark/href to the top of the page (I don't). When I scroll down the page in Firefox or Chrome, then click the select menu, the dropdown appears and I can make a selection. When I repeat the steps in IE8, the page jumps to the top when I click the select menu. Does anyone know if this is a bug with the SelectMenu and/or if there's any way to prevent it from happening? My code is pretty basic and I'm providing it in case someone notices that I've implemented something wrong in the SelectMenu. I'm generating the content with Powershell (in the 'generated_content' div), in case that's important to anyone. Here's the snippet of HTML: Report Report Run Date: *Date* Here's the snippet of jQuery: $(document).ready(function() { $('.selector').append("Select an item: "); $('.selector').append(" "); $('#select_item').append(" "); $('#select_item').append(" All "); $('#select_item').selectmenu() var changeSelect = function(event, item) { $(this).trigger('change', item); }; $('#select_item').selectmenu({change:changeSelect}); $('#select_item').change(function() { $('#select_item option:selected').each(function() { $('.generated_content').hide(); if ($(this).attr("value")=="all") { $('.generated_content').show(); } else { $('#' + $(this).val()).show(); } }); }); }); $(window).load(function() { $('#selector').selectmenu('refresh'); }); jQuery Versions I'm currently using jQuery 1.11.2 with jQueryUI 1.11.3. I also tried jQuery 1.9.0 with jQueryUI 1.10.0. Thanks.
has comment: http://stackoverflow.com/comment/47646815
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47646566
has comment: http://stackoverflow.com/comment/47645941
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/47649841
upvote count: 1
has comment: http://stackoverflow.com/comment/47654276
type: Question
has comment: http://stackoverflow.com/comment/47645891
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47646364
has comment: http://stackoverflow.com/comment/47646129
has title: jQueryUI SelectMenu jumps to top of page when menu is opened/clicked in IE8
downvote count: 0
has comment: http://stackoverflow.com/comment/47721849

http://stackoverflow.com/q/29799544
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47727736
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has body: I have done an animation using animate(), queue(), and dequeue(). I have read that jquery has - jquery.queue() or $.queue() and jquery.dequeue() or $.dequeue(). Can someone help me these new terms with the help of this example, making changes and using - $.queue() and $.dequeue() ? Thanks ... Click Hi
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/47727649
has answer: http://stackoverflow.com/a/29800234
downvote count: 3
tagged with: queue
has title: Example with .queue() & .dequeue() to do with $.queue() & $.dequeue()
has comment: http://stackoverflow.com/comment/47727573

http://stackoverflow.com/comment/47587529
has text: Post updated to IIFE. Thanks :-)
comment on: http://stackoverflow.com/q/29726780
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/52643294
comment on: http://stackoverflow.com/a/29839369
type: AnswerComment
has text: How about if we want a template and controller on "shell" also? I can't seem to get that to work.
type: Comment
score: 0

http://stackoverflow.com/q/29793793
has comment: http://stackoverflow.com/comment/47716217
accepted answer: http://stackoverflow.com/a/29794483
possible better answer: http://stackoverflow.com/a/29795774
has comment: http://stackoverflow.com/comment/47715989
has answer: http://stackoverflow.com/a/29794483
tagged with: php
has title: error handling from AJAX action page
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47716086
has answer: http://stackoverflow.com/a/29795774
tagged with: error-handling
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/26561231
has comment: http://stackoverflow.com/comment/47716303
tagged with: javascript
tagged with: jquery
has body: I developed my web-application using PHP, AJAX, and jQuery. It went smoothly. Most of the requests made to the application are from AJAX; all insert, update, delete, and select I already made some error handling for the pages in my application which are not by accessed via AJAX. My problem is; in my application AJAX is used thousands of times. Now it will take a LOT of effort to add error handling to all of those endpoints. My question is; is there a way that I can use some form of generic error handling in AJAX, or can I redirect from an AJAX action page to another page displaying an error (as that would also be fine)? I'm 99% sure this is not possible, but I want some expert advice.
tagged with: ajax
score: 0

http://stackoverflow.com/q/29695051
answer count: 1
has comment: http://stackoverflow.com/comment/47527065
has comment: http://stackoverflow.com/comment/47526390
has title: Disabling a JavaScript function with a Cookie
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29695303
has comment: http://stackoverflow.com/comment/47526843
tagged with: cookies
has comment: http://stackoverflow.com/comment/47526475
type: Question
has body: I am working on a mobile part of my site and I would like to disable a welcome message which is produced by a JavaScript function when the page loads. What I am trying to do is to disable that function with a cookie that has the expiration time of 20 minutes. This is how far I've gotten with the cookie: // c_name = cookie name // c_value = cookie value // ex_min = expiration in minutes function setCookie(c_name, c_value, ex_min) { var d = new Date(); d.setTime(d.getTime() + (ex_min*60*1000)); var expires = "expires="+d.toUTCString(); document.cookie = c_name + "=" + c_value + "; " + expires; } // Cookie that lasts for 20 minutes. setCookie("last-visited", "1", 20); What I can't figure out is how to disable that function from within the cookie. And yes, the cookie is from w3schools.com. Any help is appreciated. Thanks.
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/29695303

http://stackoverflow.com/comment/47795618
type: AnswerComment
has text: You are correct that this is an issue with the example, however this is not likely the source of the error described. I am not the one who downvoted you however. I'd argue that this shouldn't be downvoted, as it's still helpful information.
type: Comment
comment on: http://stackoverflow.com/a/29834431
score: 1

http://stackoverflow.com/q/29766805
has answer: http://stackoverflow.com/a/29766895
has answer: http://stackoverflow.com/a/29768577
has comment: http://stackoverflow.com/comment/47719054
favorite count: 0
has comment: http://stackoverflow.com/comment/47683994
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47732108
has comment: http://stackoverflow.com/comment/47673757
tagged with: http://stackoverflow.com/tag/html
score: 11
has answer: http://stackoverflow.com/a/29766945
answer count: 4
has body: I have a page with some input fields. The data from this page is sent to the server without using form submit. I have a JavaScript that collects the data, creates a JSON and sends it to the server using Ajax call. The issue in this case is that the browser doesn't save the data in order to offer autocomplete for the next time when the user fills the same form. Is any way to avoid this? I need a way to offer autocomplete! Any trick?
downvote count: 1
type: Question
upvote count: 12
has comment: http://stackoverflow.com/comment/47664844
tagged with: autocomplete
has title: HTML input autocomplete
tagged with: javascript
has answer: http://stackoverflow.com/a/29768405
linked to: http://stackoverflow.com/q/15462991

http://stackoverflow.com/comment/47622646
type: Comment
comment on: http://stackoverflow.com/a/29745086
has text: Easy and clean. You just say: "you used the option 10 seconds ago. So wait for 20 seconds and then enable it again!! Thank you!!!
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47587406
type: Comment
has text: I don't see problem. Subjects are readed from database. So list of subject depends on selection logic. Each user should have different subjects list. And submit will return only listed subjects, there are no need for static list.
comment on: http://stackoverflow.com/a/29714834
type: AnswerComment
score: 0

http://stackoverflow.com/a/29749396
upvote count: 2
answers question: http://stackoverflow.com/q/29748991
score: 2
downvote count: 0
type: Answer

http://stackoverflow.com/q/29788670
type: Question
possible better answer: http://stackoverflow.com/a/29788762
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29788815
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47706585
has title: Fill a box with colors JavaScript
has body: I have a dropdown list which has name of some colors. Then I have a function that fills the box I have created. I want to relate them, that when I change the color from dropdown list, then press the draw button, the color that the box is filled changes accordingly. How can I do that ? Thanks. Here is my code: Red Green Blue
has answer: http://stackoverflow.com/a/29788834
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29788815
has answer: http://stackoverflow.com/a/29788762

http://stackoverflow.com/a/29865163
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/48299288
upvote count: 2
answers question: http://stackoverflow.com/q/29824385
has body: Check this JSFiddle Here's the code that adds an image to leaves: var leafnodes = svg.selectAll('g.leaf.node') .append("image") .attr("xlink:href", "http://www.e-pint.com/epint.jpg") .attr("width", 10) .attr("height", 10); And prior to that leaf nodes were marked with the leaf class like so: .attr("class", function(n) { return n.children ? "inner node" : "leaf node"; }) UPDATE: To add different images to nodes you can do something like that: var imgs = ['http://***.jpg', 'http://***.jpg', 'http://***.jpg']; var leafnodes = svg.selectAll('g.leaf.node') .append("image") .attr("xlink:href", function (d) { // get random image from array return imgs[Math.floor(Math.random() * imgs.length)]; }) .attr("width", 10) .attr("height", 10); Check the JSFiddle above for the full example.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29824385

http://stackoverflow.com/a/29715272
score: 3
answers question: http://stackoverflow.com/q/29715216
has comment: http://stackoverflow.com/comment/47565451
has body: If your dates are in ISO format you can use such a code: myarray.sort(function (a, b) { return (new Date(a[0])).getTime() - (new Date(b[0])).getTime(); });
has comment: http://stackoverflow.com/comment/47565513
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/47565474
downvote count: 0

http://stackoverflow.com/q/29732322
tagged with: ng-options
upvote count: 0
answer count: 1
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/29733088
has body: Basically i am java developer recently switched to coding in javascript(AngularJs) so i am comnpletely new to javascript/AngularJS. While I was coding I came across a case wherein if I had to show say as in ex: set of fruits only/Vegetables only or both based on the drop down selected what i am doing currently is having a "fruitNVeg " array which holds all items and having a temp variable "currentItems" which at any instance filters out the required items like Fruit only/Vegtable only/both based on the items selected. Now my question is Are there any ways wherein i could use "fruitNVeg" itself in the HTML and say show only the items whose "show" property is set to true. i.e.,To get same functionality without using the extra variable "currentItems". Also please optimize my current logic if possible in terms No. of lines I am fed up of creating 2 arrays(complete+filtered) everywhere :-( FruitsController.js $scope.fruitNVeg = [ { id : 1, name : "mango" , show : true , cat : "F"}, { id : 2, name : "orange", show : true , cat : "F"}, { id : 3, name : "tomato", show : true , cat : "F"}, { id : 4, name : "brinjal",show : false , cat : "V"}, { id : 4, name : "potato", show : false , cat : "V"}, { id : 4, name : "ginger", show : false , cat : "V"}, ]; $scope.selectList = [ {id:1, name : "Fruits Only" }, {id:2, name : "Vegetable Only" }, {id:3, name : "Fruits &amp; Vegetable" }, ]; $scope.selectedItem = $scope.selectList[0]; $scope.currentItems = angular.copy($scope.fruitNVeg,$scope.currentItems); $scope.selItem = $scope.currentItems[0]; $scope.onChangeSelecList = function (){ if(selectedItem.name == "Fruits Only"){ //Use $filter to populate $scope.currentItems with fruits only items } else if(selectedItem.name == "Vegetable Only"){ //Use $filter to populate $scope.currentItems with vegetables only items } else { $scope.currentItems = angular.copy($scope.fruitNVeg,$scope.currentItems); } $scope.selItem = $scope.currentItems[0]; }; FruitDemo.Html &lt;label&gt; Please Select wh…
accepted answer: http://stackoverflow.com/a/29733088
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
has title: ng-options filtering based on a property
downvote count: 1
type: Question

http://stackoverflow.com/comment/47536537
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29699871
has text: oh ya, sorry - didn't read it fully!

http://stackoverflow.com/q/29725499
has answer: http://stackoverflow.com/a/29725961
answer count: 4
has answer: http://stackoverflow.com/a/29725635
has answer: http://stackoverflow.com/a/29725839
has answer: http://stackoverflow.com/a/29728309
tagged with: angularjs-scope
type: Question
has title: AngularJS form and null/empty values
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
score: 8
upvote count: 8
tagged with: angularjs
type: UnansweredQuestion
has body: I am working with a somewhat dynamic AngularJS form. In other words, I am able to add rows of input fields, etc. So my approach was to start with a $scope.formData empty object, to encapsulate all the properties that are bound to both static and dynamic HTML form elements. The AngularJS code is as follows: (function() { var formApp = angular.module("formApp", []); formApp.controller("FormCtrl", function ($scope, $timeout) { $scope.formData = {}; $scope.formData.subscribers = [ { name: null, email: null } ]; $scope.addSubscriber = function() { $scope.formData.subscribers.push({ name: null, email: null }); }; }); })(); The HTML for the AngularJS form: Name of Topic: Subscribers: Add subscriber Name Email Debug info: {{ formData }} Note the Debug info section at the end, which displays the $scope.formData object and its contents. I have a couple of issues with the way I have implemented this form. When the page first loads, there is no formData.title property in the $scope, but since it is bound to the Title input text field, when I start typing a value, the title property gets added to the $scope. However when I delete the value in the input text field, the formData.title property still exists in the $scope as an empty string. I suppose this is okay, but I really want to clean up empty or null values when submitting the form. I would like to do it on the client side if it is easy to do so, so the server side code does not have to clean up anything. With the dynamic Subscribers section, I can keep adding as many rows as I want, but ultimately, I would like to filter out all empty subscriber objects on the client side. Does AngularJS have any options for detecting and cleaning null/empty values in the $scope before further processing, such as a $http POST? Note I have set up a jsFiddle for this example.

http://stackoverflow.com/comment/47788967
comment on: http://stackoverflow.com/q/29828831
type: Comment
score: 0
has text: @Sparky Yeah I am using images on this form. I was hoping someone could spot a problem and at least get me going in the right direction. I know this is a difficult question
type: QuestionComment

http://stackoverflow.com/q/29798548
type: Question
tagged with: dom
has comment: http://stackoverflow.com/comment/47725795
has comment: http://stackoverflow.com/comment/47726146
has comment: http://stackoverflow.com/comment/47767839
tagged with: javascript
tagged with: jquery
has body: I am currently developing a tool to display large amount of data in different tables. Different amount of data from one table has to be assigned into another table more than once. This view takes almost 20 seconds to load and i want to lower the time by manipulating the DOM instead of assigning every match within PHP. I want to place a few identifiers hidden in the first table and on click of one row, show the additional data within the next element. Here is an example how the Tables look before: Name Bla Bla 3,5 Additional Header Additional Info 1 Additional Info 2 Additional Info 3 Additional Info 4 Additional Info 5 Additional Info 6 And after the click: Name Bla Bla 3,4,5 Additional Header Additional Info 3 Additional Info 5 I've found out how to achieve this with a single row but how do i do that with different, identitying them by their ids?
has comment: http://stackoverflow.com/comment/47725444
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47731564
linked to: http://stackoverflow.com/q/10757047
has title: How to copy specific content from one table to another using Javascript
answer count: 0
type: UnansweredQuestion
tagged with: php

http://stackoverflow.com/comment/47516679
score: 1
comment on: http://stackoverflow.com/q/29689937
type: Comment
type: QuestionComment
has text: `samp` tag is used to achieve richer text effect. And if you **want to take the values from the "screen"** you need to take `input` tags..having said that you can either use `document.getElementById('numb1').innerHTML` or `document.getElementById('numb1').textContent` to retrieve the values which will be of `string` type, so before adding convert to number type using `parseInt`

http://stackoverflow.com/comment/47720905
type: Comment
has text: It's not my question. Appending an empty string coerces the variable to a string so that it can be safely compared to a string. Your code is *even more likely* to not work because you've remove that part.
score: 0
comment on: http://stackoverflow.com/a/29795032
type: AnswerComment

http://stackoverflow.com/q/29836308
has answer: http://stackoverflow.com/a/29923837
upvote count: 3
type: Question
tagged with: google-analytics
answer count: 2
has body: im new at implementing event tracking in analytics, this is a contact form and i would like to know if my syntaxis is correct, google analytics help is not very none code savvy friendly i think. I'm using the jQuery example they provide. Escríbenos
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Correct syntaxis for event tracking in Google Analytics 2015
has answer: http://stackoverflow.com/a/29836884
type: UnansweredQuestion
tagged with: analytics.js
score: 3

http://stackoverflow.com/a/29833653
has comment: http://stackoverflow.com/comment/47810849
has comment: http://stackoverflow.com/comment/47801454
answers question: http://stackoverflow.com/q/29833560
type: Answer
has comment: http://stackoverflow.com/comment/47797108
has body: So your cloud code is the issue. You need to create a query for each user object, and from that query set the score and save. There is all of this information at: https://parse.com/docs/cloud_code_guide#functions You'll want to fetch the user object based on the userId you're passing in and then change that object's score to the appropriate value. Below is a sample cloud function from the documentation that should give you a start for the query part of this task. Parse.Cloud.define("averageStars", function(request, response) { var query = new Parse.Query("Review"); query.equalTo("movie", request.params.movie); query.find({ success: function(results) { var sum = 0; for (var i = 0; i &lt; results.length; ++i) { sum += results[i].get("stars"); } response.success(sum / results.length); }, error: function() { response.error("movie lookup failed"); } }); });
has comment: http://stackoverflow.com/comment/47796750
score: 0

http://stackoverflow.com/q/29838952
answer count: 2
has comment: http://stackoverflow.com/comment/47805156
accepted answer: http://stackoverflow.com/a/77959328
possible better answer: http://stackoverflow.com/a/29839003
has title: how to fix TypeError: Cannot read property 'authenticate' of undefined passportjs
has answer: http://stackoverflow.com/a/29839003
upvote count: 4
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: passport.js
favorite count: 0
has answer: http://stackoverflow.com/a/77959328
has body: im working on a node passport login authentication but im stack on this error which makes it hard for me to run my node server /home/emil/Documents/myapp/app/routes.js:14 app.post('/login', passport.authenticate('local-login', { ^ TypeError: Cannot read property 'authenticate' of undefined how can i fix it? my code: server.js var express = require('express'); var app = express(); var port = 8080; var cookieParser = require('cookie-parser'); var session = require('express-session'); var morgan = require('morgan'); var mongoose = require('mongoose'); var bodyParser = require('body-parser'); var passport = require('passport'); var configDB = require('./config/database.js'); mongoose.connect(configDB.url); app.use(passport.initialize()); app.use(passport.session()); app.use(morgan('dev')); app.use(cookieParser()); app.use(bodyParser.urlencoded({ extended: false })); app.use(session({ secret: 'anystringoftext', saveUninitialized: true, resave: true })); app.set('view engine', 'ejs'); //app.use('/', function(req, res){ // res.send('Our First Express program!'); // console.log(req.cookies); // console.log('==============='); // console.log(req.session); //}); require('./app/routes.js')(app); app.listen(port); console.log('Server running on port: ' + port); routes.js: var User = require('./models/user'); module.exports = function (app, passport) { app.get('/', function (req, res) { res.render('index.ejs'); }); app.get('/login', function (req, res) { res.render('login.ejs', { message: req.flash('loginMessage') }); }); app.post('/login', passport.authenticate('local-login', { successRedirect: '/profile', failureRedirect: '/login', failureFlash: true })); app.get('/signup', function (req, res) { res.render('signup.ejs', { message: req.flash('signupMessage') }); }); app.post('/signup', passport.authenticate('local-signup', { successRedirect: '/', failureRedirect: '/signup', failureFlash: true })); app.get('/profile', isLoggedIn, function(req, res){ res.render('profile.ejs', { u…
type: Question
tagged with: node.js
score: 4
has comment: http://stackoverflow.com/comment/47804244

http://stackoverflow.com/comment/47806472
comment on: http://stackoverflow.com/q/29839854
score: 0
has text: Don't mix jQuery and angular together... specially in your controller.. what are you really trying to do
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29816894
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47761070
has body: Use errorPlacement errorPlacement: function (error, element) { error.insertBefore(element); }
answers question: http://stackoverflow.com/q/29816545
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29816545
upvote count: 1
has comment: http://stackoverflow.com/comment/47761154

http://stackoverflow.com/q/29820359
answer count: 0
upvote count: 3
type: Question
score: 3
has body: Old code uses deprecated ExtJs version (version 4.x). New code should use ExtJs 5.x I try to load ExtJs 5 on the same page where ExtJs 4 has been already loaded and used by some other JavaScript code. I want to hide ExtJs 5 from the rest of the code. Something like: define(["../../extjs-5.0.1/ext-all.js"], function (extjs) { //TODO use the "extjs" as link to Ext js global variable }); ExtJs is not implemented as AMD module, so I cannot load it as described in the previous example. Can you please give me a workaround of the issue? Can I use some AMD-wrapper, that is a module itself, and returns "Ext" js variable that is defined in an ext-all.js file. Is there a way to reuse script that was written as regular JavaScript file (like ExtJs) as AMD - module? UPDATED: I've read about shim section of RequireJS, here is what I try to do: On a html page: &lt;script data-main="../js/configuration/skin/app" src="../requirejs/require-2.1.17.js"&gt;&lt;/script&gt; app.js file: requirejs.config({ baseUrl: '../js', paths: { app: 'configuration/skin', extjs5: '../extjs-5.0.1/ext-all' }, shim: { 'extjs5': { exports: 'Ext' } } }); requirejs(['app/main']); main.js file: define(['extjs5'], function (extjs5) { //extjs5 is not nullable, it points to Ext variable // but Ext.getVersion() points to version 5 }); The problem now, the global Ext variable points to version 5. It may be a problem. I want global Ext js variable is not changed. When I remove all extjs version 5 related steps, app.js: requirejs.config({ baseUrl: '../js', paths: { app: 'configuration/skin' } }); requirejs(['app/main']); main.js: define(function () { // here I test Ext.getVersion() it points to version 4, not 5, as expected }); In the last method Ext.getVersion() - refers to version 4 which is loaded as default for the page. How to use in my module ExtJs 5, and don't touch existing global Ext (version 4)?
tagged with: javascript
downvote count: 0
favorite count: 0
tagged with: extjs
type: UnansweredQuestion
tagged with: requirejs
tagged with: module
has title: A way to load different versions of ExtJs via RequireJS (AMD)
tagged with: js-amd

http://stackoverflow.com/a/29818002
has body: you need to add the i variable to the .attr("x", function(d) { return x(d.step); }), like so: .attr("x", function(d, i) { return x.rangeRoundBands() * i; }), so it will go through the bars and place them one after the other (this might need some tweaking, can't do it properly without a jsfiddle) but should at least get you on the path of fixing it without issues
has comment: http://stackoverflow.com/comment/47763527
has comment: http://stackoverflow.com/comment/47764227
has comment: http://stackoverflow.com/comment/47765394
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47763105
has comment: http://stackoverflow.com/comment/47763434
type: Answer
has comment: http://stackoverflow.com/comment/47763970
score: 2
has comment: http://stackoverflow.com/comment/47766063
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29817787
answers question: http://stackoverflow.com/q/29817787

http://stackoverflow.com/a/29819525
downvote count: 0
has comment: http://stackoverflow.com/comment/47765755
has comment: http://stackoverflow.com/comment/47768234
type: Answer
has comment: http://stackoverflow.com/comment/47765991
score: 1
has comment: http://stackoverflow.com/comment/54182954
has body: yes! you can. Don't add the UI content which has dependency on the actions taken from the popup. Steps: Create a popup in onInit function of your fullscreen view controller. Based on the action(s) create and add the content to your view. Note: UI rendering using js view would be slower compared to rendering via XML views
upvote count: 1
answers question: http://stackoverflow.com/q/29819286
has comment: http://stackoverflow.com/comment/47765943

http://stackoverflow.com/comment/47808188
type: Comment
comment on: http://stackoverflow.com/a/29840929
score: 0
type: AnswerComment
has text: because i will change the fill color in some other time.. if we use u r code each and every time i need to append

http://stackoverflow.com/q/29770476
has title: ng-click does nothing, DOM notices a click
accepted answer: http://stackoverflow.com/a/29770520
has answer: http://stackoverflow.com/a/29770639
tagged with: javascript
answer count: 3
tagged with: angularjs
has body: Trying to set up a simple ng-click event, and reading through other pages about it. It seems like as long as it is added to $scope it should work, but of the two examples I have put in the below page nothing works (except the preventDefault()). ng-click test Full-screen Click Me And the controller var DBFScube = angular.module("DBFScube", ['ngSanitize']); DBFScube.controller("AppCtrl", function ($sce, $scope, $http, $filter){ var app = this; // //$http.get("http://localhost:3000").success(function(CubeSides){ // app.CubeSides = CubeSides; //}) $http.get("http://localhost:3000").success(function(CubeSides){ $scope.sides=CubeSides; console.log("Loading data"); }) app.getmenuname = function(side) { if($scope.sides === undefined) { console.log("Not loaded fside " + side ); } else { console.log("Got menu pane " + $scope.sides); var fside = $filter('filter')($scope.sides, function (d) {return d.side === side;})[0]; console.log("Sending: " + fside.menuname); return fside.menuname; } } $scope.alert = function(message) { alert(message); } $scope.growpane = function (side) { console.log("You pressed the button, like " + side); } app.showpane = function (side) { console.log("Loading side: " + side); if($scope.sides === undefined) { console.log("Not loaded yet"); } else { console.log("Got page " + $scope.sides); var fside = $filter('filter')($scope.sides, function (d) {return d.side === side;})[0]; var culine = ' '; console.log(culine); return $sce.trustAsHtml(culine); } } })
has answer: http://stackoverflow.com/a/29770520
has answer: http://stackoverflow.com/a/29770556
type: AnsweredQuestion
score: 0
possible better answer: http://stackoverflow.com/a/29770556
type: Question

http://stackoverflow.com/comment/47705541
comment on: http://stackoverflow.com/q/29784423
score: 0
has text: What? It doesn't work but it works?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47751031
score: 0
comment on: http://stackoverflow.com/q/29811431
type: QuestionComment
type: Comment
has text: Do you realize that your LI `Seafood` does not works currently? THat's cause your table ID does not ends in `"s"`. Currently it's ID is `id="seafood"` instead of `id="seafoods"`

http://stackoverflow.com/comment/47638532
score: 0
type: QuestionComment
has text: What's `print_frame`? Also, if you're already using jQuery, why appending the `hideImg` class yourself, why not call `addClass('hideImg')`?
type: Comment
comment on: http://stackoverflow.com/q/29753151

http://stackoverflow.com/a/29738113
has comment: http://stackoverflow.com/comment/47609594
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29738068
upvote count: 2
answers question: http://stackoverflow.com/q/29738068
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47609426
has comment: http://stackoverflow.com/comment/47609364
has body: For the data you've provided: var arr = { a: [[20,15],[25,17],[10,45]], b: [[10,33],[12,2],[14,9],[72,103],[88,12]], c: [[2,2],[41,21]], d: [[0,0],[21,2],[44,44],[19,99],[1,1],[100,100]], e: [[1,1], f: [[3,40],[41,86]] } The first structure you want, a keyed array, isn't an array in JavaScript - it's an object. Objects contain key-value pairs. In this case, the values are arrays, and the objects in those arrays are themselves arrays. An important thing to note here if you're coming from another language that defines 'regular' multi-dimensional arrays is that there is no expectation or guarantee that the 'rows' of this structure are all the same length.
has comment: http://stackoverflow.com/comment/47609607
has comment: http://stackoverflow.com/comment/47609445

http://stackoverflow.com/a/29915743
downvote count: 0
has comment: http://stackoverflow.com/comment/113256274
has body: See crbug.com/481856 on the Chrome issue tracker: new Notification() is on the path to deprecation, because it implicitly assumes that the page will outlive the notification, which is very unlikely on mobile (and far from guaranteed on desktop too). Hence we will never implement it on Android. We might one day remove it on desktop too, after a deprecation period. Websites should use ServiceWorkerRegistration.showNotification() (see spec) instead whenever it is available. The best way I can think of to feature-detect new Notification() is to try it (before you have permission) and catch the error: function isNewNotificationSupported() { if (!window.Notification || !Notification.requestPermission) return false; if (Notification.permission == 'granted') throw new Error('You must only call this *before* calling Notification.requestPermission(), otherwise this feature detect would bug the user with an actual notification!'); try { new Notification(''); } catch (e) { if (e.name == 'TypeError') return false; } return true; } You could then use it like this: if (window.Notification &amp;&amp; Notification.permission == 'granted') { // We would only have prompted the user for permission if new // Notification was supported (see below), so assume it is supported. doStuffThatUsesNewNotification(); } else if (isNewNotificationSupported()) { // new Notification is supported, so prompt the user for permission. showOptInUIForNotifications(); }
upvote count: 31
answers question: http://stackoverflow.com/q/29774836
type: Answer
score: 31

http://stackoverflow.com/q/29734848
tagged with: javascript
has answer: http://stackoverflow.com/a/29735250
downvote count: 0
score: 1
favorite count: 0
type: UnansweredQuestion
has body: Write a program that asks a user to enter three numbers. If all three entries are numbers then output the sum of all combinations of pairs of numbers from the three entries. The code that performs the addition and outputs the result for each pair should be in a function and is called from the main function. Output the answers in an HTML table. The table and its end tag should be added to the HTML page. The table rows will be inserted with the program. I can get the program to mostly work, but it's not outputting the numbers and sums as part of the table, and I'm not sure where/what I'm missing? //function to output sum of number1 and number2 function outputSumOfnumber1Andnumber2(number1, number2) { var output; sum1and2 = number1 + number2; output = document.getElementById('outputPart2'); output.innerHTML += " " + number1 + " " + number2 + " " + sum1and2 + " "; } function outputSumofnumber2Andnumber3(number2, number3) { var output; sum2and3 = number2 + number3; output = document.getElementById('outputPart2'); output.innerHTML += " " + number2 + " " + number3 + " " + sum2and3 + " "; } function outputSumofnumber1Andnumber3(number1, number3) { var output; sum1and3 = number1 + number3; output = document.getElementById('outputPart2'); output.innerHTML += " " + number1 + " " + number3 + " " + sum1and3 + " "; } function exercise3Part2() { // PART 2: YOUR CODE STARTS AFTER THIS LINE var number1; var number2; var number3; var output; var tableRows; number1 = Number(prompt("Enter a number:")); number2 = Number(prompt("Enter another number:")); number3 = Number(prompt("Enter one more number:")); output = document.getElementById('outputPart2'); output.innerHTML = " Pair part 1 Pair part 2 Sum "; outputSumOfnumber1Andnumber2(number1, number2); outputSumofnumber2Andnumber3(number2, number3); outputSumofnumber1Andnumber3(number1, number3); } Attempt 2-- //function to output sum of numbers function outputSumOfnumbers(number1, number2, number3, rows) { var output; var rows; sum1and2 …
has title: User enters 2 numbers, output numbers and sums in table. Outputting, but not in table?
upvote count: 1
has answer: http://stackoverflow.com/a/29736110
type: Question
has comment: http://stackoverflow.com/comment/47603556
tagged with: html-table
answer count: 2
tagged with: function

http://stackoverflow.com/q/29697165
has body: So I've been looking at this for way too long. Really hope someone could help me out :) I'm just trying to create a module that creates a directive and controller for my site header in AngularJS. I don't get any error and the log in my code won't show up. This is the code related to the header module: header/header.js 'use strict'; angular.module('myApp.header', []) .directive("headerBar", [function(){ return { restric: "E", templateUrl: "header/header.html", controller: 'HeaderCtrl' }; }]) .controller('HeaderCtrl', ['$log', function($log) { $log.log('test header controller'); }]); app.js angular.module('myApp', [ 'ngRoute', 'myApp.header' ]). config(['$routeProvider', function($routeProvider) { $routeProvider.otherwise({redirectTo: '/'}); }]); index.html &lt;script src="header/header.js"&gt;&lt;/script&gt; &lt;header-bar&gt;&lt;/header-bar&gt;
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29698345
type: Question
has comment: http://stackoverflow.com/comment/47530526
has answer: http://stackoverflow.com/a/29697312
accepted answer: http://stackoverflow.com/a/29697312
has comment: http://stackoverflow.com/comment/47530419
tagged with: javascript
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/29697291
has title: AngularJS module doesn't work
tagged with: web
tagged with: module
has answer: http://stackoverflow.com/a/29697291
tagged with: angularjs

javascript-objects
tags question: http://stackoverflow.com/q/29787573
tags question: http://stackoverflow.com/q/29733456
tags question: http://stackoverflow.com/q/29728169
type: Tag
tag name: javascript-objects

http://stackoverflow.com/a/45448802
has comment: http://stackoverflow.com/comment/85334205
has comment: http://stackoverflow.com/comment/78741749
has comment: http://stackoverflow.com/comment/96372033
downvote count: 2
has comment: http://stackoverflow.com/comment/100427972
has comment: http://stackoverflow.com/comment/92272508
has comment: http://stackoverflow.com/comment/90622630
answers question: http://stackoverflow.com/q/29810914
type: Answer
has comment: http://stackoverflow.com/comment/83923337
has comment: http://stackoverflow.com/comment/85337314
score: 215
has body: There are nice answers here, and i agree with @Austin Greco (the second option with separate components) There is another way i like, currying. What you can do is create a function that accept a parameter (your parameter) and returns another function that accepts another parameter (the click event in this case). then you are free to do with it what ever you want. ES5: handleChange(param) { // param is the argument you passed to the function return function (e) { // e is the event object that returned }; } ES6: handleChange = param => e => { // param is the argument you passed to the function // e is the event object that returned }; And you will use it this way: Here is a full example of such usage: const someArr = ["A", "B", "C", "D"]; class App extends React.Component { state = { valueA: "", valueB: "some initial value", valueC: "", valueD: "blah blah" }; handleChange = param => e => { const nextValue = e.target.value; this.setState({ ["value" + param]: nextValue }); }; render() { return ( {someArr.map(obj => { return ( {`input ${obj} `} ); })} ); } } const rootElement = document.getElementById("root"); ReactDOM.render(<App />, rootElement); Note that this approach doesn't solve the creation of a new instance on each render. I like this approach over the other inline handlers as this one is more concise and readable in my opinion. Edit: As suggested in the comments below, you can cache / memoize the result of the function. Here is a naive implementation: let memo = {}; const someArr = ["A", "B", "C", "D"]; class App extends React.Component { state = { valueA: "", valueB: "some initial value", valueC: "", valueD: "blah blah" }; handleChange = param => { const handler = e => { const nextValue = e.target.value; this.setState({ ["value" + param]: nextValue }); } if (!memo[param]) { memo[param] = e => handler(e) } return memo[param] }; render() { return ( {someArr.map(obj => { return ( {`input ${obj} `} ); })} ); } } const rootElement = document.getElementById("root");…
has comment: http://stackoverflow.com/comment/117306854
has comment: http://stackoverflow.com/comment/96376907
upvote count: 217

http://stackoverflow.com/comment/47784302
type: Comment
type: QuestionComment
has text: I was trying to clean it up but some of it was generated by php. I will try again
score: 0
comment on: http://stackoverflow.com/q/29828831

http://stackoverflow.com/q/29712051
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29712878
downvote count: 1
has answer: http://stackoverflow.com/a/37679430
type: Question
upvote count: 4
answer count: 2
has body: How do I properly send JSON data over Http Post on NodeJS? I have checked that the data I'm sending is definitely JSON but every time I try sending over http post, it would receive an error. I cant exactly see the error as it's returning from terminal and even if I output, it's too messy, not properly formatted var options = { hostname: 'www.postcatcher.in', port: 80, path: '/catchers/5531b7faacde130300002495', method: 'POST', headers: { 'Content-Type': 'application/json', } }; var req = http.request(options, function(res) { console.log('Status: ' + res.statusCode); console.log('Headers: ' + JSON.stringify(res.headers)); res.setEncoding('utf8'); res.on('data', function (body) { console.log('Body: ' + body); fs.writeFile("/var/www/node/test.txt", body, function(err) { if(err) { return console.log(err); } console.log("The file was saved!"); }); }); }); req.on('error', function(e) { console.log('problem with request: ' + e.message); }); // write data to request body req.write('{"string": result}'); ///RESULT HERE IS A JSON req.end(); Also tried this // request.post( // '', // { form: { key: result } }, // function (error, response, body) { // if (!error &amp;&amp; response.statusCode == 200) { // console.log(body); // } // } // ); // console.log(result);
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/37679430
has comment: http://stackoverflow.com/comment/47563833
has title: NodeJS Http Post JSON Data
accepted answer: http://stackoverflow.com/a/29712878
has comment: http://stackoverflow.com/comment/47563746
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47563782
tagged with: node.js
type: AnsweredQuestion
score: 3

http://stackoverflow.com/q/29840912
type: Question
tagged with: closures
tagged with: javascript
tagged with: jquery
tagged with: callback
has title: JavaScript Closure Callback Itself
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47808209
has answer: http://stackoverflow.com/a/29841086
favorite count: 0
has comment: http://stackoverflow.com/comment/47808048
accepted answer: http://stackoverflow.com/a/29841086
has body: Here is the closure I wrote: var slider = (function(){ var count = 3; return function(){ if (count&gt;0) { $("#message").html("&lt;h1&gt;"+count+"&lt;/h1&gt;"); count--; $("#message").removeClass("animated zoomIn"); $("#message").addClass("animated zoomIn"); $("#message").one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", function(){ return slider(); }()); } else{ showCube(); } }() }); This closure gets executed by a jquery plugin: $("#fishes").addClass("animated slideOutLeft").one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", slider()); However, the callback is not getting executed. Can someone guide me in the correct direction please?
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47808285
score: 1

http://stackoverflow.com/comment/57674451
score: 9
type: AnswerComment
has text: since version 0.20.0, we should use `.getSourceData()` to get object, instead of `.getData`, details in [github issue](https://github.com/handsontable/handsontable/issues/2982)
type: Comment
comment on: http://stackoverflow.com/a/29839821

http://stackoverflow.com/q/29689592
has comment: http://stackoverflow.com/comment/47887355
type: Question
tagged with: aurelia
has body: I have the following subscriber (in aSubscriber.js): import {EventAggregator} from 'aurelia-event-aggregator'; export class Subscriber{ static inject = [EventAggregator]; constructor(eventAggregator){ this.eventAggregator = eventAggregator; } subscribe(){ this.eventAggregator.subscribe('myPublishChannelName', payload =&gt; { //do something with the payload here alert('got the message that has been published'); }); } } And in my class to register the subscriber I have: import {inject} from 'aurelia-framework'; import {subscriber} from './aSubscriber'; @inject(subscriber) export class Welcome{ constructor(subscriber){ // this.subscriber = subscriber; // this.subscriber.subscribe(); } } In the constructor subscriber is undefined. Why is this happening?
tagged with: javascript
has title: Subscriber is null when injected in Aurelia class?
answer count: 1
has answer: http://stackoverflow.com/a/29690089
tagged with: node.js
type: AnsweredQuestion
score: 0
accepted answer: http://stackoverflow.com/a/29690089

http://stackoverflow.com/comment/47715753
has text: thanks for sharing this library, I am going to select this as an answer because lot of requirements that we have right now are around date and time and this library will be good asset for the project, thanks
type: AnswerComment
comment on: http://stackoverflow.com/a/29793181
score: 0
type: Comment

http://stackoverflow.com/a/29847089
answers question: http://stackoverflow.com/q/29842672
has comment: http://stackoverflow.com/comment/47907803
has comment: http://stackoverflow.com/comment/47908094
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/47906740
score: 2
has comment: http://stackoverflow.com/comment/47906533
has body: Try plumber var plumber = require('gulp-plumber'); /** * Helper function to amend the pipe when a build task fails * see https://github.com/hughsk/vinyl-transform/issues/1 * and: https://github.com/gulpjs/gulp/issues/259 * @param {string} err the error string */ function onError (err) { gutil.beep(); console.log(err); this.emit('end'); } return gulp.src('app/assets/react/app.react.js') .pipe(plumber({ errorHandler: onError })) .pipe(babel()); Also gulp-browserify is blacklisted. You can follow this tutorial for a more gulpy setup: https://medium.com/@sogko/gulp-browserify-the-gulp-y-way-bb359b3f9623
downvote count: 0

http://stackoverflow.com/a/31364552
downvote count: 0
type: Answer
score: 2
has body: Iron Router runs on both the client and the server, so make sure the route is defined in both places, i.e. some not under /client or /server folders. See docs.
answers question: http://stackoverflow.com/q/29692261
upvote count: 2

http://stackoverflow.com/comment/47733039
has text: I have a path string, and query parameters object (key/value pairs). I want to build url from both and set the new url in one step. (since I doubt it is recommended to call $location.path and $location.search sequentially, if even possible, since it would introduce additional intermediate state)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29788428
score: 0

http://stackoverflow.com/comment/47788273
has text: @EricJ. I've added that question here: http://stackoverflow.com/questions/29830272/how-to-guarantee-the-jquery-is-initialized
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29785931

http://stackoverflow.com/q/29833560
type: UnansweredQuestion
has title: How do I increment a PFUser score that is not currentUser with MasterKey?
has body: I am working on a simple iOS game using parse.com as my backend. I would like to increment the scores of all PFUsers playing a game when the game ends, NOT just currentUser. I call my cloud code using objective c as follows. (objects is an array which contains all the users in the game) for (PFObject *object in objects){ int count = 100; NSNumber *addToScore = [NSNumber numberWithInt:count]; [PFCloud callFunction:@"incrementUserScore" withParameters:@{ @"userId":object.objectId, @"baseNumber":addToScore }]; } The cloud code itself is given below Parse.Cloud.define('incrementUserScore', function(request, response) { var userId = request.params.userId, addToScore = request.params.baseNumber, User = Parse.Object.extend('_User'), user = new User({ objectId: userId }); user.increment("score",addToScore); Parse.Cloud.useMasterKey(); user.save().then(function(user) { response.success(user); }, function(error) { response.error(error) }); }); My game crashes when the cloud code is called. I am a beginner programer and have not used javascript much at all. Does anybody see anything obviously wrong?
type: Question
tagged with: ios
tagged with: javascript
has answer: http://stackoverflow.com/a/29833653
tagged with: parse-cloud-code
score: 0
answer count: 1
tagged with: parse-platform

http://stackoverflow.com/comment/47735712
score: 0
type: Comment
has text: it should be `purchase.pickUpLocationId`
comment on: http://stackoverflow.com/a/29803885
type: AnswerComment

http://stackoverflow.com/q/29793089
has body: I am trying to validate PO box with all the conditions satisfied in JavaScript But it is not working for me. its not matching any of the case below is the reg expression that i used function validatestreetAddress(street){ var streetval=street.value; var pattern =new RegExp('/^ *((#\d+)|((box|bin)[-. \/\\]?\d+)|(.*p[ \.]? ?(o|0)[-. \/\\]? *-?((box|bin)|b|(#|num)?\d+))|(p(ost)? *(o(ff(ice)?)?)? *((box|bin)|b)? *\d+)|(p *-?\/?(o)? *-?box)|post office box|((box|bin)|b) *(number|num|#)? *\d+|(num|number|#) *\d+)/i'); if (streetval.match(pattern)) { alert('We are unable to ship to a Post Office Box.\nPlease provide a different shipping address.'); } only one reg exp works for me, but it is not satisfying all the conditions for PO box validation. var pattern = new RegExp("\\b[P|p]*(OST|ost)*\\.*\\s*[O|o|0]*(ffice|FFICE)*\\.*\\s*[B|b][O|o|0][X|x]\\b"); could any one please suggest what is wrong in reg ex. I want to match "Box 123", "Box-122", "Box122", "HC73 P.O. Box 217", "P O Box125", "P. O. Box", "P.O 123", "P.O. Box 123", "P.O. Box", "P.O.B 123", "P.O.B. 123", "P.O.B.", "POB 123", "POB", "POBOX123", "Po Box", "Post 123", "Post Box 123", "Post Office Box 123", "Post Office Box", "box #123", "box 122", "box 123", "number 123", "p box", "p-o box", post office box – user3495160 3 hours ago don't match = [ "The Postal Road", "Box Hill", "123 Some Street", "Controller's Office", "pollo St.", "123 box canyon rd", "777 Post Oak Blvd", "PSC 477 Box 396", "RR 1 Box 1020" ];
upvote count: 3
has title: PO box validation in javascript
has comment: http://stackoverflow.com/comment/47714844
type: Question
score: 3
tagged with: javascript
has comment: http://stackoverflow.com/comment/47715093
tagged with: validation
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/29794711
favorite count: 0
tagged with: pattern-matching
has comment: http://stackoverflow.com/comment/47714950
type: UnansweredQuestion
tagged with: regex

http://stackoverflow.com/q/29786025
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/47748452
has comment: http://stackoverflow.com/comment/47701982
has comment: http://stackoverflow.com/comment/47701876
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47702132
has body: I have a dynamic list of cities, and each country has its own dynamic list of cities. Now I'm checking the postal code column with Javascript and I am trying to create a function that will do the next search, when I choose Netherlands, it lets me use other characters in the postalcode, but until now I don't see any success. Can someone tell me what I am doing wrong? HTML: Your Postalcode Javascript: function postcode(code, holland) { var code = document.getElementById(code); var holland = document.getElementById(holland); var dcount=0; var charcount=0; var jcount=0; if (holland.value == "netherland") { for (var i = 0; i <= code.length; i++){ if (code.value.charAt(i) >= '0' && code.value.charAt(i) <= '9') dcount++; else if (code.value.charAt(i) >= 'a' && code.value.charAt(i) <= 'z') charcount++; else if (code.value.charAt(i) >= 'A' && code.value.charAt(i) <= 'Z') charcount++; else jcount++; } if (jcount!=0) alert("This symbol is not allowed"); else alert("holland is good"); } if (holland.value != "netherland") { for (var i = 0; i <= code.length; i++) { if (code.value.charAt(i) >= '0' && code.value.charAt(i) <= '9') dcount++; else jcount++; } if (jcount!=0) alert("use only digits"); else alert("regular postalcode is work fine"); } }
has comment: http://stackoverflow.com/comment/47702288
has answer: http://stackoverflow.com/a/29786576
has comment: http://stackoverflow.com/comment/47702255
has comment: http://stackoverflow.com/comment/47749257
type: Question
has comment: http://stackoverflow.com/comment/47702766
tagged with: javascript
has comment: http://stackoverflow.com/comment/47702325
has title: can i make dynamic list of countries and cities in javascript+html
score: 0

http://stackoverflow.com/comment/47543365
has text: I believe it's not working as you have for example two divs with id of "collapseOne", "collapseTwo" etc. Make sure all elements have unique id's.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29703554
type: Comment

http://stackoverflow.com/q/29708584
favorite count: 0
has answer: http://stackoverflow.com/a/29708782
has body: I have a treeview structure created with css and jquery. To expand a node I want the user to click on a within the (it's an image) and not on the node itself. So here is my HTML part : Level 1 Level 2 Level 2 Level 2 Level 2 Level 1 Level 2 Level 3 Level 4 Level 2 Here's the JS part for the clikc event on span (but it doesn't work) : $( '.tree li.parent > span.expand' ).click( function( ) { $( this ).parent().toggleClass( 'active' ); $( this ).parent().children( 'ul' ).slideToggle( 'fast' ); }); However, the following code works but by clicking on the within the : $( '.tree li.parent > a' ).click( function( ) { $( this ).parent().toggleClass( 'active' ); $( this ).parent().children( 'ul' ).slideToggle( 'fast' ); }); I need to expand the nodes by clicking on the span because when clicking on the node I need to redirect to another page to display its details. Please see this jsfiddle that a created for this question. So why the click event on span does not work ?
has answer: http://stackoverflow.com/a/29708675
has answer: http://stackoverflow.com/a/29708667
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29708744
answer count: 4
score: 2
type: AnsweredQuestion
has title: span onclick does not work jquery
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29708744
has comment: http://stackoverflow.com/comment/47553055
upvote count: 2
accepted answer: http://stackoverflow.com/a/29708675
downvote count: 0

http://stackoverflow.com/a/29696569
type: Answer
has body: Within all the generators you can try angular-fullstack to create my MEAN project structure , reasons: 1.Easy to install Creates both client and server scaffoldings Introduces good practices in the generated code Server side API prepared to use authentication Support HTML or jade templating on client side Support for different CSS preprocessors Commands to scaffold anything Detailed definition is here
answers question: http://stackoverflow.com/q/29696439
has comment: http://stackoverflow.com/comment/47613765
has comment: http://stackoverflow.com/comment/47612520
score: 0

http://stackoverflow.com/comment/47598067
comment on: http://stackoverflow.com/a/29732263
has text: JavaScript cannot count rows in the database, as I have already said. It can count rows in HTML (e.g. how many ` ` blocks you have rendered).
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29810036
has body: The fiddle works because jQuery is included. You forgot to include jQuery on your localhost Code. Try this: the rest of your html...
score: 1
upvote count: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29809982

http://stackoverflow.com/comment/47569546
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29717261
has text: Here is a great tutorial for the same, http://www.webblogsforyou.com/check-or-uncheck-all-checkboxes-in-asp-net-gridview-using-jquery/

http://stackoverflow.com/comment/47658203
score: 0
comment on: http://stackoverflow.com/q/29763281
has text: use `append()` function
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29690282
has body: i just want to add a js library -- lodash var _ = require('lodash'); var array1 = [1,2,3,4,5]; var array2 = [3,1,5]; _.difference(array1,array2) // returns [ 2, 4 ]
downvote count: 0
answers question: http://stackoverflow.com/q/29689987
has comment: http://stackoverflow.com/comment/47517291
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47517216

http://stackoverflow.com/q/29796894
has comment: http://stackoverflow.com/comment/47722372
score: 1
type: Question
tagged with: pie-chart
upvote count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47723463
answer count: 0
has title: D3 piecharts: arcs get not removed
linked to: http://stackoverflow.com/q/22173124
tagged with: d3.js
has body: I am trying to implement a pie chart based on the blog entry here: http://bl.ocks.org/mbostock/3887235 I want to enhance the described pie chart by updating the arcs. My code looks like this: &lt;!DOCTYPE html&gt; &lt;meta charset="utf-8"&gt; &lt;style&gt; body { font: 10px sans-serif; } .arc path { stroke: #fff; } &lt;/style&gt; &lt;body&gt; &lt;script src="http://d3js.org/d3.v3.min.js"&gt;&lt;/script&gt; &lt;script&gt; var width = 960, height = 500, radius = Math.min(width, height) / 2; var color = d3.scale.ordinal().range([ "#98abc5", "#8a89a6", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00" ]); var arc = d3.svg.arc().outerRadius(radius - 10).innerRadius(0); var pie = d3.layout.pie().sort(null).value(function(d) { return d.population; }); var svg = d3.select("body").append("svg").attr("width", width).attr("height", height).append("g").attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); var draw = function(data) { var g = svg.selectAll(".arc").data(pie(data)); g.each(function(d, i) { var tmp = d3.select(this); console.log(tmp); tmp.select("path").attr("d", arc).attr("fill", function(d) { return color(d.data.age); }); tmp.select("text").attr("transform", function(d) { return "translate(" + arc.centroid(d) + ")"; }).attr("dy", ".35em").style("text-anchor", "middle").text(function(d) { return d.data.age; }); }); g.enter().append("g").attr("class", "arc"); g.append("path").attr("d", arc).style("fill", function(d) { return color(d.data.age); }); g.append("text").attr("transform", function(d) { return "translate(" + arc.centroid(d) + ")"; }).attr("dy", ".35em").style("text-anchor", "middle").text(function(d) { return d.data.age; }); g.exit().remove(); } var startTimer = function startTimer() { setTimeout(function() { var data = []; data.push({ population : (Math.random() * 100), age : "A" }); data.push({ population : (Math.random() * 100), age : "B" }); data.push({ population : (Math.random() * 100), age : "C" }); data.forEach(function(d) { d.po…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47724599

http://stackoverflow.com/q/29803100
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/31013776
tagged with: http://stackoverflow.com/tag/pdf
answer count: 1
has title: How to open a local PDF in a Windows 8/Cordova app?
linked to: http://stackoverflow.com/q/28233531
tagged with: cordova
upvote count: 3
type: AnsweredQuestion
score: 3
tagged with: windows-8
has answer: http://stackoverflow.com/a/31013776
type: Question
linked to: http://stackoverflow.com/q/12171444
has body: I have an IOS app that I built which now I've been tasked to port over to Windows 8 for use on the Windows tablet. My app downloads files from Dropbox, which gets stored in the Local folder. I can see all of that works fine. I am able to reference images by using ms-appdata:///local/" + filename in the src of my img tag, and I'm even able to play mp4s from the same folder using HTML5 video tags. My problem is, for my IOS version, I was using Cordova's InAppBrowser to open local PDFs but on this Windows 8 version, it doesn't work. I am using the following code (filename equals [1]CaseStudy-AC_EN_04.pdf and it does exist on the file system): var ref = window.open("ms-appdata:///local/" + filename, '_blank', 'location=no'); And I get the following error in Visual Studio when I run the Simulator APPHOST9607: The app can't launch the URI at ms-appdata:///local/[1]CaseStudy-AC_EN_04.pdf because of this error: -2147024846. I've tried switching to WinJS coding methods, even tried loading the PDF in an iFrame but nothing will work. I don't mind kicking the user out to Internet Explorer if I must... I just need some way for the user to see these local PDFs. Is this a permissions issue? I only have a config.xml file and not a app manifest file, so perhaps I'm missing a setting? Does anyone have experience with this?
has comment: http://stackoverflow.com/comment/47969920
tagged with: winjs

http://stackoverflow.com/comment/47595985
score: 0
has text: Looking at the video he linked in the post it looks like what I want but I see that he shared how to do it... or did I miss it? Anybody else have a suggestion?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29730106

http://stackoverflow.com/q/29763137
accepted answer: http://stackoverflow.com/a/29768143
answer count: 1
tagged with: webbrowser-control
has answer: http://stackoverflow.com/a/29768143
type: AnsweredQuestion
score: 0
has title: Prevent webbrowser control loading javascript from certain domain
tagged with: fiddlercore
type: Question
tagged with: c#
tagged with: fiddler
has body: I'm loading a html page into a C# webbrowser object. There are links to some remote javascript files between script tags in the html page. One of them has a number of errors which I can't remedy as I can't change the javascript. As it's not needed, I'd rather disable it. I would like to stop the webbrowser loading any javascript from a particular domain or just have the browser be returned a '404' for that javascript file. This can be done in Fiddler with the Autoresponder. Is there any way to do this in C#? Like a mini-proxy forwarding all requests except those to *.domainwitherrors.com? Failing that, is there there a way to use Fiddler directly in C#? Trapping the 'Navigating' event in the webbrowser doesn't catch the javascript before it's loaded into the DOM. webBrowser1.Navigate("http://www.somedomain.com"); webBrowser1.Navigating += webBrowser1_Navigating; void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e) { if (e.Url.ToString().Contains("domainwitherrors")) { return; } }
tagged with: javascript

http://stackoverflow.com/a/29805669
has comment: http://stackoverflow.com/comment/59004939
has body: Alright, I could be way off here, but is this what you're trying to do? app.factory('myservice', function(){ return { ifBlock: function(){ // code to run if condition is true }, elseBlock: function(){ // code to run if condition is false } } }); app.controller('main', function(myservice){ $scope.myevent = function(geoLocation){ if(condition){ myservice.ifBlock(geoLocation); } else { myservice.elseBlock(geoLocation); } } }); You could also solve this problem like this (and if I understand your problem correctly, this is probably the preferred method): app.service('myservice', function(){ return { go: function(geoLocation){ if(condition){ // code to run if condition is true } else { // code to run if condition is false } } } }); app.controller('main', function(myservice){ $scope.myevent = function(geoLocation){ myservice.go(goeLocation); } });
downvote count: 0
has comment: http://stackoverflow.com/comment/47743478
has comment: http://stackoverflow.com/comment/47740309
score: 1
has comment: http://stackoverflow.com/comment/47743115
has comment: http://stackoverflow.com/comment/47740219
answers question: http://stackoverflow.com/q/29801002
type: Answer
has comment: http://stackoverflow.com/comment/47740204
has comment: http://stackoverflow.com/comment/47744217
has comment: http://stackoverflow.com/comment/47743279
upvote count: 1
has comment: http://stackoverflow.com/comment/47743861
has comment: http://stackoverflow.com/comment/47744157

http://stackoverflow.com/q/29775702
has answer: http://stackoverflow.com/a/29778612
downvote count: 1
type: AnsweredQuestion
score: 3
has title: clickable sidebar markerclusterer google map api v.3
tagged with: sidebar
tagged with: markerclusterer
type: Question
upvote count: 4
accepted answer: http://stackoverflow.com/a/29778612
tagged with: google-maps
answer count: 1
has body: Google map API v.3 is used. Attached with markerclusterer.js I would like to make a map that show the cluster of markers. (Done!) When I click on the marker, an infowindow would be shown. (Done!) A sidebar is made next to the map. When click on it, an infowindow would be shown for relevant marker. (Failed, why?) Please help me take a look at the code of javascript and html. var hk_markers = [ { 'id':1, 'name':'Sanrio Puroland(サンリオピューロランド)', 'location':'Tokyo, Japan', 'lat':35.62464, 'lng':139.42916, }, { 'id':2, 'name':'Harmonyland(ハーモニーランド)', 'location':'Oita, Japan', 'lat':33.40162, 'lng':131.54657, }, { 'id':3, 'name':'Sanrio Hello Kitty Town', 'location':'Johor, Malaysia', 'lat':1.41385, 'lng':103.66031, }, { 'id':4, 'name':'China Hello Kitty Park(浙江安吉凯蒂猫家园)', 'location':'Zhejiang, China', 'lat':30.62377, 'lng':119.73663, }, { 'id':5, 'name':'Hello Kitty Go Green Organic Farm (Hello Kitty有機薈低碳農莊)', 'location':'near Kam Sheung Road MTR Station, West Rail Line, Yuen lng, the New Territories, Hong Kong', 'lat':22.43402, 'lng':114.06037, }, { 'id':6, 'name':'Jeju Hello Kitty Island - Museum & Cafe (헬로키티아일랜드)', 'location':'340, Hanchang-ro, Andeok-myeon, Seogwipo, Jeju-do, South Korea', 'lat':33.29021, 'lng':126.35205, }, { 'id':7, 'name':'Dubai Hello Kitty Beauty Spa (مرحبا كيتي الجمال سبا)', 'location':'Jumeirah town centre, Jumeirah Beach Road, Dubai, the United Arab Emirates', 'lat':25.21491, 'lng':55.25100, },]; var map; var myCentreLat = 22.3700556; var myCentreLng = 114.1535941; var initialZoom = 2; var markers = []; var markerCluster; var side_bar_html = ""; function showAll(){ var infowindow = new google.maps.InfoWindow(); for (var i = 0; i <hk_markers.length; i++) { var myPos = new google.maps.LatLng(hk_markers[i].lat,hk_markers[i].lng); var marker = new google.maps.Marker({ position: myPos, map: map }); var info = hk_markers[i].name; google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent(hk_markers[i…
tagged with: javascript
favorite count: 0
tagged with: google-maps-api-3

http://stackoverflow.com/a/46641236
type: Answer
has comment: http://stackoverflow.com/comment/117209961
score: 0
answers question: http://stackoverflow.com/q/29799696
has body: Safari 10.1+ supports "download" attribute. It should work now. https://github.com/eligrey/FileSaver.js/issues/129#issuecomment-275221240

http://stackoverflow.com/comment/47543999
comment on: http://stackoverflow.com/a/29699256
score: 0
type: AnswerComment
has text: Thank you for your continued efforts and for providing that link, it worked perfectly.
type: Comment

http://stackoverflow.com/q/29747023
favorite count: 0
has body: The problem I am encountering is that the black line is doing some funky stuff compared to the blue line. If you scroll in the middle or somewhere else (use bottom scroll tool), you can clearly see that the black line is changing its shape, while the blue line holds its shape, strange. This only happens when you use the scroll tool. How can I prevent the black line changing its shape? Copy this code and replace it with the JSfiddle to see the problem: $(function () { Highcharts.setOptions({ global : { useUTC : false } }); // Create the chart $('#container').highcharts('StockChart', { chart : { events : { load : function () { // set up the updating of the chart each second var series = this.series[0]; setInterval(function () { var x = (new Date()).getTime(), // current time y = Math.round(Math.random() * 100); series.addPoint([x, y], true, true); }, 1000); var series1 = this.series[1]; setInterval(function () { var x = (new Date()).getTime(), // current time y = Math.round(Math.random() * 100); series1.addPoint([x, y], true, true); }, 1000); } } }, rangeSelector: { buttons: [{ count: 1, type: 'minute', text: '1M' }, { count: 5, type: 'minute', text: '5M' }, { type: 'all', text: 'All' }], inputEnabled: false, selected: 0 }, title : { text : 'Live random data' }, exporting: { enabled: false }, series : [{ name : 'diagram1', data : (function () { // generate an array of random data var data1 = [], time = (new Date()).getTime(), i; for (i = -999; i &lt;= 0; i += 1) { data1.push([ time + i * 1000, Math.round(Math.random() * 100) ]); } return data1; }()) }, { name : 'diagram2', data : (function () { // generate an array of random data var data2 = [], time = (new Date()).getTime(), i; for (i = -999; i &lt;= 0; i += 1) { data2.push([ time + i * 1000, Math.round(Math.random() * 100) ]); } return data2; }()) }] }); }); The only thing I have done is to add an extra dynamic line (black one) to the diagram. Here is the original code without the black line. Review original code
upvote count: 3
type: AnsweredQuestion
score: 3
has title: Dynamic chart is not working properly (highcharts)?
type: Question
has answer: http://stackoverflow.com/a/29749067
accepted answer: http://stackoverflow.com/a/29749067
tagged with: highcharts
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/47819617
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29846561
has text: Its my pleasure. It is due to event handling.Jquery off() destroy all previously fired submit event in your case and releases a new event.Please upvote if really the answer was helpfull.
type: AnswerComment

http://stackoverflow.com/comment/47761806
comment on: http://stackoverflow.com/q/29817363
type: Comment
type: QuestionComment
has text: how about `localstorage`?? It's way better than `cookie` in this scenario!! or you can use **[Cookie plugin](http://plugins.jquery.com/cookie/)**
score: 0

http://stackoverflow.com/q/29694524
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29766516
has body: In one of detail pages i have table defined in xml: <core:View controllerName="myapp.view.personal.detail.created_tasks.createdtasks" xmlns="sap.m" xmlns:core="sap.ui.core" > <Text id="tFirst" text="{firstName}" /> <Text id="tLast" text="{lastName}" /> <Text id="tEmail" text="{email}" /> <Text id="tPerno" text="{persno}" /> <Text id="tGender" text="{gender}" /> </core:View> When i'm not biding data to the table, Master view is hiding and button is shown just like it is supposed to work. But when I bind data to the table like: onAfterRendering: function() { var oModel = new sap.ui.model.json.JSONModel("model/user_data.json"); var oTable = this.byId("users_table"); oTable.setModel(oModel); }, master view stops to work. Do you know what is the isue?
score: -1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47541578
tagged with: sapui5
downvote count: 1
type: Question
has title: SAPUI5 SplitApp Master view not hiding when adding model to SplitApp
has answer: http://stackoverflow.com/a/29766516
tagged with: javascript
has comment: http://stackoverflow.com/comment/47533108
upvote count: 0

http://stackoverflow.com/q/29806924
has answer: http://stackoverflow.com/a/29808791
has title: Chart.js render in hidden Bootsrap tab
downvote count: 0
tagged with: twitter-bootstrap
possible better answer: http://stackoverflow.com/a/59582423
type: Question
has comment: http://stackoverflow.com/comment/47741836
type: AnsweredQuestion
tagged with: chart.js
score: 7
tagged with: javascript
has comment: http://stackoverflow.com/comment/47742624
has body: this is driving me mad, I am using Chart.js in my bootstrap tabs but they will not render because the width is set to zero when the DOM is loaded. I finally found this out after trying and figuring out why my graph was not there! I've searched online and nothing seemed to fix my issue, can anybody please help me with this, I think I need some script that renders the graph when the tab is selected and succesfully loaded Im using this JS: var data = [ { value: 300, color:"#F7464A", highlight: "#FF5A5E", label: "Red" }, { value: 50, color: "#46BFBD", highlight: "#5AD3D1", label: "Green" }, { value: 100, color: "#FDB45C", highlight: "#FFC870", label: "Yellow" } ]; var options = { responsive : true, animation: true, }; var ctx1 = $("#invest-chart").get(0).getContext("2d"); var invest_chart; new Chart(ctx1).Doughnut(data, { responsive : true, animation: true, }); Along with this html piece in my tab: &lt;canvas id="invest-chart"&gt;&lt;/canvas&gt; Thanks guys!
answer count: 2
accepted answer: http://stackoverflow.com/a/29808791
upvote count: 7
has answer: http://stackoverflow.com/a/59582423
linked to: http://stackoverflow.com/q/29395853
favorite count: 0

http://stackoverflow.com/q/29689429
answer count: 1
has answer: http://stackoverflow.com/a/29887021
accepted answer: http://stackoverflow.com/a/29887021
favorite count: 0
has body: I've installed Django-CMS onto an existing site and while it isn't throwing errors, it isn't working. In particular, the header on a given page appears when I use "/?edit" but none of the pull down menus work, and very little (possibly none) of the JavaScript works. Other facets: I've done this on a local install of Django with largely development components (for example, SQLite, and the server provided via the django tutorial) I've done this with the same result on an install on WebFactional using MySQL and an apache server The install is basically the process described here: http://docs.django-cms.org/en/support-3.0.x/how_to/install.html The DB install worked w/out errors and the /admin site has a section for CMS The CMS check showed 1 test skipped, and all other tests passed. I'm using Django 1.6.5 This isn't the only time I've had trouble getting django to deliver javascript in a way that executes properly on a project - I had problems with fairly simple drop down menus in the past that I never resolved. Any ideas on what I could be doing wrong? My configuration changes could be seen here: https://github.com/bethlakshmi/GBE2/compare/GBE-398 The Local Settings (recent edit) DEBUG = True TEMPLATE_DEBUG = False ALLOWED_HOSTS = ['*domain of server*'] LOGIN_REDIRECT_URL = '/' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': '*db name*', 'USER': '*username*', 'PASSWORD': '*password*', 'HOST': '', 'PORT': '', } } STATIC_ROOT = '*path to the static host in the file system*' #STATIC_ROOT = '/' EMAIL_HOST = '* email settings*' EMAIL_HOST_USER = '*email settings*' EMAIL_HOST_PASSWORD = '*email settings*' DEFAULT_FROM_EMAIL = '*valid email*' SERVER_EMAIL = '*valid email*' domain of server - the site is hosted on a subdomain: - prototypecms.gbeadmin.webfactional.com, the Allowed Host is "gbeadmin.webfactional.com" db name, username, password - the correct settings for the locally hosted database. The website itself works just fine with these database …
has comment: http://stackoverflow.com/comment/47644032
has comment: http://stackoverflow.com/comment/47645310
tagged with: python
score: 11
has title: Django-cms installs, but pull-downs and other JS doesn't work - ideas for fixing?
has comment: http://stackoverflow.com/comment/47828430
has comment: http://stackoverflow.com/comment/47897839
type: AnsweredQuestion
tagged with: django-cms
downvote count: 0
type: Question
tagged with: javascript
upvote count: 11
tagged with: django-1.6
has comment: http://stackoverflow.com/comment/47582230
has comment: http://stackoverflow.com/comment/47558804

http://stackoverflow.com/comment/88042093
comment on: http://stackoverflow.com/a/35748912
type: AnswerComment
type: Comment
has text: @me-me Yes, and if you opt-in to bleeding edge JavaScript in Babel you should just declare properties on your class like `foo = () => {...}` and then reference in render `<button onClick={this.foo}...` the only reason to include an arrow function if you use babel in this way, IMO, is if you want to capture some variable that only exists in render() method scope (events can just be passed along and don't apply).
score: 1

http://stackoverflow.com/q/29713939
has body: I'm using ui-select plugin and I'm passing ng-model from my controller to a custom directive called richSelect but the ng-model doesn't seemed to get updated on select of any item. Custom directive app.directive('richselect', ['$compile', function ($compile) { return { restrict: 'AE', scope: { ngModel: '=' /* Model associated with the object */ }, link: function (scope, element, attrs, ngModel) { scope.options = [ { 'Value' : 'value1', 'Desc' : 'Value One' }, { 'Value' : 'value2', 'Desc' : 'Value Two' } ] scope.getRichSelectTemplate = function () { return ' ' + '{{ngModel}} {{$select.selected.Desc}} ' + ' ' + '' + ' ' + ' '; } var linkFn = $compile(scope.getRichSelectTemplate())(scope); element.append(linkFn); } } }]); Plnkr : http://plnkr.co/edit/Im8gpxEwnU7sgrKgqZXY?p=preview
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47563121
possible better answer: http://stackoverflow.com/a/29718458
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29718360
accepted answer: http://stackoverflow.com/a/29718360
type: Question
answer count: 2
has title: Unable to pass/update ngModel from controller to directive
has answer: http://stackoverflow.com/a/29718458
tagged with: javascript
has comment: http://stackoverflow.com/comment/47563228
score: 0

http://stackoverflow.com/a/29792789
score: 0
has body: Heat Map instance should be declared globally so that its accessible to javascrip function and values for Hea tMap can be changed.
answers question: http://stackoverflow.com/q/29764857
type: Answer

http://stackoverflow.com/comment/47699444
type: Comment
comment on: http://stackoverflow.com/a/29784773
score: 0
has text: I know it's ugly to use the $parent.$parent.$parent. The inner developer of myself, tells me that this is crap and there should be something simpler. I don't think the `scope.$parent.$parent.$parent` is different for the two modals because they're in the same file. I'll try to fix stuff and be back to you.
type: AnswerComment

http://stackoverflow.com/q/29731757
upvote count: 1
downvote count: 1
type: Question
has body: i want to add a class to a tag using jquery based on a if condition the code is if ($(".asp:contains('Home')")) { $("ul.nav-pills a:contains('Home')"). parent().addClass('active'); } else if ($(".asp:contains('List')")) { $("ul.nav-pills a:contains('List')"). parent().addClass('active'); } am i doing it right?
tagged with: javascript
has comment: http://stackoverflow.com/comment/47596702
accepted answer: http://stackoverflow.com/a/29731801
has comment: http://stackoverflow.com/comment/47596688
score: 0
has comment: http://stackoverflow.com/comment/47596694
has title: If loop in jquery is not working
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29731801

http://stackoverflow.com/q/29827705
accepted answer: http://stackoverflow.com/a/29830414
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
upvote count: 1
has title: FullCalendar.js: Event callbacks not firing for added events that get resized/clicked/dropped?
type: AnsweredQuestion
score: 1
tagged with: fullcalendar
has answer: http://stackoverflow.com/a/29830414
type: Question
has body: After adding an event and then changing it again, nothing happens, // * no callback. I even used fullCalendar('refetchEvents') still no luck. Am I missing something? Here is the code: $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'agendaWeek' }, defaultDate: '2015-04-20', editable: false, eventLimit: true, firstDay: 1, defaultView: 'agendaWeek', timeFormat: 'HH:mm', lang: 'de', columnFormat: 'dddd D.M.', allDaySlot: false, slotDuration: '00:30:00', // default is 30 min minTime: '12:00:00', // maxTime: '23:00:00', contentHeight: 600, events: [ { title: '', start: '2014-09-01T18:00:00', end: '2014-09-01T20:00:00', dow: [1], // repeat same weekday rendering: 'background', color: '#6BA5C2' }, { title: '', start: '2014-09-02T20:00:00', end: '2014-09-02T22:00:00', dow: [2], // repeat same weekday rendering: 'background', color: '#6BA5C2' }, { title: 'Event', start: '2015-04-24 13:00:00', end: '2015-04-24 14:00:00', color: '#F77' }, ], // * no callback viewDisplay: function (element) { alert(element); }, // adding an event selectable: true, selectHelper: true, select: function(start, end) { var title = prompt('Deine E-Mail:'); var eventData; if(title) { eventData = { title: title, start: start, end: end, color: '#00AA00', editable: true, eventDurationEditable: true, // * no callback eventResizeStop: function(event, jsEvent, ui, view) { alert('end'); }, // * no callback eventClick: function(calEvent, jsEvent, view) { alert('clicked'); }, // * no callback eventDrop: function(event, delta, revertFunc, jsEvent, ui, view) { alert('dropped'); }, // * no callback eventResize: function(event, delta, revertFunc, jsEvent, ui, view) { alert(event.title + ' end is now ' + event.end.format()); }, }; $('#calendar').fullCalendar('renderEvent', eventData, true); // stick = true $('#calendar').fullCalendar('refetchEvents'); // not helping either $('#calendar').fullCalendar('rerenderEvents'); } $('#calendar').fullCalendar('unselect'); }, }); Visibl…
answer count: 1

http://stackoverflow.com/comment/47542312
has text: It would help to see some code running in jsfiddle.
comment on: http://stackoverflow.com/q/29703108
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29767904
has comment: http://stackoverflow.com/comment/47673277
accepted answer of: http://stackoverflow.com/q/29767735
answers question: http://stackoverflow.com/q/29767735
upvote count: 1
has comment: http://stackoverflow.com/comment/47667209
type: AcceptedAnswer
has body: You can define a plot variable later: var plot = $('#graph').data('plot'); plot.getAxes(); or use it directly like this: $('#graph').data('plot').getAxes(); Which is descibed in the documentation.
type: Answer
has comment: http://stackoverflow.com/comment/47666982
downvote count: 0
score: 1

http://stackoverflow.com/comment/61856283
score: 1
comment on: http://stackoverflow.com/a/29722646
type: AnswerComment
has text: @Zorgatone: That depends on the module loader you are using, but yes usually the folder path will be enough.
type: Comment

http://stackoverflow.com/comment/47787100
comment on: http://stackoverflow.com/q/29829780
score: 0
type: Comment
has text: I would suggest to keep your vb.net code, you can't use JavaScript. Can you explain briefly what's your application and what you're trying to achieve?
type: QuestionComment

http://stackoverflow.com/comment/47590731
comment on: http://stackoverflow.com/a/29721413
has text: I have to remove and insert HTML in MainContent @Daniel Groh because it's SPA and accordingly there might be different content there like list of products or card form or home page or about page or something else (it depends on what button in main menu you click). Your example work well but It does't work in my case.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47574128
type: AnswerComment
comment on: http://stackoverflow.com/a/29714342
type: Comment
has text: The OP is asking specifically about how to use [the jQuery Validate plugin](http://jqueryvalidation.org). **[Your answer is completely wrong and totally broken](http://jsfiddle.net/m27Ljpb9/1/)**. You've simply stuck the object literal containing the rules & options intended for the `.validate()` method into a JavaScript function. You've also used inline JavaScript which is unnecessary when using jQuery.
score: 1

http://stackoverflow.com/a/29818439
answers question: http://stackoverflow.com/q/29794334
score: 0
accepted answer of: http://stackoverflow.com/q/29794334
type: AcceptedAnswer
type: Answer
has body: This issue is occurring when we are having more no. of div's inside the td. It will be resolved by changing the below lines of code in flexigrid.js. Original Line of Code. $('td:visible div:eq(' + n + ')', this).css('width',nw); Need to replace with. $('td:visible:eq(' + (n) + ') div:eq(0)',this).css('width',nw);

http://stackoverflow.com/comment/47631592
type: Comment
has text: Does each group have a different parent element ? Can include `html` ?
comment on: http://stackoverflow.com/q/29749225
score: 0
type: QuestionComment

http://stackoverflow.com/a/29694319
upvote count: 1
answers question: http://stackoverflow.com/q/29694131
score: 1
downvote count: 0
type: Answer
has body: In your case I would suggest just writing out the link you want as Razor code runs server-side so it won't get updated with the values you want. How about you change your code to: $(document).ready(function () { $(".print").click(function () { var id = $(#id).val(); var dept = $(#dept ).val(); var url = "/ControllerName/ActionResultname?sid=" + id + "&amp;sdept=" +dept; window.location.href = url; }); });

http://stackoverflow.com/comment/47784693
score: 2
comment on: http://stackoverflow.com/q/29829128
type: QuestionComment
has text: `data: '',` — An empty string is not valid JSON, you shouldn't tell the server that your request contains JSON if it isn't true. Remove the line: `contentType: "application/json; charset=utf-8",`
type: Comment

http://stackoverflow.com/a/58819372
upvote count: 1
has body: ES2015 shorter syntax + utilizing the 3rd argument of the setTimeout will make our code shorter and nicer while keeping it readiable: document.querySelector('button').addEventListener("click",() => setTimeout(console.log, 1000, "play") ) Play The above example replaced OP's player1.api method with console.log for the sake of printing the argument, which illustrate the code works.
score: 1
answers question: http://stackoverflow.com/q/29755233
downvote count: 0
type: Answer

http://stackoverflow.com/a/29795634
upvote count: 1
has comment: http://stackoverflow.com/comment/47732505
answers question: http://stackoverflow.com/q/29795518
has body: for (var x in friends) This iteates over all keys in friends, resulting in two loop iterations with x = "bill" x = "steve" Then with friends[x] in the loop you access friends.bill and freinds.steve. The name variable is given as a parameter to search(name). This effectivly searches all entries in the dict friends for firstName == name.
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/comment/47699995
comment on: http://stackoverflow.com/a/29784044
score: 0
type: AnswerComment
has text: @JoshK I see that it worked! what was the last problem you were struggling?
type: Comment

http://stackoverflow.com/q/29714939
score: 6
tagged with: css
has answer: http://stackoverflow.com/a/29715101
accepted answer: http://stackoverflow.com/a/29715101
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47564965
type: Question
upvote count: 6
has comment: http://stackoverflow.com/comment/47565080
tagged with: javascript
has comment: http://stackoverflow.com/comment/47565052
has body: I am trying to change the width of a &lt;hr&gt; element with jQuery but it changes the width in 2 directions. I only want it to stretch to the right side. the variable food.runningDistance changes when I do some actions on my application. Code : html : &lt;hr id="runningLine"&gt; javascript : $("#runningLine").animate({width: food.runningDistance}, 500);
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47565108
tagged with: jquery
favorite count: 0
has title: how to change the width of a element in one direction?

http://stackoverflow.com/q/29744656
accepted answer: http://stackoverflow.com/a/29744839
type: AnsweredQuestion
score: 3
upvote count: 3
tagged with: database
type: Question
tagged with: mongodb
has title: Singleton MongoDB connection in Node
has answer: http://stackoverflow.com/a/29744839
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: singleton
has body: What is the best way to set up a singleton in Node for Mongodb? I tried the following code, but it does not work when making a lot of calls rapidly. The singleton does not get set up before subsequent calls, and thus it tries opening too many connections and eventually fails. The below call works well for making infrequent calls. Anyone have suggestions on the best practice here? var db_singleon; var getConnection= function getConnection(callback) { if (db_singleton) { callback(null,db_singleton); } else { var connURL = mongoURI; //set in env variables mongodb.connect(connURL,function(err,db){ if(err) console.error("Error creating new connection "+err); else { db_singleton=db; console.error("created new connection"); } callback(err,db_singleton); return; }); } }
tagged with: node.js
favorite count: 0

text
tags question: http://stackoverflow.com/q/29748661
tags question: http://stackoverflow.com/q/29789045
type: Tag
tags question: http://stackoverflow.com/q/29738046
tags question: http://stackoverflow.com/q/29834587
tags question: http://stackoverflow.com/q/29803850
tags question: http://stackoverflow.com/q/29718962
tags question: http://stackoverflow.com/q/29689937
tags question: http://stackoverflow.com/q/29745645
tag name: text
tags question: http://stackoverflow.com/q/29799915

http://stackoverflow.com/comment/47716086
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29793793
has text: Have a look on this http://stackoverflow.com/questions/26561231/javascript-global-error-handling-via-ajax-php-limit-logs-to-my-own-script

http://stackoverflow.com/comment/47736831
comment on: http://stackoverflow.com/q/29803259
score: 0
has text: Your onload function is only being run once. So when new elements are added to the DOM the function is not being applied. The correct way to fix this is to make wookmark a directive.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47565698
comment on: http://stackoverflow.com/q/29715185
type: Comment
type: QuestionComment
score: 1
has text: @ahm As far as I know, there is no way with built-in confirm dialog, because this is the standard browser behaviour. You have to use some third-party dialog iimplementation like jQuery UI or Bootstrap.

http://stackoverflow.com/comment/47544119
score: 0
type: QuestionComment
has text: I get an `unexpected indentation` warning. Also that algorithm is likely not going to work that way. Do you want to "eat up" the contents of the array? then `...` might come in handy if you don't care about the sizes you have in variables. If you want it more variable, take a look at `Array.slice`
type: Comment
comment on: http://stackoverflow.com/q/29703420

http://stackoverflow.com/comment/47818774
has text: I'm not sure what you mean. The code provided will result in exactly this `{{ {{prefix}}"Output" }}`. What else are you trying to achieve? Can you perhaps post some pseudo code in your question?
type: Comment
comment on: http://stackoverflow.com/a/29842780
score: 0
type: AnswerComment

http://stackoverflow.com/a/29773204
upvote count: 0
has comment: http://stackoverflow.com/comment/47677256
has body: I would HIGHLY recommend jQuery outsideevents http://benalman.com/projects/jquery-outside-events-plugin/ $(btn).bind("clickoutside", function(event){ // Code to hide your menu. }); It does all the work of finding everything that's "not the button" for you. I should also mention it does a lot more than clickoutside, like you could check if they focusoutside too so if they use tab shortcuts to navigate the page the menu still closes, etc.
score: -2
has comment: http://stackoverflow.com/comment/47677050
downvote count: 2
has comment: http://stackoverflow.com/comment/47677401
answers question: http://stackoverflow.com/q/29773108
type: Answer

http://stackoverflow.com/comment/47775281
comment on: http://stackoverflow.com/a/29823216
has text: My console.log is coming back 'null' for h2height. But the example you've linked on JSfiddle works fine?
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/60384972
comment on: http://stackoverflow.com/a/31402500
score: 0
type: AnswerComment
has text: I don't know the ins and outs of the module syntax spec, but I just tried that and it's a syntax error.
type: Comment

http://stackoverflow.com/comment/82043242
type: AnswerComment
score: 0
has text: This was great! I struggled on my own for hours, not really understanding why hex values and rgb values wouldn't work. I switched to toggling class names and voila! It works like a charm. Thank you!
type: Comment
comment on: http://stackoverflow.com/a/29715588

http://stackoverflow.com/q/29798784
tagged with: jquery
answer count: 3
has answer: http://stackoverflow.com/a/29798977
has comment: http://stackoverflow.com/comment/47725925
favorite count: 0
type: UnansweredQuestion
upvote count: 6
has body: I've managed to figure out how to grab external json and use that in a modal using a manually set id in the javascript. I'm stuck on passing the id from the button to the javascript url. My button markup is as follows; Details My JS currently looks like this; the line im having issue with is; var event = "details.php?id=" + ($(this).data('id')); I'm using ($(this).data('id')); to try and grab the id attribute from the button, but i keep getting undefined.
has answer: http://stackoverflow.com/a/29798976
downvote count: 1
type: Question
score: 5
has title: Getting an ID from a button into a bootstrap modal
has answer: http://stackoverflow.com/a/29798975
tagged with: javascript

http://stackoverflow.com/comment/47692644
type: QuestionComment
comment on: http://stackoverflow.com/q/29712422
has text: What is MessageComments and where is it coming from? I don't see that defined anywhere.
score: 0
type: Comment

http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/29712845
tags question: http://stackoverflow.com/q/29705117
tags question: http://stackoverflow.com/q/29688347
tags question: http://stackoverflow.com/q/29796463
tags question: http://stackoverflow.com/q/29720594
tags question: http://stackoverflow.com/q/29714691
tags question: http://stackoverflow.com/q/29717590
tags question: http://stackoverflow.com/q/29798935
tags question: http://stackoverflow.com/q/29703790
tags question: http://stackoverflow.com/q/29779810
tags question: http://stackoverflow.com/q/29784975
tags question: http://stackoverflow.com/q/29716792
tags question: http://stackoverflow.com/q/29801547
tags question: http://stackoverflow.com/q/29757380
tags question: http://stackoverflow.com/q/29829128
tags question: http://stackoverflow.com/q/29724931
tags question: http://stackoverflow.com/q/29777118
tags question: http://stackoverflow.com/q/29776975
tags question: http://stackoverflow.com/q/29722158
tags question: http://stackoverflow.com/q/29803998
tags question: http://stackoverflow.com/q/29801562
tags question: http://stackoverflow.com/q/29775303
tags question: http://stackoverflow.com/q/29752604
tags question: http://stackoverflow.com/q/29733594
tags question: http://stackoverflow.com/q/29729711
tags question: http://stackoverflow.com/q/29694300
tags question: http://stackoverflow.com/q/29740459
tags question: http://stackoverflow.com/q/29787205
tags question: http://stackoverflow.com/q/29734977
tags question: http://stackoverflow.com/q/29829402
tags question: http://stackoverflow.com/q/29697919
tags question: http://stackoverflow.com/q/29833320
tags question: http://stackoverflow.com/q/29805011
tags question: http://stackoverflow.com/q/29724443
tags question: http://stackoverflow.com/q/29830235
tags question: http://stackoverflow.com/q/29799634
tags question: http://stackoverflow.com/q/29806586
tags question: http://stackoverflow.com/q/29713542
tags question: http://stackoverflow.com/q/29785622
tags question: http://stackoverflow.com/q/29808761
tags question: http://stackoverflow.com/q/29697861
tags question: http://stackoverflow.com/q/29720806
tags question: http://stackoverflow.com/q/29725687
tags question: http://stackoverflow.com/q/29830121
tags question: http://stackoverflow.com/q/29810170
tags question: http://stackoverflow.com/q/29689235
tags question: http://stackoverflow.com/q/29831865
tags question: http://stackoverflow.com/q/29822149
tags question: http://stackoverflow.com/q/29705494
tags question: http://stackoverflow.com/q/29727233
tags question: http://stackoverflow.com/q/29757134
tags question: http://stackoverflow.com/q/29773198
tags question: http://stackoverflow.com/q/29802994
tags question: http://stackoverflow.com/q/29833676
tags question: http://stackoverflow.com/q/29740089
tags question: http://stackoverflow.com/q/29805704
tags question: http://stackoverflow.com/q/29783420
tags question: http://stackoverflow.com/q/29728237
tags question: http://stackoverflow.com/q/29820205
tags question: http://stackoverflow.com/q/29751598
tags question: http://stackoverflow.com/q/29717721
tags question: http://stackoverflow.com/q/29769010
tags question: http://stackoverflow.com/q/29753052
tags question: http://stackoverflow.com/q/29802562
tags question: http://stackoverflow.com/q/29814761
tags question: http://stackoverflow.com/q/29822765
tags question: http://stackoverflow.com/q/29720104
tags question: http://stackoverflow.com/q/29721709
tags question: http://stackoverflow.com/q/29750149
tags question: http://stackoverflow.com/q/29765688
tags question: http://stackoverflow.com/q/29767221
tags question: http://stackoverflow.com/q/29763557
tags question: http://stackoverflow.com/q/29773062
tags question: http://stackoverflow.com/q/29723461
type: Tag
tags question: http://stackoverflow.com/q/29748961
tags question: http://stackoverflow.com/q/29831705
tags question: http://stackoverflow.com/q/29744340
tags question: http://stackoverflow.com/q/29784284
tags question: http://stackoverflow.com/q/29735884

http://stackoverflow.com/comment/47586461
score: 0
comment on: http://stackoverflow.com/q/29725764
has text: @dandavis: it's a technique to invalidate stale content when [aggressively caching](https://developers.google.com/speed/docs/insights/LeverageBrowserCaching) assets. This behaviour (cache busting) is typically done referencing file version or hash "fingerprint" in the URL i.e. `app.js?v=123`; whenever an update is released the file is served from a different URL.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29741883
has comment: http://stackoverflow.com/comment/47616990
answers question: http://stackoverflow.com/q/29741667
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47616949
has comment: http://stackoverflow.com/comment/47619085
has body: I am not sure if my solution will work in your case or not. but I would like you to try following solution. can you please try and add following css to your code. #res { width: 100%; overflow:hidden } please comment me back, if it works or not. I will come up with better solution if possible.

http://stackoverflow.com/comment/47773511
type: QuestionComment
type: Comment
has text: How do you call your `$http` in your app ? Using a model, controller and so on ?
comment on: http://stackoverflow.com/q/29823626
score: 0

http://stackoverflow.com/q/29781768
type: UnansweredQuestion
tagged with: javascript
has title: How to I put an image to the side of my combo box?
type: Question
has comment: http://stackoverflow.com/comment/47699983
has comment: http://stackoverflow.com/comment/47699986
score: 0
has comment: http://stackoverflow.com/comment/47695152
has body: I want put an image with the name in a drop down box. JavaScript: var teams = [ ["Barcelona", "images/logo/Barcelona.jpg"], ["Real Madrid", "images/logo/RMadrid.jpg"]] for(i=0;i&lt;teams.length;i++){ var select = document.getElementById("test"); select.options[select.options.length] = new Option(teams[i][0], "&lt;img src=" + teams[i][1]+"&gt;" ); } HTML: &lt;select id="test"&gt; &lt;/select&gt;
tagged with: arrays
tagged with: http://stackoverflow.com/tag/html
answer count: 0

http://stackoverflow.com/q/29690375
favorite count: 0
accepted answer: http://stackoverflow.com/a/29969483
linked to: http://stackoverflow.com/q/238547
tagged with: android
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29690453
type: AnsweredQuestion
upvote count: 19
tagged with: android-calendar
tagged with: android-webview
has answer: http://stackoverflow.com/a/29690453
has comment: http://stackoverflow.com/comment/48080845
score: 19
type: Question
has title: Can you autolink dates in android webview
has comment: http://stackoverflow.com/comment/48075510
has answer: http://stackoverflow.com/a/29969483
tagged with: javascript
has comment: http://stackoverflow.com/comment/48058086
answer count: 2
has body: I have this html: sawr-o-pel-te meaning 'lizard shield' April 7th, 2015 4/7/2015 April 7th Next Monday 6th 202 E South St Orlando, FL 32801 Quick Facts One of the most well-understood nodosaurids The earliest known genus of nodosaurid Measured about 5 meters (16.5 ft) long The tail made up nearly half of its body length And I want to know if its possible to automatically hyperlink the dates so when the user presses on them you can add them to the users(phone's) calendar? A good example of how this should work is Gmail. When there is a date or the word(tomorrow, this friday, etc..) it should be automatically linked so the date can be added to calendar. Update: Does any one know if there is a ex. javascript that I can add to the app that will do this job for me?
downvote count: 0

http://stackoverflow.com/comment/47576456
type: AnswerComment
type: Comment
has text: Oh so your argument about which function will stop is the page scroll position ?
comment on: http://stackoverflow.com/a/29720650
score: 0

http://stackoverflow.com/a/29832003
has body: I keep digging and turns out that the request and response object are exposed in express using the __proto__ property. var express = require('express'), app = express(); app.response.__proto__.foo = function (data) { this.status(200).send(data); }; And later in the router router.get('/foo', function (req, res, next) { res.foo('test'); }); This will print test in your browser so it is possible to add functionality without using any middleware. Note: I'm sure there are some drawbacks to this approach (overwriting express predefined properties, for example) but for testing purposes and adding very simple functionality I think is slightly better in terms of performance.
type: Answer
answers question: http://stackoverflow.com/q/29827047
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29827047

http://stackoverflow.com/q/29747550
tagged with: momentjs
type: AnsweredQuestion
has title: Difference between moment.toString() and moment.toISOString()
has body: I have reading moment.js document, there have a moment.toISOString() function for helps to formats a string to the ISO8601 standard. Also there have a another one reason for why we use moment.toISOString() moment.toISOString() function using for performance reasons. I don't know toISOString() the performance best than moment.toString().But only the result was difference while using moment.toString() and moment.toISOString(). So my question is. Why we should use moment.toISOString()? for performance reasons? And what is the difference between moment.toISOString() and moment.toString()?
score: 23
type: Question
tagged with: javascript
upvote count: 25
has answer: http://stackoverflow.com/a/29747727
accepted answer: http://stackoverflow.com/a/29747727
downvote count: 2
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47627705

http://stackoverflow.com/comment/47681075
has text: Well, it would be nice to be a default prop so that I can easily override it when I want to supply a custom id. If that is not going to work I will accept different approaches as well.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29774790
type: Comment

http://stackoverflow.com/q/29835096
tagged with: php
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47797032
has answer: http://stackoverflow.com/a/29835125
has title: jquery onclick event doesn't work, nothing happens
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29835173
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47797003
upvote count: 0
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/29835177
accepted answer: http://stackoverflow.com/a/29835173
has answer: http://stackoverflow.com/a/29835237
has body: I'm trying to change the behavior of a button with jquery but i's not working, when I click the button of the modal nothing happens, the code insed the script tag it's not the definitive code, but helps to see if something happens. ... &lt;/head&gt; &lt;body&gt; &lt;script type="text/javascript"&gt; $( "#crear" ).click(function() { alert( "Handler for .submit() called." ); }); &lt;/script&gt; &lt;nav class="navbar navbar-default navbar-static-top" role="navigation"&gt; &lt;div class="container"&gt; &lt;ul class="nav navbar-nav"&gt; &lt;li class="active"&gt;&lt;a href="#"&gt;Clases&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="office"&gt;Despachos&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="clase"&gt;Otros Servicios&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="clase"&gt;Administracion de usuario&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/nav&gt; &lt;div class="container"&gt; &lt;div class="row"&gt; &lt;h1&gt;Editor de Clases&lt;/h1&gt; &lt;/div&gt; &lt;div class = "row"&gt; &lt;p&gt; &lt;button type="button" class="btn btn-success" data-toggle="modal" data-target="#myModal"&gt; Nuevo &lt;/button&gt; &lt;p&gt; &lt;/div&gt; &lt;div class="row"&gt; &lt;table class="table table-striped table-bordered"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Nombre&lt;/th&gt; &lt;th&gt;Información&lt;/th&gt; &lt;th&gt;Opciones&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;?php foreach($clases as $clase_item){ //echo $clase_item-&gt;nombre; echo "&lt;tr&gt;"; echo "&lt;td&gt;".$clase_item-&gt;nombre."&lt;/td&gt;"; echo "&lt;td&gt;".$clase_item-&gt;info."&lt;/td&gt;"; echo "&lt;td align='center'&gt;"; echo '&lt;a class="btn btn-success" href="clase/update/'.$clase_item-&gt;nombre.' "&gt;Editar&lt;/a&gt;'; echo '&lt;a class="btn btn-danger" href="clase/delete/'.$clase_item-&gt;nombre.'"&gt;Borrar&lt;/a&gt;'; echo "&lt;/td&gt;"; echo "&lt;/tr&gt;"; } ?&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;!--Modal para crear nueva clase--&gt; &lt;div class="modal fade" id="myModal" ta…
has answer: http://stackoverflow.com/a/29835177

http://stackoverflow.com/comment/47775149
comment on: http://stackoverflow.com/a/29823712
type: Comment
has text: This question is about jQuery selectors after all, so I have no problem with the first argument :)
score: 1
type: AnswerComment

http://stackoverflow.com/comment/47715165
comment on: http://stackoverflow.com/q/29792829
score: 0
type: QuestionComment
type: Comment
has text: @lesssugar 5MB is a lot of data! I am presuming it's only json data. If 'storing' new loads then when a user returns another time, not via the back button, you'll need to 'clean' the storage so a time stamp will be need to be included on the server side in a 'fresh' page.

http://stackoverflow.com/q/29802947
has comment: http://stackoverflow.com/comment/49786423
tagged with: ios
tagged with: javascript
has title: Downloading file to "/public" directory using Meteor/Cordova iOS
downvote count: 0
tagged with: meteor
favorite count: 0
tagged with: cordova
type: UnansweredQuestion
has body: I'm building an iOS app similar to the Lynda.com app that allows you to download videos to your device for offline viewing. I can't seem to figure out how to download to and access files from the public directory. I'm using org.cordova.apache.file and org.cordova.apache.file-system to download files to the device, but Meteor cannot access them. So I thought that maybe if I could get these files to download to the "/public" directory, I'd have more luck. The problem I'm having specifically is that whenever I do meteor run ios-device The "version" property of this object Meteor.connection._mongo_livedata_collections.meteor_autoupdate_clientVersions._docs._map['version-cordova'].version gets updated. I need that property to append to the directory path I get when I console.log cordova.file.dataDirectory. The property however shows as undefined when I try to use it in a variable. I can clearly see it when I console.log but I can't use it in a var. Is Meteor.connection._mongo_livedata_collections.meteor_autoupdate_clientVersions._docs._map['version-cordova'].version A private/protected variable? How can I access it? If I can figure this out I'm seriously considering posting a video tutorial since a lot of people seem to want to know how to do this.
score: 2
has comment: http://stackoverflow.com/comment/48288366
answer count: 0
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/48367865

http://stackoverflow.com/a/29841156
accepted answer of: http://stackoverflow.com/q/29838829
has comment: http://stackoverflow.com/comment/47873828
type: Answer
answers question: http://stackoverflow.com/q/29838829
upvote count: 1
has body: Validation will only happen if a value is already set for the field. So if the password field is null, the validation won't run. To fix this, set allowNull on the column: password: { type: DataTypes.STRING, allowNull: false, validate: {notEmpty: true, min: 6} },
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47803227
has text: possible duplicate of [javascript search array of arrays](http://stackoverflow.com/questions/6315180/javascript-search-array-of-arrays)
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29838438
score: 0

http://stackoverflow.com/a/29723705
answers question: http://stackoverflow.com/q/29723690
upvote count: 2
has comment: http://stackoverflow.com/comment/47581826
has comment: http://stackoverflow.com/comment/47581748
has comment: http://stackoverflow.com/comment/47581855
has comment: http://stackoverflow.com/comment/47581648
has comment: http://stackoverflow.com/comment/47581634
downvote count: 0
type: Answer
has body: You could try something like this: function clicked() { // Here we select the html element with id name and // we read it's value. var name = document.getElementById('name').value; // Then my simply concatenating the Hiya with the above value, name // we show to the confirm value the message we want. return confirm('Hiya,'+name); } function clicked() { var name = document.getElementById('name').value; return confirm('Hiya, '+name); } &lt;form method="GET"&gt; &lt;input type="text" class="form" name="name" placeholder="Enter your name!" id="name"&gt; &lt;input type="submit" onclick="return clicked();" value="I'm ready!"&gt; &lt;/form&gt;
has comment: http://stackoverflow.com/comment/47581651
score: 2
has comment: http://stackoverflow.com/comment/47581910

http://stackoverflow.com/a/29727646
has comment: http://stackoverflow.com/comment/47591774
accepted answer of: http://stackoverflow.com/q/29726306
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29726306
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/47591894
has comment: http://stackoverflow.com/comment/47612992
has comment: http://stackoverflow.com/comment/47876214
score: 2
has body: It is because of $compileProvider which do compilation of html, you need tell the $compileProvider that you should allow ms-local-stream:// while adding in src tag that can be done inside $compileProvider.imgSrcSanitizationWhitelist method. If you don't specified the sanitization whitelist then angular will add unsafe: prefix in the value. This setting you could add in config of you app. Markup &lt;img ng-src="{{url}}" alt="Title"/&gt; Code app.config(['$routeProvider', '$compileProvider', function($routeProvider, $compileProvider) { //this is for anchor href $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ms-local-stream):/); //this is for img src $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ms-local-stream):/); }]); Refer same SO question.

http://stackoverflow.com/q/29820859
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47768294
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29821069
score: 0
has body: I'd like to have a requiered Select for the "Brand car", the attribute is added but the problem is that I have already one value "Choose the brand name" how can I make this work? (for the HTML5 checking) $("#category").change(function() { var category = parseInt($("#category").val(), 10); switch (category){ case 2: //car $("#car_part").show("slow"); $("#brand_car").prop('required',true); } .... } Choose the catecory Cars Trucks Choose the brand name AUDI BMW
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29821069
tagged with: php
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29820965
has answer: http://stackoverflow.com/a/29820965
has title: Add required to select but it have already one value

http://stackoverflow.com/comment/47877365
has text: Brilliant, thank you so much. I think I am going to try and implement the cookie option. I would like to use localStorage although I have never looked at that in the past, so I will investigate.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29862169
type: Comment

http://stackoverflow.com/q/29841511
has body: I got this line in .htaccess: AddOutputFilterByType DEFLATE application/x-javascript It should be for compressing js, but I would like to know if it is even for external javascripts loaded like this: &lt;script type="text/javascript" async&gt; var leady_track_key="jReps29OXPLsAueX"; var leady_track_server=document.location.protocol+"//t.leady.cz/"; (function(){ var l=document.createElement("script");l.type="text/javascript";l.async=true; l.src=leady_track_server+leady_track_key+"/L.js"; var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(l,s); })(); &lt;/script&gt; Thx for your help
accepted answer: http://stackoverflow.com/a/29853856
type: AnsweredQuestion
type: Question
tagged with: javascript
tagged with: .htaccess
has comment: http://stackoverflow.com/comment/47815880
has answer: http://stackoverflow.com/a/29853856
has title: Is application/x-javascript in .htaccess even for externaly load java scripts?
score: 0
answer count: 1

http://stackoverflow.com/comment/47536210
comment on: http://stackoverflow.com/q/29700225
type: Comment
type: QuestionComment
has text: Is your code in a script tag?
score: 2

http://stackoverflow.com/q/29793109
answer count: 3
has comment: http://stackoverflow.com/comment/47715139
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47714887
favorite count: 0
accepted answer: http://stackoverflow.com/a/29793130
has body: Let's say I have unknown number of div elements inside parent element. When I click on child div element I want to print out its eq() index using console.log(). I don't want to use any classes or ids. HTML: JS: $(this).click( function(){ console.log(eqIndex);//now this div eq is a problem } ); CSS: #parent div{ height: 10px; width: 10px; background-color:blue; margin:2px; } DEMO
has answer: http://stackoverflow.com/a/29793423
downvote count: 1
type: Question
type: AnsweredQuestion
score: 3
has title: Get elements eq() index
possible better answer: http://stackoverflow.com/a/29793556
has answer: http://stackoverflow.com/a/29793556
upvote count: 4
has answer: http://stackoverflow.com/a/29793130
has comment: http://stackoverflow.com/comment/47730226
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29788260
tagged with: jquery
has answer: http://stackoverflow.com/a/29806217
score: 0
has body: I have a Google Map script that allows me to show markers with infowindows on a map. My concern is: a) How can I open and set the content of each infoWindow ONLOAD, so all infoWindows popup? b) How can I make it possible for jQuery to "listen" to the content of the marker's infoWindow? My a-Tag inside has a class "show" and I have a simple document.ready $('.show').click(function()) which doesn't do anything while clicking on the a-tag inside the window. Outside of Gmaps it works fine. Hope you can help, below the script I use: &lt;script type="text/javascript"&gt; var infowindow = null; $(document).ready(function() { initialize(); }); function initialize() { var centerMap = new google.maps.LatLng(38, 10); var myOptions = { zoom: 5, center: centerMap, scrollwheel: false, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("gmap"), myOptions); setMarkers(map, sites); infowindow = new google.maps.InfoWindow({ content: "loading..." }); var bikeLayer = new google.maps.BicyclingLayer(); bikeLayer.setMap(map); } var sites = [ ['Test', 38, 10, 1, '&lt;a href="#" class="show" data-popup="1"&gt;&lt;img class="marker_class" src="91ccd318ae8b607500f54e7c56b5350e.png" alt="Preview"&gt;&lt;/a&gt;'] ]; function setMarkers(map, markers) { for (var i = 0; i &lt; markers.length; i++) { var sites = markers[i]; var siteLatLng = new google.maps.LatLng(sites[1], sites[2]); var marker = new google.maps.Marker({ position: siteLatLng, map: map, title: sites[0], zIndex: sites[3], html: sites[4] }); var contentString = "Google Maps"; google.maps.event.addListener(marker, "click", function () { infowindow.setContent(this.html); infowindow.open(map, this); }); } } &lt;/script&gt; &lt;div id="gmap" class="map"&gt;&lt;/div&gt;
linked to: http://stackoverflow.com/q/6075453
type: UnansweredQuestion
has title: Google Maps, show infoWindow on Load and addListener
type: Question
tagged with: google-maps
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/29716947
has answer: http://stackoverflow.com/a/29717235
has body: I'm trying to submit a form after the validation succeeds, so I've run the below code, and both operations perform at same time. I also tried to submit handler method, but it only gets errors. My code looks like this: $("#request_form").validate({ debug: false, onfocusout: function(element) { $(element).valid(); }, errorClass : 'has-error', rules: { Subject : "required", Screen: "required" }, messages: { Subject : "Subject cannot be empty", Screen: "Screen cannot be empty" }, submitHandler: function(form) { form.submit(); } }); $("#request_form").on('submit', (function(e) { $("#request_form").validate(); $("#request_form").valid() { alert("test"); var action = "Provide_Feedback"; var form = $('form')[0]; var formData = new FormData(form); formData.append('action','Provide_Feedback'); e.preventDefault(); $.ajax({ url: "support_update.php", type: "POST", data: formData, contentType: false, cache: false, processData:false, success: function(data) { if (data == "200") { alert("Your Request Sent."); window.location = 'provide_feedback.php'; } else { alert("There was an error occurred!"); } } }); } }));
has comment: http://stackoverflow.com/comment/47568538
type: UnansweredQuestion
has title: How to submit form after validation in jquery
tagged with: php
has answer: http://stackoverflow.com/a/29717011
upvote count: 1
type: Question
score: 1
tagged with: javascript
tagged with: forms
has comment: http://stackoverflow.com/comment/47568724
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/29705347
score: 2
type: AcceptedAnswer
has body: This is because the width will never actually be equal to 0, it will be something like 0px depending upon the units you choose. Your second set of conditions work because they check for the width first (500px) and if it doesn't match chooses the other (0px). You can handle this in a variety of ways, including extracting just the number value from 0px, however since you already have this working, its just something to be aware of in the future. :)
downvote count: 0
has comment: http://stackoverflow.com/comment/47546648
type: Answer
has comment: http://stackoverflow.com/comment/47546387
upvote count: 2
answers question: http://stackoverflow.com/q/29705295
accepted answer of: http://stackoverflow.com/q/29705295
has comment: http://stackoverflow.com/comment/47546188

http://stackoverflow.com/comment/47565195
has text: This will be because the function counts the elements on the parent page and not within the iframe. The reference for the parent function is the parent's window object.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29714998
type: QuestionComment

http://stackoverflow.com/comment/47708623
type: Comment
comment on: http://stackoverflow.com/a/29789479
has text: The answer only depends on what you asked.If you want to change it for this input field only, then make $("#isEmail") instead of $("input").I dont get what you actually mean by isEmail as the second parameter.You will always get the id from the selector by using $(this).attr('id').
type: AnswerComment
score: 0

http://stackoverflow.com/comment/93002793
has text: I know this is way late, but I believe the RequireJS text plugin helps with this issue by letting RequireJS know how to read in HTML files: https://github.com/requirejs/text
comment on: http://stackoverflow.com/q/29817631
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47630167
comment on: http://stackoverflow.com/q/29745089
score: 0
type: Comment
type: QuestionComment
has text: Its the tie back to code. So I want to be able to connect each button to a function, and as the function will be dependent on configuration, I need a way of identifying it for the code.

http://stackoverflow.com/q/29735882
linked to: http://stackoverflow.com/q/22519784
has comment: http://stackoverflow.com/comment/47606016
accepted answer: http://stackoverflow.com/a/29736614
linked to: http://stackoverflow.com/q/23667086
has comment: http://stackoverflow.com/comment/47604939
has comment: http://stackoverflow.com/comment/47604988
has body: I am quite new in promises and I think I don't understand it correctly because I am trying it in my code without success. I have a server on NodeJS, using Express library and express-promise var express = require('express'); var app = express(); app.use(require('express-promise')()); Then I am handling ajax query: var promise = function() { for(var query in req.query ){ console.log( 'query: ', query ); switch( query ){ case 'getobserved': results.observedTags = getObserved(); break; ... } } }; And getObserved is getting data from Firebase DB var getObserved = function() { var observedTags = dbRef.child('observedTags'); observedTags.on('value', function(snap) { var allObservedItems = snap.val(); var list = []; for(var ii in allObservedItems ){ list.push( allObservedItems[ii].name ); } return list; }); }; And finally I am trying to send response to client by: promise.then( res.send( results ), someRejectedMethod ); And I get in console this: TypeError: undefined is not a function at d:\wamp\www\soz2\server.js:100:13 Probably method "promise" is undefined. I am not sure if I use express-promise wrong, or it's just my lack of knowledge about whole promises. Need some hint, please
has comment: http://stackoverflow.com/comment/47605027
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47605754
type: Question
has comment: http://stackoverflow.com/comment/47605004
answer count: 1
has comment: http://stackoverflow.com/comment/47605055
tagged with: javascript
has answer: http://stackoverflow.com/a/29736614
tagged with: express
score: 0
has title: Express promise doesn't work
tagged with: node.js
tagged with: promise

http://stackoverflow.com/a/29744138
answers question: http://stackoverflow.com/q/29744048
downvote count: 0
has body: It is used for ES6 modules In that case it is exporting a class from that module, so you would be able to import it in another module using: import { Counter } from 'path_to_counter'; You will need something like Webpack to do the module loading if you are using a browser, and possibly a transpiler like Babel.js for the ES6 transpilation
score: 3
upvote count: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29744048
type: Answer

http://stackoverflow.com/comment/47563928
score: 0
has text: Do you have any JS errors in the browser's console?
type: Comment
comment on: http://stackoverflow.com/a/29710711
type: AnswerComment

http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/29777912
tags question: http://stackoverflow.com/q/29781818
tags question: http://stackoverflow.com/q/29823766
tags question: http://stackoverflow.com/q/29729473
tags question: http://stackoverflow.com/q/29735781
tags question: http://stackoverflow.com/q/29790582
tags question: http://stackoverflow.com/q/29821038
tags question: http://stackoverflow.com/q/29735157
tags question: http://stackoverflow.com/q/29743729
tags question: http://stackoverflow.com/q/29732166
tags question: http://stackoverflow.com/q/29843917
tags question: http://stackoverflow.com/q/29800425
tags question: http://stackoverflow.com/q/29797819
tags question: http://stackoverflow.com/q/29796169
tags question: http://stackoverflow.com/q/29726652
tags question: http://stackoverflow.com/q/29738563
tags question: http://stackoverflow.com/q/29834681
tags question: http://stackoverflow.com/q/29799509
tags question: http://stackoverflow.com/q/29755624
tags question: http://stackoverflow.com/q/29729197
tags question: http://stackoverflow.com/q/29803836
tags question: http://stackoverflow.com/q/29788306
tags question: http://stackoverflow.com/q/29836199
tags question: http://stackoverflow.com/q/29770701
tags question: http://stackoverflow.com/q/29740550
tags question: http://stackoverflow.com/q/29767870
tags question: http://stackoverflow.com/q/29810692
tags question: http://stackoverflow.com/q/29829992
tags question: http://stackoverflow.com/q/29836016
tags question: http://stackoverflow.com/q/29797081
tags question: http://stackoverflow.com/q/29768056
tags question: http://stackoverflow.com/q/29795325
tags question: http://stackoverflow.com/q/29746126
tags question: http://stackoverflow.com/q/29768876
tags question: http://stackoverflow.com/q/29767286
tags question: http://stackoverflow.com/q/29766102
tags question: http://stackoverflow.com/q/29779076
tags question: http://stackoverflow.com/q/29812388
tags question: http://stackoverflow.com/q/29781627
tags question: http://stackoverflow.com/q/29803787
tags question: http://stackoverflow.com/q/29730963
tags question: http://stackoverflow.com/q/29813499
tags question: http://stackoverflow.com/q/29811178
tags question: http://stackoverflow.com/q/29693531
tags question: http://stackoverflow.com/q/29810975
tags question: http://stackoverflow.com/q/29699794
tags question: http://stackoverflow.com/q/29819410
tags question: http://stackoverflow.com/q/29813974
tags question: http://stackoverflow.com/q/29805659
tags question: http://stackoverflow.com/q/29769817
tags question: http://stackoverflow.com/q/29841547
tags question: http://stackoverflow.com/q/29693529
tags question: http://stackoverflow.com/q/29827291
tags question: http://stackoverflow.com/q/29775691
tags question: http://stackoverflow.com/q/29692169
tags question: http://stackoverflow.com/q/29773091
tags question: http://stackoverflow.com/q/29736856
tags question: http://stackoverflow.com/q/29837395
tags question: http://stackoverflow.com/q/29739781
tags question: http://stackoverflow.com/q/29833214
tags question: http://stackoverflow.com/q/29836060
tags question: http://stackoverflow.com/q/29761825
tags question: http://stackoverflow.com/q/29816414
tags question: http://stackoverflow.com/q/29697360
tags question: http://stackoverflow.com/q/29837272
tags question: http://stackoverflow.com/q/29842862
tags question: http://stackoverflow.com/q/29829392
tags question: http://stackoverflow.com/q/29813562
tags question: http://stackoverflow.com/q/29795016
tags question: http://stackoverflow.com/q/29823971
tags question: http://stackoverflow.com/q/29737554
tags question: http://stackoverflow.com/q/29829532
tags question: http://stackoverflow.com/q/29715292
tags question: http://stackoverflow.com/q/29733937
tags question: http://stackoverflow.com/q/29762060
tags question: http://stackoverflow.com/q/29822577
tags question: http://stackoverflow.com/q/29713777
tags question: http://stackoverflow.com/q/29694952
tags question: http://stackoverflow.com/q/29725576
tags question: http://stackoverflow.com/q/29695779

http://stackoverflow.com/comment/136732145
has text: Smiling Face with Open Hands `|| {}`
type: Comment
score: 2
comment on: http://stackoverflow.com/a/72882442
type: AnswerComment

http://stackoverflow.com/q/29717913
downvote count: 0
has title: ExtJS error in nested grids : Cannot read property 'isGroupHeader' of null
type: AnsweredQuestion
score: 3
type: Question
possible better answer: http://stackoverflow.com/a/49018629
tagged with: javascript
has answer: http://stackoverflow.com/a/49018629
tagged with: extjs
upvote count: 3
answer count: 3
has answer: http://stackoverflow.com/a/43671684
tagged with: extjs5
has answer: http://stackoverflow.com/a/31617266
accepted answer: http://stackoverflow.com/a/31617266
has body: whenever i expand or collapse row in nested grid I get the following error : "Uncaught TypeError: Cannot read property 'isGroupHeader' of null" google gave me this url , but it doesn't seems to work in 5.1 , any idea how to convert it to solve 5.1 problem ? http://blog.kondratev.pro/2014/08/getting-rid-of-annoying-uncaught.html Here is fiddle example for the error : https://fiddle.sencha.com/#fiddle/g5b
favorite count: 0

http://stackoverflow.com/q/29693426
type: Question
tagged with: pagination
downvote count: 0
tagged with: javascript
tagged with: extjs5
score: 1
tagged with: client-side
favorite count: 0
type: UnansweredQuestion
tagged with: store
has title: EXT JS 5.1 - Client side pagination on grid is not working
has body: I am using EXT JS 5.1, in my application there is a grid panel which gets data from the grails server. I need the data to be paginated from client side i.e. all the data from the server should be retrieved at once and on click of "next" or "prev", it should not go to the server again to fetch the data. Instead it should get the local data. Is there any way to achieve this. I had tried with two stores. One store gets the data from the server which has the proxy of AJAX and the other store which has the proxy as MEMORY which is assigned to the grid. Data from AJAX proxy store is copied to the Memory proxy store and Memory proxy store is assigned to the grid so that every time the server is not hit. To load the data, I am using loadRawData. But this is disrupting the pagingtoolbar configurations. I tried overriding the loadRawData to reset the configuration of the store but still the paging toolbar is not showing proper results. Below is the code: Ext.define('MVC.model.WorkOrderStatic', { extend: 'Ext.data.Model', fields: [ { name: 'Selected', type: 'boolean' }, { name: 'workOrderBatchId', type: 'string' }, { name: 'territory', type: 'string' }, { name: 'apo', type: 'string' }, { name: 'eventRefId', type: 'string' }, { name: 'product', type: 'string' }, { name: 'Received', type: 'string' }, { name: 'DueDate', type: 'string' }, { name: 'priority', type: 'string' }, { name: 'AssignedTo', type: 'string' }, { name: 'Ready', type: 'boolean' }, { name: 'InProgress', type: 'boolean' }, { name: 'partial', type: 'boolean' }, { name: 'Complete', type: 'boolean' }, { name: 'hold', type: 'boolean' }, { name: 'account', type: 'string' }, { name: 'id', type: 'string' } ], idProperty: 'id' }); Ext.define('MVC.model.WorkOrder', { extend: 'Ext.data.Model', fields: [ { name: 'Selected', type: 'boolean' }, { name: 'workOrderBatchId', type: 'string' }, { name: 'territory', type: 'string' }, { name: 'apo', type: 'string' }, { name: 'eventRefId', type: 'string' }, { name: 'product', type: '…
answer count: 0
upvote count: 1

http://stackoverflow.com/comment/47539149
score: 0
has text: @PaulS. you just answered his question . let him implement it
type: QuestionComment
comment on: http://stackoverflow.com/q/29701591
type: Comment

http://stackoverflow.com/comment/47964464
comment on: http://stackoverflow.com/a/29829456
has text: Thank you again for your response - I think it's getting there, but it's still not quite working. Basically I've managed to get the code into the right part of the javascript so that the text box is hidden, so I know it must be in the right place, but for some reason, when I select Other (please specify), it's not showing. I know I mentioned this before, but it's still doing the thing where in inspect element the code shows the first option (-- Choose an option --) as having value selected, and not any others. I'm not sure if that might have something to do with it :S
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47623095
type: QuestionComment
comment on: http://stackoverflow.com/q/29734856
has text: use inAppBrowser plugin
score: 0
type: Comment

http://stackoverflow.com/comment/47625630
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29746537
has text: @Tushar, as you can see in my code, in my main layout, I import jQuery first. Thank you for your suggestion.

http://stackoverflow.com/a/29816274
has body: Your main problem is here: var promise = q.defer(); promises.push(promise); q.defer() does not return a promise. It returns a deferred. var result = q.defer(); promises.push(result.promise); Naming variables correctly is important, you didn't see the mistake because you chose improper variable names. That being said... Avoid for .. in. Arrays have .forEach() or .map(). Instead of checking if (promises.length == events.length), move that part out of the loop. Your function is pretty long and could use a little refactoring. And of course, don't call your deferred objects "deferred" or your promise objects "promise". That's not descriptive. Read through What is the explicit promise construction antipattern and how do I avoid it? (let it sink in, it takes some time) Here's what I would use. var q = require('q'); var qHttp = require("q-io/http"); // -&gt; https://github.com/kriskowal/q-io var FB = { // collect other FB API methods here, maybe transform into module graph: function (id) { var url = 'https://graph.facebook.com/' + id + '?access_token=' + ACCESS_TOKEN; return qHttp.read(url).then(function (data) { return JSON.parse(data.toString()); }); } }; function mergeEvents(req, res, next, events) { return ensureAuthenticated(req, res, next).then(function (auth) { if (!auth) return q.reject("Not authenticated."); return q.all(events.map(function (event) { return FB.graph(event.fb_id).then(function (data) { event.dataValues.fb = data; return event; }); }).then(function (results) { //more code in here... })); }); } Note: If you wrote ensureAuthenticated, modify it to reject directly and on its own instead of resolving with a falsy auth value that you need to check every time you use it. The line if (!auth) ... could be removed after that. Also, the //more code in here... part that deals with the "enhanced" events should probably live outside of mergeEvents.
upvote count: 6
has comment: http://stackoverflow.com/comment/47892461
score: 6
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29813366
accepted answer of: http://stackoverflow.com/q/29813366
type: Answer

http://stackoverflow.com/comment/47636370
score: 0
has text: What's $.inArray(hf, arr) == -1; meant to be doing?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29751589

http://stackoverflow.com/q/29795450
has comment: http://stackoverflow.com/comment/47719203
type: Question
has answer: http://stackoverflow.com/a/29795563
has answer: http://stackoverflow.com/a/29795663
tagged with: javascript
has title: AngularJS ng-show and ng-hide doesn't work
has comment: http://stackoverflow.com/comment/47719264
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47719152
has comment: http://stackoverflow.com/comment/47723419
has answer: http://stackoverflow.com/a/29795529
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47719488
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47720960
has comment: http://stackoverflow.com/comment/47719487
has comment: http://stackoverflow.com/comment/47720986
has comment: http://stackoverflow.com/comment/47722721
has comment: http://stackoverflow.com/comment/47719205
has body: having a problem with angularjs logic here I want to show the login link only when there is no user loggedin, and only show the logout link to logged in user, but it doesnt work properly my HTML Sign in Sign out The sign in is working well this is my Controller login Controller function ($scope, Service){ $scope.auth = true; $scope.signin = function($event, userID, passwd){ Service.signin(userID,passwd).then( function (response){ $scope.auth = true; }); }]). logout Controller function ($scope, Service){ $scope.auth = false; $scope.signout = function($event){ Service.signout().then( function (response){ $scope.auth = false; }); }]). those 2 log out and log in links are basically in my main page. I dont want to create a lot of pages, therefore I want to hide each other. When the user click the log in link, it will run the angularjs router, in this case /login, there is another templateURL for the form and it will be appended directly to the main page. Once the user has typed in the userID and password, the user need to click submit button, this is the code UserID Password Login the reload() function will directly refresh the page. I am using the $window.location.reload()

http://stackoverflow.com/comment/47514998
score: 1
type: AnswerComment
type: Comment
has text: @Dr.Owning Because hexadecimal is base 16. Instead of 10 it'll show `a`, then for 11 show `b`, etc
comment on: http://stackoverflow.com/a/29688929

http://stackoverflow.com/comment/47714287
score: 2
has text: http://stackoverflow.com/questions/6084360/using-node-js-as-a-simple-web-server
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29792771

http://stackoverflow.com/comment/47654679
type: Comment
score: 0
has text: Because I don't know how and that isn't the issue it's the point that it doesn't like document.getElementById("test").innerHTML
type: QuestionComment
comment on: http://stackoverflow.com/q/29761294

http://stackoverflow.com/a/29775277
has comment: http://stackoverflow.com/comment/47681319
type: Answer
has comment: http://stackoverflow.com/comment/47707784
score: 0
accepted answer of: http://stackoverflow.com/q/29773794
has body: I think you are having an issue with the timezone you're in (poland UTC+2 ?) You are dealing with a Javascript Date which is in your current TimeZone GMT+2 So you'll see Thu Apr 30 2015 00:00:00 GMT+0200 but once it sends it back to the server its sent as an ISOString new Date("2015-04-29T22:00:00.000Z") output: Thu Apr 30 2015 00:00:00 GMT+0200 (YOUR TIMEZONE) new Date("2015-04-29T22:00:00.000Z").toISOString() output: "2015-04-29T22:00:00.000Z" So those 2 dates are actually the same
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29773794

http://stackoverflow.com/a/58676395
has comment: http://stackoverflow.com/comment/107449113
has comment: http://stackoverflow.com/comment/108947837
has comment: http://stackoverflow.com/comment/117170194
has body: If you are working with RN > 56.0, just add this prop to your scroll views: ...... ..... That's the only one worked for me.
downvote count: 1
has comment: http://stackoverflow.com/comment/112260056
has comment: http://stackoverflow.com/comment/113089862
type: Answer
score: 83
upvote count: 84
has comment: http://stackoverflow.com/comment/117922798
answers question: http://stackoverflow.com/q/29756217

http://stackoverflow.com/a/59690365
answers question: http://stackoverflow.com/q/29764143
score: 0
has body: You can imagine that you receive a stream of letters and you have to construct words based on some separators (like: spaces, commas, dashes .etc). While reading each character you keep constructing the word in reverse. When you hit any separator you finished the word. Now you just add it to the result and append the separator (this way the separators will not be put at the beginning of the word, but at the end). Here is an example: const inputString = "HELLO, Welcome to Google's meeting. My name is Jean-Piere... Bye"; console.log('Normal words: ', inputString); const result = reverseWords(inputString); console.log('Words reversed: ', result); function reverseWords(str='', separators=' ,.-') { let result = ''; let word = ''; for (const char of str) { if (separators.includes(char)) { result += word + char; word = ''; } else { word = char + word; } } // Adds last remaining word, if there is no separator at the end. result += word; return result; }
type: Answer

http://stackoverflow.com/comment/47676130
score: 0
type: AnswerComment
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/75818/discussion-between-suvroc-and-redrom).
comment on: http://stackoverflow.com/a/29770277

http://stackoverflow.com/comment/47550227
type: QuestionComment
has text: Do you have a media print?
comment on: http://stackoverflow.com/q/29707277
type: Comment
score: 0

http://stackoverflow.com/comment/47699395
type: Comment
score: 0
has text: No, it makes no sense. It assumes that somehow there is JSON already made on the Client side. This is just Object property access.
type: AnswerComment
comment on: http://stackoverflow.com/a/29784416

http://stackoverflow.com/a/29789274
has body: I tested your script in Firefox, Internet Explorer and Chrome, and it worked as it should. You may have exceeded usage quota or you might be using a port that is not authenticated. In the developer console(press F12) you might see an error that states: This site has exceeded its usage quota for Google Maps JavaScript API. See here for details on usage limits: https://developers.google.com/maps/documentation/javascript/usage If you have not exceeded your usage limits, you may be using a port that is not listed in the Allowed Referrers list. Reference: https://developers.google.com/maps/documentation/business/places/auth
answers question: http://stackoverflow.com/q/29789064
score: 0
type: Answer

http://stackoverflow.com/q/29806686
has title: Javascript: Split File into an Array
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47741774
has comment: http://stackoverflow.com/comment/47741586
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/47741292
type: AnsweredQuestion
score: -1
has body: I have a list of english words in a text file. I would like to create an array from this file separated by words: var dictionaryWords = ["Apple","Orange","Banana","Strawberry"] How can I use do this in javascript? and please try to explain in beginner terms since I'm still new to this! Thanks!
type: Question
has comment: http://stackoverflow.com/comment/47742014
accepted answer: http://stackoverflow.com/a/29806819
tagged with: javascript
has answer: http://stackoverflow.com/a/29806819

http://stackoverflow.com/q/29757038
type: Question
has title: Any advantage of jquery .submit() vs jquery .click() if calling .post() in the event?
tagged with: javascript
tagged with: forms
answer count: 2
upvote count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47646995
has answer: http://stackoverflow.com/a/29757271
has answer: http://stackoverflow.com/a/29757091
type: UnansweredQuestion
has body: I have a modal window with address fields in it. I'm trying to understand if I even need a form tag wrapped around my address fields? When I press the submit/save button, I'm calling .post() to send the address to the controller and if the address is found with Google Maps I update/save the address and send back some data to fill in the map. I also close the modal. If the address isn't found I just show an error message. Do I really need a ajax.submit here with a form tag wrapped around the fields? What advantage does it provide me for the situtaion I have?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47646554
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47646405

http://stackoverflow.com/q/29777824
upvote count: 8
tagged with: elasticsearch
tagged with: meteor
score: 8
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/49602854
has answer: http://stackoverflow.com/a/31974645
type: Question
has title: Search tool in Meteor JS
has body: Im quite a newbie when it comes to DBs and search so please bear with me. Im trying to implement a search function in Meteor app. Ive checked through atmosphere and chanced upon these 4 options. Mattodem easy search Search Source Elastic search package on Atmosphere (heard this is dated) Elastic big data package on Atmosphere My needs are for a simple search, able to handle larger data sets that may have data nesting. For example a task, may have comments or links etc. (Full text and more than regex query will be good) I read that for easy search, even with some form of elastic or Mongodb application, seems to be application only for a single Mongo collection?For example what if I wanted to search across Dinosaurs = new Meteor.Collection('dinosaurs'); and Mammals = new Meteor.Collection('mammals');? Appreciate any advice on the pros and cons on the 4 options above? 1 seems relative easy to implement but I,m not sure what it means by using elastic engine here. If I were to implement elastic, how do I go about doing it in Meteor? And would it differ from implementing a Elasticsearch HTTP API? Similarly for Search Source, it supports Elastic too here. Honestly I have no clue on the differences.
has comment: http://stackoverflow.com/comment/51893141
tagged with: search
tagged with: mongodb
accepted answer: http://stackoverflow.com/a/31974645
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/47829402
type: Comment
score: 0
type: AnswerComment
has text: Then using 'for key in object' which dynamically creates the methods from executableFunctions inside Cmd. Interesting approach that I don't fully understand yet but that;s what google is for. I did try implementing it into my code but I keep getting 'Command not found' which means I need to also adjust the first part of my script which checks if the command exists before trying to execute it. And thank you for taking the time to help me.
comment on: http://stackoverflow.com/a/29831204

http://stackoverflow.com/comment/47568618
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29716602
has text: Quotes and parenthesis are just the right formatting, where not meant to fix anything. Your function gets called because calling your function is the only thing that script does, if you don't need it you should remove it.
score: 0

http://stackoverflow.com/comment/47657589
type: Comment
type: QuestionComment
has text: ok... first you need to realise that ruby parses the erb and runs all the ruby *first* and generates some html+js code... that then gets sent to the browser and the browser runs the js that has already been created at this point. You can't call the ruby from the javascript, because by that stage, there is no ruby left... just javascript
score: 1
comment on: http://stackoverflow.com/q/29762910

http://stackoverflow.com/q/29716543
tagged with: javascript
score: 4
has title: Form Validation using JavaScript?
has body: I'm trying to use form validation using JavaScript, however I don't seem to get any response, not even an alert even though it's there. Example Form Name: Age: Email:
answer count: 10
has answer: http://stackoverflow.com/a/37856252
favorite count: 0
has comment: http://stackoverflow.com/comment/47567737
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29716993
has answer: http://stackoverflow.com/a/77830844
has answer: http://stackoverflow.com/a/29717516
downvote count: 1
has answer: http://stackoverflow.com/a/42395860
has answer: http://stackoverflow.com/a/29716681
has comment: http://stackoverflow.com/comment/47568943
has answer: http://stackoverflow.com/a/77802116
upvote count: 5
tagged with: forms
has answer: http://stackoverflow.com/a/56711794
has answer: http://stackoverflow.com/a/77827882
type: Question
tagged with: validation
has answer: http://stackoverflow.com/a/78248609

http://stackoverflow.com/a/29825636
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/47778661
has comment: http://stackoverflow.com/comment/47778022
has body: you should take a look at the .css() function of jQuery like $(".tile-group.six").css('margin-left', '50px'); and so on
type: Answer
has comment: http://stackoverflow.com/comment/47777884
answers question: http://stackoverflow.com/q/29825536
score: 4
has comment: http://stackoverflow.com/comment/47777980

http://stackoverflow.com/comment/47722890
has text: check this [question](http://stackoverflow.com/questions/5052543/how-to-fire-ajax-request-periodically) out, you should try to google before posting questions here...
score: 0
comment on: http://stackoverflow.com/q/29797316
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29836385
downvote count: 1
type: Question
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/29836671
upvote count: 0
accepted answer: http://stackoverflow.com/a/29836671
answer count: 1
linked to: http://stackoverflow.com/q/22501705
favorite count: 0
tagged with: ajax
tagged with: postgresql
has body: I'm currently using AJAX and PHP to send updates to a postgreSQL database. Say I had 1000 users all sending one ajax post request per second to a php script. Say that php script opened a connection, executed two SQL update commands every time it was run, and then closed the connection. That would be 1000 connections per second - I'm guessing that isn't going to work out very well for me. If it's not, how should I deal with it? I've read that node.js is a good solution - If it is are there any good guides for dealing with updating a postgreSQL from a webpage using javascript? I already have data (some json, some other) in the postgreSQL database and it needs to stay in there, so ideally I would be able to just change the way the handshake between javascript and the database works and leave the rest the same. As a side question: How many connections per second should I expect to be able to handle if that's my only bottleneck? And if there are more than the max 150 connections does it just queue the connection or does it do something obnoxious like post a message saying 'max connections hit' and not allow page loads?
tagged with: php
tagged with: node.js
type: AnsweredQuestion
has title: Solution to many ajax/php requests on postgresql database

http://stackoverflow.com/comment/47753102
comment on: http://stackoverflow.com/q/29812021
type: Comment
type: QuestionComment
has text: I assure you, `getElementById` is perfect for getting elements by ID.
score: 0

http://stackoverflow.com/q/29775527
has comment: http://stackoverflow.com/comment/47681520
tagged with: asp.net
favorite count: 0
has title: How to make number to be counting down each second
has comment: http://stackoverflow.com/comment/47681637
accepted answer: http://stackoverflow.com/a/29777985
has body: I have this code to do this task: if no activity from user (mousemove and keypress) for 10 seconds then display a dialog (Jquery UI dialog) to warn and let user know they will be redirected to another page in the next 5 seconds unless they do something. How do I make the "5" in "You will be automatically redirected to ... after 5 seconds." to be counting down as 5, 4, 3, 2, 1 => then redirect ? html <asp:Button ID="DoNothing" runat="server" Enabled="false" Style="display: none;" /> Hold your mouse and don't press any key for 10 seconds, an dialog alert will be displayed. Session About To Timeout You will be automatically redirected to google after 5 seconds. To stay on this page move your mouse or press any key.
has comment: http://stackoverflow.com/comment/47682356
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29775962
upvote count: 3
has answer: http://stackoverflow.com/a/29775962
linked to: http://stackoverflow.com/q/3076414
type: Question
answer count: 2
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29777985
score: 3
downvote count: 0

http://stackoverflow.com/comment/47687127
comment on: http://stackoverflow.com/a/29777240
type: AnswerComment
has text: I think in that case your problem might be elsewhere, did you try M.Doye's solution?
type: Comment
score: 0

http://stackoverflow.com/comment/47829187
comment on: http://stackoverflow.com/q/29840674
score: 0
type: QuestionComment
has text: @Bergi Yes, I have read that before, thanks, but my problem is really with requirejs, not just inheritance of the RVP, or protected variables. Hmm, I'll look into why it's not working, thanks
type: Comment

http://stackoverflow.com/q/29714175
tagged with: javascript
type: UnansweredQuestion
has title: Node.js MySQL: Select-statement depending on query string?
downvote count: 0
score: 1
favorite count: 0
type: Question
has body: I'm building an auction house. I'm using the nodejs-mysql package and I have this nodejs server.js-code for the main page, where multiple auctions are displayed: // loop var pollingLoop = function() { // Doing the database query var query = connection.query('SELECT a.`id`,a.`product_id`,a.`price`,a.`random`,a.`price_end`,TIMESTAMPDIFF(SECOND,NOW(),a.`date_end`) AS duration,p.`price_retail` FROM `auctions` AS a LEFT JOIN `products` AS p ON p.`id` = a.`product_id` WHERE TIMESTAMPDIFF(SECOND,NOW(),a.`date_end`) &gt; "-1" ORDER BY `duration` DESC,`id` DESC'), auctions = []; How can I accomplish that this query is changed when a $_GET['id'] is available to another SELECT-statement with a WHERE-condition? Because I want to add WHERE auction='$_GET['id']' for a single auction then (but server-side). Is there a way to make it more readable? Because when I press ENTER the SELECT-statement won't work at all. This is how it looks on the nodejs-server-file server.js: https://i.sstatic.net/37fDl.jpg
tagged with: php
tagged with: node.js
tagged with: mysql
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/29714296

http://stackoverflow.com/comment/47555241
type: QuestionComment
has text: Add an additional field "counter" to your page object in DB. Update it with +1 on every request for that page.
comment on: http://stackoverflow.com/q/29708416
score: 0
type: Comment

http://stackoverflow.com/comment/47765416
type: QuestionComment
has text: I found out that I did some stupid mistake by remove with the class name. Fixed it now. Thank you
score: 1
comment on: http://stackoverflow.com/q/29818759
type: Comment

http://stackoverflow.com/comment/47519455
has text: Oh, put it in a conditional and return only if that call returns true.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29691435

http://stackoverflow.com/comment/47759049
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29815866
has text: remove the hidden one from the dom, you can append it back later if needed.
score: 0

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

http://stackoverflow.com/a/29763569
type: Answer
downvote count: 0
has body: It would need to be something like this: Question 2 Write a function snooze that takes on parameter, day, and returns a boolean: true if day is a weekend, false if otherwise. If invalid argument/no argument, return false. The parameter day may be lowercase, uppercase, or mixed. */ function snooze(day){ day = (day || "").toString().toLowerCase(); var Sat = 'saturday'; var Sun = 'sunday'; if (day === Sat){ return true; } else if (day === Sun){ return true; } else { return false; } } console.log(snooze('Monday')) // false console.log(snooze('tuesday')) // false console.log(snooze('SUNDAY')) // true console.log(snooze('Saturday')) // true console.log(snooze('October')) // false console.log(snooze()) // false console.log(snooze('SatUrDaY')) // true For your last question, one way is to use a for loop with indexOf(), passing any index >=0 back into the 'fromIndex' parameter. developer.mozilla.org/en/docs/Web/JavaScript/Reference/… Another way is to split on the character like this: "ababccb".split("b").length-1
score: 1
has comment: http://stackoverflow.com/comment/47658769
answers question: http://stackoverflow.com/q/29763501
upvote count: 1

http://stackoverflow.com/q/29833317
tagged with: tracking
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47795411
has comment: http://stackoverflow.com/comment/47795068
tagged with: camera
has comment: http://stackoverflow.com/comment/47796013
has comment: http://stackoverflow.com/comment/47795000
has body: So am am trying to develop an app/website which accesses the phone's camera and detects motion. But I have simply no idea how I would do this efficient and accurate. The timing is important so can not have huge above (1-20ms). The info I get will be sent to a Node.js server and compared to another camera with motion tracking. So in short. What would be an efficient way to detect motion from a mobile camera in javascript then trigger a function? :) Sorry if it is kind of messy, no idea how to formulate the question. So just leave a comment and I will see if I can clear up :P
type: Question
has title: motion tracking phone camera javascript
has comment: http://stackoverflow.com/comment/47795607
has comment: http://stackoverflow.com/comment/47793485
has comment: http://stackoverflow.com/comment/47795340
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47795014
tagged with: motion

http://stackoverflow.com/a/29713145
has comment: http://stackoverflow.com/comment/47572109
type: AcceptedAnswer
downvote count: 0
has body: use below code. add .off("change") before attach event. read more about .off() Remove an event handler. I assume you attach change event every time when model box is open. arresting_officers_table.off("change").on("change", ":checkbox", function() { if($(this).is(':checked')){ console.log('Adding!'); //this log fires twice when clicking only 1 checkbox //alert('checked! ' + $(this).attr('data-value')); arresting_officers_ids.push($(this).attr('data-value')); arresting_officers_names.push($(this).attr('data-name')); } else { //remove item var idx = arresting_officers_ids.indexOf($(this).attr('data-value')); arresting_officers_ids.splice(idx, 1); arresting_officers_names.splice(idx, 1); } }); other option is attach event every time you can use Event Delegation to attach event to dynamic generated element . you can read more about Event Delegation Event delegation allows us to attach a single event listener, to a parent element, that will fire for all descendants matching a selector, whether those descendants exist now or are added in the future.
accepted answer of: http://stackoverflow.com/q/29713116
score: 8
upvote count: 8
answers question: http://stackoverflow.com/q/29713116
type: Answer
has comment: http://stackoverflow.com/comment/47561516
has comment: http://stackoverflow.com/comment/47571899

http://stackoverflow.com/q/29822183
has answer: http://stackoverflow.com/a/29822318
accepted answer: http://stackoverflow.com/a/29822318
possible better answer: http://stackoverflow.com/a/29822618
has answer: http://stackoverflow.com/a/29822618
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47770572
has comment: http://stackoverflow.com/comment/47770596
type: Question
tagged with: javascript
has title: Jquery select option default option text
score: 0
has body: I'm trying to populate several select boxes having the same class using jQuery. This is my code populateFieldMapping: function (data,obj) { jQuery('.field-mapping select').each(function() { var option = ' ' + "please select a field" + ' '; jQuery.each(data, function (i, res) { option += ' ' + res.name + ' ' }); $(this).html(option); obj.select2(); }); }, My HTML Everything is working fine except I am only getting the "Please select a field" default option for only the first select box. What could be wrong? I am getting all values in every select box. obj = $('.form-control');
answer count: 2
has comment: http://stackoverflow.com/comment/47770652
tagged with: jquery
tagged with: jquery-selectbox
has comment: http://stackoverflow.com/comment/47770581

http://stackoverflow.com/a/29733071
type: Answer
has comment: http://stackoverflow.com/comment/47602455
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29731686
has body: As Barmar pointed out, you're writing to html and &lt;path&gt; resembles valid html. You can do this currentFormula.html('&lt;strong&gt;Current formula:&lt;/strong&gt;&lt;br&gt;' + wff.ascii.replace(/&gt;/g, "&amp;gt;").replace(/&lt;/g, "&amp;lt;")) As an additional note, backticks are used on StackOverflow like this: `sample code` which produces sample code. This feature is available in comments as well. Alternatively, in posts (not comments), you can indent each line with a tab or four spaces (easily done by pressing { } in the post editor.
has comment: http://stackoverflow.com/comment/47600201
answers question: http://stackoverflow.com/q/29731686

http://stackoverflow.com/comment/47750006
score: 3
comment on: http://stackoverflow.com/q/29811001
type: QuestionComment
type: Comment
has text: Welcome to SO. It really helps to post example code of what you have tried. Also any errors or what you're expecting to see.

http://stackoverflow.com/comment/47781340
comment on: http://stackoverflow.com/q/29827439
type: Comment
score: 0
has text: The custom function `CapFirstWord` cannot be chained to a jQuery object. You can pass the selector to it `CapFirstWord ($('.pStyle'))`
type: QuestionComment

http://stackoverflow.com/comment/47766063
comment on: http://stackoverflow.com/a/29818002
type: AnswerComment
has text: http://jsfiddle.net/aups693a/2/ I changed the xaxis from ordinal to linear and reduced the width of the bars a little bit, but you can tweak those values easily
type: Comment
score: 1

http://stackoverflow.com/comment/47642904
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29689981
has text: No I never got the notification. Checking now.
type: Comment

http://stackoverflow.com/comment/47666610
has text: @MairajAhmad ? I don't understand what you mean sorry
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29767403

http://stackoverflow.com/a/29727905
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29727781
type: Answer
has body: Solved by changing the title attribute with name. Issue is related to tooltip plugin. When the user hover the link it removes the title from the link and shows it in a tooltip. So, when the link is clicked actually it has no title specified.

http://stackoverflow.com/q/29778716
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29778818
score: 0
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/29779098
downvote count: 1
linked to: http://stackoverflow.com/q/5877084
favorite count: 0
has answer: http://stackoverflow.com/a/29778818
has title: Match all characters up until a word boundary
tagged with: regex
has comment: http://stackoverflow.com/comment/47688025
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29778832
accepted answer: http://stackoverflow.com/a/29778832
has body: Based off Regex Until But Not Including, I'm trying to match all characters up until a word boundary. For example - matching apple in the following string: apple&lt; I'm doing that using: a negated set [^] with a word boundary \b and a plus + repeater Like this: /a[^\b]+/ Which should look for an "a" and then grab one or more matches for any character that is not a word boundary. So I would expect it to stop before &lt; which is at the end of the word Demo in Regexr Demo in StackSnippets var input = [ "apple&lt;", "apple/" ]; var myRegex = /a[^\b]+/; for (var i = 0; i &lt; input.length; i++) { console.log(myRegex.exec(input[i])); } Couple other regex strings I tried: I can use a negated word boundary or a negated set with a regular word boundary: /a[\B]+/ /a[^\b]+/ I can specify several possible word ending characters and use them in a negated set: /a[^|"&lt;&gt;\-\\\/;:,.]+/ I can also look for a postive set and just restrict it to return for regular letters: /a[\w]+/ /a[a-zA-Z]+/ But I'd like to know how to do it for a word boundary if that's possible. Here's a MDN's listing of word boundary and the characters that it constitutes
linked to: http://stackoverflow.com/q/3850074
type: Question

http://stackoverflow.com/comment/47553272
has text: @JoseRicardoBustosM. why is that necessary? Is it generalized to higher-dimension arrays?
comment on: http://stackoverflow.com/q/29708636
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/29693378
has body: iIt adds a new tag to your DOM (i.e. the HTML you write). Just like if you'd include jQuery by Then, instead of having $() or jQuery() functions available you can use your JSONP functions like for example MyCallback() in your further code.
answers question: http://stackoverflow.com/q/29692927
score: 0
type: Answer

http://stackoverflow.com/comment/50416748
type: QuestionComment
comment on: http://stackoverflow.com/q/29831437
score: 0
has text: I have not. Please came back and add a response if you ever find it.
type: Comment

http://stackoverflow.com/q/29763270
has title: Angular directives link function
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47658170
type: AnsweredQuestion
score: 3
tagged with: jqlite
upvote count: 3
has body: I'm new to Angular. I was trying to learn directives. In my directive's link function I log my element and see that its an array. why it's an array? HI JS: angular.module('custom.directive').directive('mouseEnter', function () { return { restrict: 'E', link: function (scope, element) { console.log(element);// this line prints an array! element[0].onmouseover = function () { console.log('Mouse Entered!'); }; } } }); In which case this array's length can be more than 1!!
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: dom-events
has answer: http://stackoverflow.com/a/29763404
accepted answer: http://stackoverflow.com/a/29763404

http://stackoverflow.com/a/29734249
type: Answer
has comment: http://stackoverflow.com/comment/47601584
has comment: http://stackoverflow.com/comment/47601637
answers question: http://stackoverflow.com/q/29734014
has comment: http://stackoverflow.com/comment/47601931
has comment: http://stackoverflow.com/comment/47601740
has comment: http://stackoverflow.com/comment/47601674
score: 0
upvote count: 1
has body: Pure Javascript version: function multiply(x) { var result = document.getElementById('result'); result.innerHTML = x.value * 100; } This is the jQuery version: $(document).ready(function() { $('#NumToBMultiplied').on('change',function(){ $('#result').text($(this).val()*100); }); });
downvote count: 1
has comment: http://stackoverflow.com/comment/47601694

http://stackoverflow.com/comment/68766917
comment on: http://stackoverflow.com/a/29830131
has text: You sir, save my day. In the Dropzone FAQ don't say that it need to be the mockFile and the whole url as second parameter. Thanks
score: 0
type: AnswerComment
type: Comment

coffeescript
tags question: http://stackoverflow.com/q/29759226
tags question: http://stackoverflow.com/q/29824190
tags question: http://stackoverflow.com/q/29764267
tags question: http://stackoverflow.com/q/29794911
tags question: http://stackoverflow.com/q/29794915
tags question: http://stackoverflow.com/q/29721851
tags question: http://stackoverflow.com/q/29778406
tags question: http://stackoverflow.com/q/29802301
tags question: http://stackoverflow.com/q/29703420
tags question: http://stackoverflow.com/q/29769654
tags question: http://stackoverflow.com/q/29844662
type: Tag
tag name: coffeescript
tags question: http://stackoverflow.com/q/29810604
tags question: http://stackoverflow.com/q/29844713
tags question: http://stackoverflow.com/q/29796416
tags question: http://stackoverflow.com/q/29730864
tags question: http://stackoverflow.com/q/29767618
tags question: http://stackoverflow.com/q/29705878
tags question: http://stackoverflow.com/q/29693249
tags question: http://stackoverflow.com/q/29723259
tags question: http://stackoverflow.com/q/29775484

http://stackoverflow.com/comment/47626993
type: AnswerComment
score: 0
type: Comment
has text: Ok wait, if I use 5 digit format (DD/MM/YYYYY), the incorrect assumption will still be 5 digits (even if 6 or more were entered), so the validation will serve it's purpose. Thanks for your help.
comment on: http://stackoverflow.com/a/29746038

http://stackoverflow.com/comment/47647753
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29757612
has text: If you're talking about the mouse in the element, it should be `a:hover` not `a.hover`. The dot means it has the class `hover`, not the state.

http://stackoverflow.com/q/29833592
tagged with: embed
tagged with: javascript
has comment: http://stackoverflow.com/comment/47913102
type: UnansweredQuestion
tagged with: twitter
has body: Okay hi there! I currently have a script on my vBulletin forum that one of my friends made who is unfortunately unavailable to help me out. I know this is pretty straight forward and I have been fiddling with it all day to get it to work with not very much success. See below. $embed_player = ' '; $post['message'] = preg_replace('#((http://instagram.com)?/(embed/([-|~_0-9A-Za-z]+)|p\/([-|~_0-9A-Za-z]+)&?.*?)<\/a>#i', $embed_player, $post['message']); The script above works on the basis, when a user posts a link directly to an instagram video it will automatically embed the link into their post on my vBulletin. What I am trying to do is when a user posts a full tweet URL (ie https://twitter.com/greigeh/status/590850852161740801 - the number being the "TWEETID") it will automatically embed this. The embedding code for a tweet is on my forum is: So ultimately I tried putting this code into the script above except I'm having trouble getting the preg_replace to work. I need it to pretty much ignore the whole URL except the TWEETID but i've came to no avail. Is this an easy change or am I missing something here?
answer count: 0
downvote count: 0
tagged with: vbulletin
score: 1
favorite count: 0
type: Question
tagged with: php
has title: Automatically embed twitter link in vBulletin
upvote count: 1

arrays
tags question: http://stackoverflow.com/q/29832177
tags question: http://stackoverflow.com/q/29785881
tags question: http://stackoverflow.com/q/29729327
tags question: http://stackoverflow.com/q/29751887
tags question: http://stackoverflow.com/q/29739914
tags question: http://stackoverflow.com/q/29838438
tags question: http://stackoverflow.com/q/29784475
tags question: http://stackoverflow.com/q/29691071
tags question: http://stackoverflow.com/q/29721971
tags question: http://stackoverflow.com/q/29712116
tags question: http://stackoverflow.com/q/29812233
tags question: http://stackoverflow.com/q/29727043
tags question: http://stackoverflow.com/q/29833163
type: Tag
tags question: http://stackoverflow.com/q/29715709
tags question: http://stackoverflow.com/q/29810170
tags question: http://stackoverflow.com/q/29828613
tags question: http://stackoverflow.com/q/29715271
tags question: http://stackoverflow.com/q/29819864
tags question: http://stackoverflow.com/q/29828578
tags question: http://stackoverflow.com/q/29779683
tags question: http://stackoverflow.com/q/29722601
tags question: http://stackoverflow.com/q/29799916
tags question: http://stackoverflow.com/q/29798226
tags question: http://stackoverflow.com/q/29722742
tags question: http://stackoverflow.com/q/29723088
tags question: http://stackoverflow.com/q/29796314
tags question: http://stackoverflow.com/q/29720104
tags question: http://stackoverflow.com/q/29834885
tags question: http://stackoverflow.com/q/29802787
tags question: http://stackoverflow.com/q/29779953
tags question: http://stackoverflow.com/q/29771181
tags question: http://stackoverflow.com/q/29796162
tags question: http://stackoverflow.com/q/29794051
tags question: http://stackoverflow.com/q/29759206
tags question: http://stackoverflow.com/q/29779445
tags question: http://stackoverflow.com/q/29777118
tags question: http://stackoverflow.com/q/29699149
tags question: http://stackoverflow.com/q/29844946
tags question: http://stackoverflow.com/q/29781468
tags question: http://stackoverflow.com/q/29726713
tags question: http://stackoverflow.com/q/29690943
tags question: http://stackoverflow.com/q/29793262
tags question: http://stackoverflow.com/q/29713472
tags question: http://stackoverflow.com/q/29835036
tags question: http://stackoverflow.com/q/29704241
tags question: http://stackoverflow.com/q/29803544
tags question: http://stackoverflow.com/q/29745161
tags question: http://stackoverflow.com/q/29790591
tags question: http://stackoverflow.com/q/29776996
tags question: http://stackoverflow.com/q/29713918
tags question: http://stackoverflow.com/q/29697919
tags question: http://stackoverflow.com/q/29692844
tags question: http://stackoverflow.com/q/29697872
tags question: http://stackoverflow.com/q/29805011
tags question: http://stackoverflow.com/q/29829239
tags question: http://stackoverflow.com/q/29728358
tags question: http://stackoverflow.com/q/29833849
tags question: http://stackoverflow.com/q/29716258
tags question: http://stackoverflow.com/q/29827086
tags question: http://stackoverflow.com/q/29738068
tags question: http://stackoverflow.com/q/29762919
tags question: http://stackoverflow.com/q/29829023
tags question: http://stackoverflow.com/q/29713001
tags question: http://stackoverflow.com/q/29719329
tags question: http://stackoverflow.com/q/29733954
tags question: http://stackoverflow.com/q/29721044
tags question: http://stackoverflow.com/q/29768810
tags question: http://stackoverflow.com/q/29820749
tags question: http://stackoverflow.com/q/29715718
tags question: http://stackoverflow.com/q/29722100
tags question: http://stackoverflow.com/q/29751598
tags question: http://stackoverflow.com/q/29787187
tags question: http://stackoverflow.com/q/29700737
tags question: http://stackoverflow.com/q/29838799
tags question: http://stackoverflow.com/q/29836541
tags question: http://stackoverflow.com/q/29810169
tags question: http://stackoverflow.com/q/29690015
tags question: http://stackoverflow.com/q/29739397
tags question: http://stackoverflow.com/q/29811552

http://stackoverflow.com/comment/47630677
type: QuestionComment
comment on: http://stackoverflow.com/q/29745089
has text: It is not very clear what you want. Maybe you could setup an example of some kind?
score: 0
type: Comment

http://stackoverflow.com/comment/47589123
comment on: http://stackoverflow.com/a/29727508
type: AnswerComment
has text: I meant somthing like this, if you dont understand me https://jsfiddle.net/dimitrioglo/ebkc9dzL/14/
score: 0
type: Comment

http://stackoverflow.com/a/29706163
accepted answer of: http://stackoverflow.com/q/29705687
type: AcceptedAnswer
downvote count: 0
has body: I'm still not quite sure why you're handling the JSON in this fashion but if it has to be done this way, then you'll need to use recursion to access the data. Assuming I mapped your object correctly, the example below should provide you with a method for doing this: var data = { sections: [ { subsections: [] }, { subsections: [ { items: [ { citation: { paragraph: "Citation by Warlock" } } ] } ] } ] }; var string = "sections.1.subsections.0.items.0.citation.paragraph", parts = string.split('.'); function getValue(tree, index) { if(index &lt; (parts.length - 1)) { return getValue(tree[parts[index]], index + 1); } else { return tree[parts[index]]; } } function setValue(tree, index, newValue) { if(index &lt; (parts.length - 1)) { setValue(tree[parts[index]], index + 1, newValue); } else { tree[parts[index]] = newValue; } } alert(getValue(data, 0)); setValue(data, 0, "New Citation By Warlock"); alert(getValue(data, 0)); The idea is that the getValue(...); function steps one layer deep into your JSON and then recursively calls itself. This allows the data to be accessed one step at a time until the last part is retrieved. The value is then returned via the recursion in all the previous function calls. The same idea is true for setting the value. The setValue(...); function steps into the JSON one layer at a time passing the new value to set until it's reached the last nested layer. The value is then set for the specified property. EDIT: A better implementation would be to pass the parts array into the getValue(...); and setValue(...); function to eliminate external dependencies. Then, within the function shift the array's data values to step through the nested layers. This eliminates the need for index tracking based on the original array's values: var data = { sections: [ { subsections: [] }, { subsections: [ { items: [ { citation: { paragraph: "Citation by Warlock" } } ] } ] } ] }; var string = "sections.1.subsections.0.items.0.citation.paragraph", parts = string.split(…
has comment: http://stackoverflow.com/comment/47550735
type: Answer
answers question: http://stackoverflow.com/q/29705687
score: 3
upvote count: 3

http://stackoverflow.com/comment/47563479
type: Comment
comment on: http://stackoverflow.com/a/29714160
score: 0
type: AnswerComment
has text: @AR7 This looks like exactly what he is looking for. The result here will be $scope.list1=[] and $scope.list2=[] as 2 separate arrays. The linked approach would be for implementations where the dot notation is taken into consideration.

http://stackoverflow.com/comment/47584113
comment on: http://stackoverflow.com/a/29724705
score: 0
has text: Thanks, I'm using a [package](https://github.com/meteoric/meteor-ionic) that requires me to define the `path` name, ie: `{{> ionTab title="Account" path="account"}}` which I dont think can take a parameter
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29733573
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47600873
tagged with: google-chrome-extension
answer count: 1
linked to: http://stackoverflow.com/q/17601615
favorite count: 0
accepted answer: http://stackoverflow.com/a/29735177
has comment: http://stackoverflow.com/comment/47600388
has title: OnClick event doesn't work in my chrome extension
duplicate of: http://stackoverflow.com/q/17601615
has body: I have made a little extension which inserts buttons into the html page and I have inserted onClick events on each button, but when i press them they don't work. I have found some topics on this site and a guy was talking about addEventListener but i couldn't use it. My code is something like this: var setButton = " set "; var str = getRow.insertCell(-1); str.innerHTML = setButton;
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47602479
downvote count: 2
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29735177

http://stackoverflow.com/a/29793629
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/29793498
accepted answer of: http://stackoverflow.com/q/29793498
has body: You could do window.stop(); for most browsers besides Internet Explorer. For IE, I had to use document.execCommand('Stop');
type: Answer

http://stackoverflow.com/comment/47721368
type: Comment
has text: see the updated fiddle, i have updated the answer, see if that can be of any help
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29796320

http://stackoverflow.com/comment/47773208
type: Comment
score: 1
has text: Also, jQuery recommends to use .on() over .bind() since jQuery 1.7+ http://api.jquery.com/on/
comment on: http://stackoverflow.com/q/29823328
type: QuestionComment

http://stackoverflow.com/comment/47556617
type: Comment
comment on: http://stackoverflow.com/a/29709620
score: 0
type: AnswerComment
has text: oh i know a unique name, but is format generally correct, name1,name2,name3}

http://stackoverflow.com/comment/47556393
type: Comment
has text: Also, how would I redirect the browser's HTTP requests to my proxy server? I don't have control of the creation of the HTTP request by the Flash game.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29709883

http://stackoverflow.com/comment/47729079
type: QuestionComment
comment on: http://stackoverflow.com/q/29799696
has text: Thanks for your reply. I have updated the code snippet. I create the link element in JS and set the attribute including **csvUrl** to that download link directly.
score: 0
type: Comment

http://stackoverflow.com/comment/47707391
comment on: http://stackoverflow.com/q/29789158
score: 1
type: Comment
has text: Have you made any attempt(s) of doing this yourself? If so can you edit your question and show your attempt(s) and maybe someone can explain why your attempt isn't working and offer a solution. Thanks.
type: QuestionComment

http://stackoverflow.com/comment/47656818
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29762429
type: Comment
has text: Sure thing. I just added it to my answer.

http://stackoverflow.com/q/29791053
has answer: http://stackoverflow.com/a/29792170
has comment: http://stackoverflow.com/comment/47712278
has comment: http://stackoverflow.com/comment/47711332
has comment: http://stackoverflow.com/comment/47711000
has comment: http://stackoverflow.com/comment/47712010
type: Question
has title: jquery declare element before it's loaded
has comment: http://stackoverflow.com/comment/47711064
has comment: http://stackoverflow.com/comment/47712653
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47711477
linked to: http://stackoverflow.com/q/2844565
has answer: http://stackoverflow.com/a/29791992
has body: I use templates in script tags. In javascript "class" first i'm declaring all elements I will work with. And if some elements will be added from template - they wont work. Paste here var $el = $('#el'), goBtn = $('#go'), $container = $('#container'), newTpl = $('#new'); goBtn.on('click', function(){ $container.html(newTpl.html()); alert($el.length); // return 0! }); https://jsfiddle.net/0fat5htg/ So how to declare all possible elements before they are loaded?
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/comment/47644196
comment on: http://stackoverflow.com/q/29724951
type: Comment
type: QuestionComment
score: 0
has text: I see. That link triggers a download of the backup file. The backup is a .zip. So obviously this is not a direct link to the actual file. But the response is the .zip, which I'm not getting. Putting that URL into a browser triggers the file download immediately.

http://stackoverflow.com/comment/47789841
type: Comment
has text: There is a session_start() at the beginning of every page.
comment on: http://stackoverflow.com/q/29831625
score: 0
type: QuestionComment

http://stackoverflow.com/a/29799220
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29793724
answers question: http://stackoverflow.com/q/29793724
type: Answer
has body: You want to set the digitsAfterDecimal option to 3 (it defaults to 2): g = new Dygraph( document.getElementById("graph"), [ [1,10,10], [2,20.11,20], [3,10.111,10], [4,20,20]], { labels: [ "x", "A", "B" ], digitsAfterDecimal: 3 });
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/29719029
has title: Open all links on page in new tabs and track those tabs
tagged with: javascript
has comment: http://stackoverflow.com/comment/47705383
tagged with: firefox-addon
answer count: 1
downvote count: 0
has body: I know I cannot directly access the DOM from the main function in a firefox addon with the SDK, and therefore I cannot obtain the href values from the a tags directly either. How can I make my addon open all of the links on a page as new tabs and add those to an array? I don't want new tabs manually opened by the user to be tracked, just the ones created by this addon.
has comment: http://stackoverflow.com/comment/47649129
favorite count: 0
type: UnansweredQuestion
tagged with: firefox-addon-sdk
has answer: http://stackoverflow.com/a/29921061
score: 1
linked to: http://stackoverflow.com/q/29748993
has comment: http://stackoverflow.com/comment/47572900
upvote count: 1
type: Question

http://stackoverflow.com/comment/47575308
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29720340
has text: I repeat, what about the "Network" tab? If you do not see anything there then the request was never sent. If the request was sent then you can inspect it further, to see what happened.
score: 0

http://stackoverflow.com/comment/47677068
comment on: http://stackoverflow.com/q/29773273
score: 0
type: Comment
type: QuestionComment
has text: also your code says that you have same ids for multiple elements in the page.

http://stackoverflow.com/comment/47525586
comment on: http://stackoverflow.com/a/29694485
score: 0
type: AnswerComment
type: Comment
has text: Yes, the quantity is working fine, that's not the issue. Please reread my previous comment I changed the wording so maybe my question is more clear now.

http://stackoverflow.com/comment/47615161
type: QuestionComment
comment on: http://stackoverflow.com/q/29740966
score: 2
has text: Chances are your `base_url` in your config file is set to something like `'http://localhost/ssmis/'`, yet you're trying to access the site on `192.168.43.159/ssmis`, which is clearly **not** the same as `'http://localhost/ssmis/'`. Try changing your `base_url` to `192.168.43.159/ssmis/`.
type: Comment

http://stackoverflow.com/q/29693987
answer count: 0
score: 1
has body: hi i am using kendo list view in my code and want to dynamic binding with remote data source , and i want to bind the data on button click but its showing two error and not hitting on url but hitting on function, and url is also correct &lt;div id="collapseFive" class="panel-collapse collapse in"&gt; &lt;div class="panel-body"&gt; &lt;div class="" id="listView"&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt; &lt;script&gt; function GuelsiderSearch() { var dataSource = new kendo.data.DataSource({ transport: { read: { url: "/Gulesider/Search", dataType: "json", type:"GET" } }, }); $("#listView").kendoListView({ dataSource: dataSource, template: kendo.template($("#template").html()) }); }
type: Question
has comment: http://stackoverflow.com/comment/47533499
tagged with: asp.net-mvc
tagged with: javascript
has comment: http://stackoverflow.com/comment/47524791
tagged with: kendo-ui
downvote count: 0
has comment: http://stackoverflow.com/comment/57801801
linked to: http://stackoverflow.com/q/23354554
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has title: Uncaught TypeError: Cannot read property 'replace' of undefined or in kendo list view dynamic binding

http://stackoverflow.com/q/29774238
type: Question
tagged with: broadcastreceiver
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29798067
has body: First of all, I'm working with some specific API ( Grand Stream GXV3275 phone ) which requires that Intent - BroadcastReceiver combo breaker. When my device is on landscape orientation it works good so the problem came with Intent - BroadcastReceiver. So I need that IntentFilter to know my HOOKEVENT ans then receive it with that BroadcastReceiver. I just want to know why it doesn't even show the alert or don't work at all. Is that possible to deal with IntentFilter on CordovaPlugin? With BroadcastReceiver? I made some test on my CordovaActivity and HOOKEVENT ; updating a text-view. So I assume that's a problem with CordovaPlugin. I also tried to do: CordovaActivity activity = (CordovaActivity) this.cordova.getActivity(); activity.getJs(); Which normally allow me to get string that works on my activity but gave me NPE.. public class Toast extends CordovaPlugin { private String javascript = ""; public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { initHookEvent(); switch (action) { case "reversed": reversedTest(); return true; } return false; } private Activity getActivity() { return this.cordova.getActivity();} private void reversedTest(){ Configuration configuration = getActivity().getResources().getConfiguration(); if(configuration.orientation == Configuration.ORIENTATION_LANDSCAPE){ webView.sendJavascript("javascript:document.getElementById(\"combi\").innerHTML=\"Landscape\";"); } webView.sendJavascript(javascript); } public void initHookEvent() { IntentFilter filter = new IntentFilter("com.base.module.phone.HOOKEVENT"); getActivity().registerReceiver(broadcastReceiver, filter); } public BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { webView.sendJavascript("javascript:alert(\"test\");"); if (intent.getBooleanExtra("hookoff", false)){ javascript = "javascript:document.getElementById(\"combi\").innerHTML=\"decroche\";"; } else{ j…
has title: Cordova #Intent-BroadcastReceiver
tagged with: android
answer count: 1
favorite count: 0
tagged with: cordova
upvote count: 2
accepted answer: http://stackoverflow.com/a/29798067
tagged with: plugins
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/47637889
has text: The answer discusses the basics of HTTP multi-part requests and includes a link to the HTTP spec; I thought it did a good job of giving the general idea behind what needed to be done. I'm sure there are libraries that can handle it automagically but personally I like to know what needs to be done behind the scenes before I look for those.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29752786

http://stackoverflow.com/comment/48466806
has text: You could use CSS `transform: rotate(90deg)` but that's CSS3 stuff. Doesn't *mean* HTML5 but a browser that can't handle html5 will likely not handle CSS3
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29778259
type: QuestionComment

http://stackoverflow.com/a/29839577
has body: Thanks Artem by your clue: root.A3ListFuncion = ko.computed(function(){ $.ajax({ url: RUTA_GLOBAL + "/api/A3/", dataType: 'json', ***async: false,*** type:'GET', data: { A1: root.Data().A1() A2: root.Data().A2() }, success: function(data) { root.A3List(ko.mapping.fromJS(data)()); } }); Changing the ajax request to async false the problme was resolved.
accepted answer of: http://stackoverflow.com/q/29827886
answers question: http://stackoverflow.com/q/29827886
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/29830950
has body: I'm looking to get a URL from a query. (The query is "?url=urlgoeshere" [where "urlgoeshere" is the URL to redirect to]) and redirect to that URL. For some reason when I run the script it goes to "http://mydomain.ext/urlgoeshere" (where "urlgoeshere" is the URL to redirect to) Any ideas on how I could fix this issue? This is my current code: var loc = window.location.href; var url = window.location.search.split("?url="); var countdown=5 var currentsecond=document.rd.box.value=countdown+1 function redirect(){ if (currentsecond!=1){ currentsecond-=1 document.rd.box.value=currentsecond } else { open(url); return } setTimeout("redirect()",1000) } redirect() You will be redirected in seconds
has answer: http://stackoverflow.com/a/29831179
answer count: 1
downvote count: 0
tagged with: url
favorite count: 0
tagged with: http-redirect
has comment: http://stackoverflow.com/comment/47788564
has title: Redirect Using JavaScript
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript

http://stackoverflow.com/q/29792168
tagged with: fullcalendar
tagged with: date
type: Question
upvote count: 2
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29792566
has answer: http://stackoverflow.com/a/29792291
favorite count: 0
type: UnansweredQuestion
has body: I am thinking whether it's possible in the fullcalendar to make the start date as the current date and the previous dates should not be displayed. Here's a graphical image on what I meant.
score: 2
downvote count: 0
has title: Fullcalendar make current date as the start date and do not display previous dates

http://stackoverflow.com/a/29809527
type: Answer
has body: It really depends on what exactly your plugin needs to do; FireBreath 2 is nearly ready and supports plugins in Chrome via native messaging, however: For Chrome you must install an extension as well as installing the binary (the binary installer can trigger the extension install, but must be confirmed by the user) There is no direct drawing model, so you'd need to use a javascript layer to draw and access it from the plugin All APIs of FireBreath 2 plugins are now asynchronous. FireBreath 2 is not quite ready, though you're welcome to help us get it ready. Other options include Native Client, which has much better drawing support but is sandboxed, and Emscripten which allows you to compile C++ to javascript and is shockingly fast, but is also of course sandboxed. You could also write your own native messaging host to do what you need. As @smorgan says, there is no one solution that is a drop-in replacement.
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29790450
accepted answer of: http://stackoverflow.com/q/29790450
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/a/29805079
has comment: http://stackoverflow.com/comment/47888644
has comment: http://stackoverflow.com/comment/47891429
has comment: http://stackoverflow.com/comment/47891492
has comment: http://stackoverflow.com/comment/47888870
has comment: http://stackoverflow.com/comment/47795716
downvote count: 1
accepted answer of: http://stackoverflow.com/q/29797357
has comment: http://stackoverflow.com/comment/47795197
has comment: http://stackoverflow.com/comment/47888694
has comment: http://stackoverflow.com/comment/47759774
answers question: http://stackoverflow.com/q/29797357
has comment: http://stackoverflow.com/comment/47776054
score: 0
has comment: http://stackoverflow.com/comment/58737646
has comment: http://stackoverflow.com/comment/47888806
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47795166
has comment: http://stackoverflow.com/comment/58735863
has comment: http://stackoverflow.com/comment/47878941
has body: jsBin demo Whoever coded that code you shared... it's a total mi(e)ss. Some constructive reasons: z-indexing elements position can be avoided by properly formatting HTML placing elements in a more natural order. <OVERLAY element> >> BUT WHY? <underlay element> ------------------------------- <underlay element> <OVERLAY element> >> CORRECT There's no mean to hardcode the sliding DIV width inside the CSS. Should be dynamic The slide interval should be stopped while the gallery is operated by the user. Clear the interval on gallery hover Spaghetti code should be avoided. Count slides. Count widths. Separate your logic into functions. Images should have an alt attribute with the image description. That alt attribute is available to the user from every decent CMS editor. So why not use that data instead of hardcoding it? (Just a suggestion) Don't create separate code for the fade effect. With a proper HTML and CSS setup it's just about a couple of lines of jQuery to change the gallery effect (see var efx in the example below) and the related animate code. "good UI = UX up". All users are already accustomed to a widely (properly) used gallery animation logic, and that's if you click on NEXT button > animates the container to the left. (reverse for PREV) Here you go, simply change the efx variable and see it happen: jQuery(function( $ ){ var efx = "fade", // "slide" || "fade" animationTime = 600, // Modify mSeconds as desired pauseTime = 4000, $gal = $("#images_holder"), // Cache your elements $mov = $("#moving_part"), $sli = $mov.find("> div"), $btn = $("#prev, #next"), $dsc = $("#description"), w = $gal.width(), // Calculate the gallery width! n = $sli.length, // Get the number of slides c = 0, // Counter // Start index itv; // Interval $mov.width(w*n); // Dynamically set the width // SETUP (fade or slide?) if(efx==="fade") $sli.css({position:"absolute", left:0}).fadeOut(0).eq(c).fadeIn(0); function populateDescription() { $dsc.text( $sli.eq(c).find("img").attr("alt") );…
has comment: http://stackoverflow.com/comment/47891206
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/58730482
has comment: http://stackoverflow.com/comment/47891291
has comment: http://stackoverflow.com/comment/47887796

http://stackoverflow.com/q/29722857
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47580035
has answer: http://stackoverflow.com/a/29722889
accepted answer: http://stackoverflow.com/a/29722889
has body: I'm just learning so probably the code is not the best. I tried several examples in other answers but I'm stuck here. Function invisibleDiv(){ var invDiv = document.createElement('div'); var secondDiv = document.createElement('div'); secondDiv.setAttribute('class', 'secondDiv'); document.body.appendChild(invDiv); invDiv.appendChild(secondDiv); }; And I have this jQuery code: $(document).on("click", ".secondDiv", function (e){ e.stopPropagation(); }); All that is working but I'm trying to replace all my jQuery functions with pure Javascript so I tried this: document.addEventListener("DOMContentLoaded", function(event) { var secondDiv = document.querySelector('.secondDiv'). div.addEventListener('click', function(e) { e.stopPropagation; // Not working secondDiv.stopPropagation; // Not working } }); I tried adding the event listener into the Function invisibleDiv and I can see in DevTools the event is attached, but when clicking secondDiv still triggers the event in invisibleDiv. I can make it work adding both divs into the html code with Display: none/block but since it works with jQuery when added dynamically I wanna know what I'm doing wrong.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47581002
type: Question
has title: Javascript stopPropagation

http://stackoverflow.com/q/29802895
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/30124409
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I want to modify CSS or do a javascript for success two conditions: Example: (------------------main div-----------------------------)(------right div -----) Conditions: 1) If there are a div in the right of my main div, display my main div like the example. 2) If the right div dont exist, my main div must get all width. I can set width with a determinated size but this dont meet all conditions. Somebody can help me?.
has title: Avoid overlapping divs horizontally
type: UnansweredQuestion
score: -4
type: Question
linked to: http://stackoverflow.com/q/5195836
has comment: http://stackoverflow.com/comment/47733711
has comment: http://stackoverflow.com/comment/47736938
downvote count: 4
has comment: http://stackoverflow.com/comment/47733748
upvote count: 0
answer count: 1

http://stackoverflow.com/comment/47659704
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29748242
type: AnswerComment
has text: @YoannAugen in that case this answer is not advisable, but it satisfying this question.

http://stackoverflow.com/comment/47812128
type: Comment
has text: Is there another way to get the label value from another elements like tooltip... ?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29842786

http://stackoverflow.com/q/29802311
linked to: http://stackoverflow.com/q/23551418
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47745573
has comment: http://stackoverflow.com/comment/47732738
has comment: http://stackoverflow.com/comment/49798792
score: 1
upvote count: 1
tagged with: design-patterns
has comment: http://stackoverflow.com/comment/47740897
type: Question
has body: My question is a bit regards concept. A lot of times there is this such situation: if(something){ someAsyncAction(); }else{ someSyncAction(); } // Continue with the rest of code.. var a = 5; The problem with this such case is clear, i don't want the var a = 5 to be call unless someAsyncAction() or someSyncAction() will done, now, cause soAsyncAction() is asynchronous the only way (i can think of) to solve this situation is something like that: var after = function(){ // Continue with the rest of code.. var a = 5; } if(something){ someAsyncAction(after); }else{ someSyncAction(); after (); } BUT, this code is ugly, hard to read and looks like anti-pattern and problematic. I trying to think maybe i can find some solution for that with Promises (using Bluebird at the backend) but can't find something. Is anyone faced this before and can help me figure it out? Thanks!
linked to: http://stackoverflow.com/q/26599798
tagged with: javascript
has comment: http://stackoverflow.com/comment/47732725
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47740732
linked to: http://stackoverflow.com/q/29779492
has answer: http://stackoverflow.com/a/29802688
tagged with: asynchronous
has title: Javascript - if with asynchronous case
tagged with: anti-patterns
favorite count: 0
tagged with: promise

http://stackoverflow.com/comment/47706084
type: QuestionComment
comment on: http://stackoverflow.com/q/29788428
score: 0
has text: what exactly you want to do, could you elaborate more on it?
type: Comment

http://stackoverflow.com/a/29742820
accepted answer of: http://stackoverflow.com/q/29717380
answers question: http://stackoverflow.com/q/29717380
type: AcceptedAnswer
has body: What I have noticed is that for changing the text color of an already loaded html file, using the following code is better as it doesn't cause the webview to reload. But what worth noting is that this code only worked for me when changing an already loaded html file. [_myWebView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('body')[0].style.color =\"Black\""]; But when I wanted to change the text color of a new html file (being loaded), the following code worked better for me. NSString * myHtmlFile = [[NSBundle mainBundle] pathForResource:htmlName ofType:@"htm"]; NSString* text = [NSString stringWithContentsOfFile:htmlFile encoding:NSUTF8StringEncoding error:nil]; NSLog(@"%@",htmlFile); [self.myWebView loadHTMLString:[NSString stringWithFormat:@"&lt;html&gt;&lt;body text=\"#000000\" face=\"Bookman Old Style, Book Antiqua, Garamond\" size=\"5\"&gt;%@&lt;/body&gt;&lt;/html&gt;", text] baseURL: nil];
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/47607325
comment on: http://stackoverflow.com/q/29735997
score: 0
type: QuestionComment
type: Comment
has text: I get it now. Yup, it should work. Thank you. Although some have complained of performance implications. Do you think there would be any?

http://stackoverflow.com/comment/47811627
type: QuestionComment
comment on: http://stackoverflow.com/q/29841727
score: 0
has text: Sounds like the signin was unsuccessful, or the login method is not alowing anaonymous - although you do have the [AllowAnonymous] token at the top. Have you tried it in debug to see if it even gets into the Login method?
type: Comment

http://stackoverflow.com/q/29805855
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47739709
has comment: http://stackoverflow.com/comment/47739730
answer count: 0
tagged with: mysql
has body: I have a SQLite database in French with utf-8 encoding and am trying to organize my categories in alphabetical order. My setup currently looks like: https://i.sstatic.net/LmDTV.png I tried to add SELECT DISTINCT Category FROM 'Main Database' ORDER BY name but unfortunately it did not display correctly. Can anyone tell me the correct way to alphabetize my Category column in ABC order? Javascript: function onDeviceReady() { if (window.device.platform === 'iOS' &amp;&amp; parseFloat(window.device.version) &gt;= 7.0) StatusBar.overlaysWebView(false); db = window.sqlitePlugin.openDatabase({name: "treatfinder", bgType: 1}); db.transaction(function(tx){ tx.executeSql("SELECT DISTINCT Category FROM 'Main Database'",[],function(tx,res){ //console.log("Number of Categories: " + res.rows.length); var len = res.rows.length; for (var i=0; i &lt; len; i = i + 1) { $("#allRepos").append("&lt;li&gt;&lt;a href='treatsymptoms.html?category=" + res.rows.item(i).Category + "'&gt;" + res.rows.item(i).Category + "&lt;/a&gt;&lt;/li&gt;"); } $('#allRepos').listview('refresh'); }); })
type: Question
has title: How to order SQLite database alphabetically
has comment: http://stackoverflow.com/comment/47739786
tagged with: javascript
has comment: http://stackoverflow.com/comment/47739638
score: 0

http://stackoverflow.com/comment/47577074
has text: See edit.... its JSON in the request body, versus urlencoded form parameters.
score: 0
comment on: http://stackoverflow.com/q/29719441
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47813112
comment on: http://stackoverflow.com/q/29842802
score: 0
type: Comment
type: QuestionComment
has text: @PedroLobito You mean i put console.log inside the else

http://stackoverflow.com/comment/47687247
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29778559
has text: @panthro Yep, I once made a little mascot editor that used it. However, instead of showing in the page, I made it downloadable. http://myst729.github.io/Favatar/favatar2.html

http://stackoverflow.com/comment/47603797
type: Comment
type: QuestionComment
has text: FYI, you are using two different classes, `pestaña` and `pestana`
comment on: http://stackoverflow.com/q/29735185
score: 0

http://stackoverflow.com/q/29734884
favorite count: 0
has comment: http://stackoverflow.com/comment/47602927
score: -2
type: AnsweredQuestion
has title: Javascript math
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/29735058
has body: function opacityChange(element, action) { var timer = setInterval(function() { element.style.opacity = parseFloat(element.style.opacity); if(action) { if(element.style.opacity &lt; 1) element.style.opacity += 0.1; else clearInterval(timer); } else { if(element.style.opacity &gt; 0) element.style.opacity -= 0.1; else clearInterval(timer); } }, 100); return true; } everything was fine when I hide the picture, but when I try to show it JS can't add 0.1 to 0.1.
tagged with: math
tagged with: javascript
has comment: http://stackoverflow.com/comment/47603154
has comment: http://stackoverflow.com/comment/47602857
downvote count: 4
answer count: 1
accepted answer: http://stackoverflow.com/a/29735058

http://stackoverflow.com/a/29806297
has comment: http://stackoverflow.com/comment/47741191
has comment: http://stackoverflow.com/comment/47740950
downvote count: 1
type: Answer
upvote count: 0
has body: If you are using jquery you can just grab the height with $('.target-class').height()
has comment: http://stackoverflow.com/comment/47741705
has comment: http://stackoverflow.com/comment/47741060
score: -1
answers question: http://stackoverflow.com/q/29806224
has comment: http://stackoverflow.com/comment/47740719
has comment: http://stackoverflow.com/comment/47741979
has comment: http://stackoverflow.com/comment/47743125

http://stackoverflow.com/comment/47678355
type: AnswerComment
comment on: http://stackoverflow.com/a/29772311
score: 0
type: Comment
has text: @Scimonster those only work with _String_, i.e. `atob(btoa(4)); // "4" !== 4` and it's much longer because you're storing the unicode, `NA==` vs `E`

http://stackoverflow.com/q/29791376
tagged with: javascript
upvote count: 3
answer count: 2
favorite count: 0
has title: How to make random shuffle?
accepted answer: http://stackoverflow.com/a/29791564
linked to: http://stackoverflow.com/q/9776490
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29791442
has answer: http://stackoverflow.com/a/29791564
downvote count: 0
has body: How can you make the video playback very random? (right now it's playing after French, Nederlands and after Nederlands, French, but I want randomly shuffle out of this two) var playing ='FR'; function video_idle() { $('#mediaplayer').attr('src',playing + '.mp4' ).show(); mediaplay_video= document.getElementById('mediaplayer'); mediaplay_video.play(); mediaplay_video.onended = function(e) { console.log('&gt;&gt;&gt; Playing finished: ', e); if(playing ==='FR') { playing='NL'; video_idle(); } else { playing='FR'; video_idle(); } }; }
has answer: http://stackoverflow.com/a/29791442
type: Question
score: 3

http://stackoverflow.com/comment/47713383
type: QuestionComment
type: Comment
score: 1
has text: looks like you are submitting a form, which might be resulting in the page being reloaded... so try to add a `return false` at the end of the method
comment on: http://stackoverflow.com/q/29792363

http://stackoverflow.com/comment/62153013
comment on: http://stackoverflow.com/a/37316560
type: AnswerComment
score: 0
type: Comment
has text: The above code core function is $interval( function() { $scope.gridApi.core.handleWindowResize(); }, 500, 10)

http://stackoverflow.com/comment/47772066
has text: Yes, it did. I have added the changes I made to make it Run!
comment on: http://stackoverflow.com/a/29822314
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/69772754
has body: let dataArray = [{'id':1,'code':'ABC'},{'id':1,'code':'ABC'},{'id':2,'code':'ABC'}] let obj = {}; dataArray.forEach(task =&gt; { task.id in obj ? obj[task.employee_id].push(task): obj = { ...obj, [task.employee_id]: [task], } });
has comment: http://stackoverflow.com/comment/123334676
answers question: http://stackoverflow.com/q/29696572
score: 0
type: Answer

http://stackoverflow.com/a/29721217
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29721075
answers question: http://stackoverflow.com/q/29721075
score: 3
type: Answer
upvote count: 3
has body: You should run digest cycle as you are updating scope outside of angular, using event. You need to digest cycle by doing $scope.$apply() Code Trigger.onReceivingTriger($scope,function(data){ $scope.selectedIndex = 0; $scope.$apply(); });

http://stackoverflow.com/comment/47752880
has text: Shouldn't the console.log only log for either the if or the else for each click? My problem is that each click logs out both the if and the else for each click.
type: Comment
comment on: http://stackoverflow.com/a/29811310
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47764295
has text: it looks like you might be cloning the data also, can you share the code
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29818759
score: 2

http://stackoverflow.com/q/29701472
tagged with: regex
downvote count: 0
type: AnsweredQuestion
score: 3
has title: Add text after a special character
tagged with: javascript
type: Question
tagged with: replace
has answer: http://stackoverflow.com/a/29701522
accepted answer: http://stackoverflow.com/a/29701522
answer count: 1
favorite count: 0
upvote count: 3
has body: I have a string which is punctuated and I would like to add &amp;thinsp; after all symbols. For example, this string: Hi there, how are you ? Ok/not_ok ! I expect it to become like this: Hi there,&amp;thinsp; how are you ?&amp;thinsp; Ok/&amp;thinsp;not_&amp;thinsp;ok !&amp;thinsp; I was thinking about the replace function, but I'll need to call it lot of times for all symbols... str.replace("/","/&amp;thinsp;"); str.replace(",",",&amp;thinsp;"); str.replace("!","!&amp;thinsp;"); str.replace("?","?&amp;thinsp;"); str.replace("_","_&amp;thinsp;"); Is there an easier way to achieve this using only 1 function? I was thinking about regexp, something similar to this: str.replace([/,!?_],&lt;selection&gt;+"&amp;thinsp;");

http://stackoverflow.com/q/29797006
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47722450
tagged with: datepicker
tagged with: shieldui
has title: DatePicker value after manual input
type: AnsweredQuestion
has body: I'm using a 0:dd/MM/yyyy as format and textTemplate for the DatePicker object $('#datePickerSelector')`.shieldDatePicker({ format: "{0:dd/MM/yyyy}", textTemplate: "{0:dd/MM/yyyy}" }); When the user select the date from the selector in the proper way the format is correct when I retrieve the value using: $('#datePickerSelector').val(); But whenever the user manually type in the date in the text box (for example 1/5/2015, the value retrieved using the same sentence above is (05/01/2015). How can I fix this?
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/47722613
score: 1
has answer: http://stackoverflow.com/a/29805694
accepted answer: http://stackoverflow.com/a/29805694
upvote count: 1

http://stackoverflow.com/a/29775000
downvote count: 0
has comment: http://stackoverflow.com/comment/47680724
type: Answer
has comment: http://stackoverflow.com/comment/47680479
has comment: http://stackoverflow.com/comment/47680529
has body: You need ngClass The ngClass directive allows you to dynamically set CSS classes on an HTML element by databinding an expression that represents all classes to be added. Code ng-class='{ "pass" : co(per(x)) == 1, "fail" : co(per(x)) == 0 }' OR, From @RevanProdigalKnight comment ng-class="co(per(x)) ? 'pass' : 'fail'" when calling function with ngIf, You don;t need string interpolation. Use ng-if="co(per(x))" instead of ng-if="{{co(per(x))}}"
upvote count: 9
accepted answer of: http://stackoverflow.com/q/29774952
score: 9
answers question: http://stackoverflow.com/q/29774952
type: AcceptedAnswer

http://stackoverflow.com/comment/47919982
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29834417
has text: :) I'm pretty sure you can, just click the empty checkbox mark right below the up and down arrows to the left of the answer. There shouldn't be any restrictions to that.
score: 0

http://stackoverflow.com/comment/47576514
type: QuestionComment
has text: If I onlu use the first snippet, it works fine, the second is to prevent the code from working with small screens but when I try to add it it is not working at all
score: 0
comment on: http://stackoverflow.com/q/29720941
type: Comment

http://stackoverflow.com/a/29806115
has comment: http://stackoverflow.com/comment/47743539
has comment: http://stackoverflow.com/comment/47748695
type: Answer
has comment: http://stackoverflow.com/comment/47745673
downvote count: 0
has body: The classical approach is to keep an "active list" that stores the indexes of the edges straddling the current ordinate. When you go from an ordinate to the next, edges can enter or leave the list (they do it once only). Keep it updated. The list is initially empty, ends up empty and should contain an even number of edges at all times. If the polygon edges never cross, you can keep the list ordered from left to right.
accepted answer of: http://stackoverflow.com/q/29803819
answers question: http://stackoverflow.com/q/29803819
score: 1
has comment: http://stackoverflow.com/comment/47745651
upvote count: 1
has comment: http://stackoverflow.com/comment/47740492
type: AcceptedAnswer

http://stackoverflow.com/q/29832553
downvote count: 1
has answer: http://stackoverflow.com/a/29833511
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47793100
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/47793438
favorite count: 0
tagged with: angularjs
upvote count: 2
tagged with: twitter-bootstrap
type: UnansweredQuestion
has body: So I have a bit of bootstrap html I am trying to integrate into my angular app. I am running a repeat on some data coming in and I'm trying to integrate it into this logic, So I'm basically just trying to default the tabs to open, and if possible tag them to a boolean. So here is the html {{filter.name}} This works great, however changing the aria-expanded to true does nothing. The are still closed upon creation. I'm also just wondering if I could bind it to something like a boolean like aria-expanded="filter.isChecked" Where that boolean would just return if the item is checked. I do not have the luxury of plugging in bootstrap-ui right now unfortunately, so I'm wondering if there is a quick and easy way to fix this, mainly have the toggles all default to open. Thanks!
score: 1
has title: Bootstrap, data-toggle in ng-repeat, default to open and/or bind open to data
has comment: http://stackoverflow.com/comment/47793276

http://stackoverflow.com/comment/47535684
has text: From the web, I hope not. Else you should check your DMZ, something like ***right now***.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29699795

http://stackoverflow.com/q/29797634
possible better answer: http://stackoverflow.com/a/29889476
has answer: http://stackoverflow.com/a/29889476
has title: Using node.js modules with atom-shell
has answer: http://stackoverflow.com/a/29860336
tagged with: electron
upvote count: 2
accepted answer: http://stackoverflow.com/a/29860336
has body: I started to have a look at the atom-shell and as documented there is a possibility to access native node modules: https://github.com/atom/electron/blob/master/docs/tutorial/using-native-node-modules.md So is there any possibility to use those node modules from the javascript code which is executed inside the atom shell, for example to execute sql statements.
score: 2
type: AnsweredQuestion
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/29794206
answers question: http://stackoverflow.com/q/29793844
downvote count: 0
upvote count: 3
has comment: http://stackoverflow.com/comment/47719859
type: Answer
score: 3
has body: Note that you dont have to replace the class btn-default with btn-primary, you can simply apply the btn-primary class and its styling will supercede that of btn-default, as such you dont have to perform additional operations. $('.btn-group .btn').on('click', function() { // On the click event for each button $(this) // get the button being clicked .addClass('btn-primary') // add the `btn-primary` class .siblings('.btn-primary') // get all sibling buttons which may already be selected .removeClass('btn-primary'); // remove the selected class }); Today This Week This Month Custom

http://stackoverflow.com/a/78319177
type: Answer
has body: You can also pass just the event, you can get the column from e.target.value or just pass the column as arg return ( this.handleSort(e, column)} >{column} );
score: 0
answers question: http://stackoverflow.com/q/29810914

three.js
tags question: http://stackoverflow.com/q/29770340
tags question: http://stackoverflow.com/q/29727950
tags question: http://stackoverflow.com/q/29818073
tag name: three.js
tags question: http://stackoverflow.com/q/29701112
tags question: http://stackoverflow.com/q/29819840
tags question: http://stackoverflow.com/q/29826851
tags question: http://stackoverflow.com/q/29738638
tags question: http://stackoverflow.com/q/29835605
tags question: http://stackoverflow.com/q/29758233
tags question: http://stackoverflow.com/q/29810601
tags question: http://stackoverflow.com/q/29736477
tags question: http://stackoverflow.com/q/29802430
tags question: http://stackoverflow.com/q/29707529
tags question: http://stackoverflow.com/q/29839777
tags question: http://stackoverflow.com/q/29695541
tags question: http://stackoverflow.com/q/29744233
tags question: http://stackoverflow.com/q/29693893
tags question: http://stackoverflow.com/q/29743592
tags question: http://stackoverflow.com/q/29785566
type: Tag
tags question: http://stackoverflow.com/q/29761386
tags question: http://stackoverflow.com/q/29844253
tags question: http://stackoverflow.com/q/29733445
tags question: http://stackoverflow.com/q/29688618
tags question: http://stackoverflow.com/q/29829382
tags question: http://stackoverflow.com/q/29742541
tags question: http://stackoverflow.com/q/29716597
tags question: http://stackoverflow.com/q/29713556
tags question: http://stackoverflow.com/q/29769359
tags question: http://stackoverflow.com/q/29838206
tags question: http://stackoverflow.com/q/29838362
tags question: http://stackoverflow.com/q/29720812
tags question: http://stackoverflow.com/q/29810048
tags question: http://stackoverflow.com/q/29808476

http://stackoverflow.com/comment/47803022
comment on: http://stackoverflow.com/q/29838311
type: QuestionComment
has text: The nature of string primitive values is weird in JavaScript. I do not think it's accurate to assume that a copy of all the bytes in a string primitive are copied when a string is passed to a function. Because string primitives are immutable, representing those values (internally) as object references works perfectly well. They *behave* like primitives, but they're *implemented* like objects.
type: Comment
score: 2

http://stackoverflow.com/q/29804319
has answer: http://stackoverflow.com/a/29805312
accepted answer: http://stackoverflow.com/a/29805312
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47738307
favorite count: 0
upvote count: 2
score: 2
type: AnsweredQuestion
has title: How to obtain the Date value from a p:calendar component in JavaScript?
tagged with: jsf
tagged with: calendar
has body: I don't know how to obtain the Date value of a &lt;p:calendar&gt; in PrimeFaces component using JavaScript This is my component &lt;p:calendar id="calendarInicio" widgetVar="horaInicioSpin" value="#{hbean.horaInicial}" timeOnly="true" pattern="HH:mm" required="true"/&gt; I need to obtain the hour value of the component because I'm gonna send that value into other &lt;p:calendar&gt; component, using JavaScript. Can anyone give me an idea? Thanks in advance...
type: Question
tagged with: primefaces
tagged with: javascript

http://stackoverflow.com/q/29822434
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/47771085
has comment: http://stackoverflow.com/comment/47771286
possible better answer: http://stackoverflow.com/a/34163111
tagged with: javascript
has title: Disable ng-Click while Dragging on Div
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
score: 2
has comment: http://stackoverflow.com/comment/47772566
has comment: http://stackoverflow.com/comment/47771193
downvote count: 0
has answer: http://stackoverflow.com/a/34163111
tagged with: draggable
has comment: http://stackoverflow.com/comment/47772367
has body: I have enabled expand and collapse with my widget which has attached to a draggable directive.This works fine. ISSUE: The expand and collapse has been added in ng-click event, so when the user drags the widget and drop it ng-click also gets fired. I dont want ng-click getting fired when the user drags the widget. Here is my code: HTML: {{widget.chartConfig.title.text}} {{widget.chartConfig.title.text}} JS: Draggable.JS routerApp.directive('draggable', function() { return { // A = attribute, E = Element, C = Class and M = HTML Comment restrict:'A', //The link function is responsible for registering DOM listeners as well as updating the DOM. link: function(scope, element, attrs) { console.log("Let draggable item snap back to previous position"); element.draggable({ // let it go back to its original position revert:true }); } }; });
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29823506
accepted answer: http://stackoverflow.com/a/29823506
has comment: http://stackoverflow.com/comment/47771255

http://stackoverflow.com/comment/47752903
comment on: http://stackoverflow.com/a/29812482
score: 0
type: AnswerComment
has text: I think it is good if the array is already fixed, but my array depends on the user. have you run my code above?
type: Comment

http://stackoverflow.com/comment/47657489
comment on: http://stackoverflow.com/a/29745637
type: Comment
score: 0
type: AnswerComment
has text: @star I have updated the code for you and this is working perfectly for me. Just give it a try. You will get the value inside the success function of the javascript.

http://stackoverflow.com/q/29713472
linked to: http://stackoverflow.com/q/4815330
type: Question
has comment: http://stackoverflow.com/comment/47577328
tagged with: jquery-ui-autocomplete
tagged with: jquery-ui
tagged with: arrays
tagged with: javascript
tagged with: jquery
score: 4
has answer: http://stackoverflow.com/a/29715006
has body: I have a very basic html with jQuery and jQuery UI, I'm using the autocomplete function, so far so good, the problem is that I have an array with 3 values each block something like: Array ( [0] =&gt; stdClass Object ( [product_id] =&gt; 5 [product_number] =&gt; AGD-ACRBD001 [product_name] =&gt; Title 1 ) [1] =&gt; stdClass Object ( [product_id] =&gt; 6 [product_number] =&gt; AGD-ACRBD002 [product_name] =&gt; Title 6 ) [2] =&gt; stdClass Object ( [product_id] =&gt; 7 [product_number] =&gt; AGD-ACRBD003 [product_name] =&gt; Title 34 ) ) So that is my array, with that array I only need the [product_number] to build my array for the auto complete, that is NOT a problem, the problem is that how do I use the other values when the [product_number] has been selected?... the HTML is as follow: &lt;form&gt; &lt;input type="text" id="ids" name="ids" placeholder="Product ID"&gt; &lt;input type="text" id="codes" name="codes" placeholder="Code"&gt; &lt;input type="text" id="names" name="names" placeholder="Names"&gt; &lt;/form&gt; So when a user type something on id="codes" it displays the list of codes that is extracted from the array value [product_number], that is working... what I do not know is how do I add the value to id="ids" and id="names" after the selection from the list... the jQuery for the autocomplete is: (function($) { $(function() { var availableTags = [ "AGD-ACRBD001", "AGD-ACRBD002", "AGD-ACRBD003" ]; $("#codes").autocomplete({ source: availableTags }); }); })(jQuery);
answer count: 2
has title: jQuery Autocomplete, 3 values or more
favorite count: 0
has answer: http://stackoverflow.com/a/29713555
has comment: http://stackoverflow.com/comment/47562349
has comment: http://stackoverflow.com/comment/47566783
type: UnansweredQuestion
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/47544873
score: 0
type: Comment
type: QuestionComment
has text: Sorry. The results are now displaying without the sendVote function. My bad. Bu i'm still getting the parsererror error
comment on: http://stackoverflow.com/q/29704204

http://stackoverflow.com/comment/47552438
comment on: http://stackoverflow.com/a/29708323
type: AnswerComment
type: Comment
has text: @NuttyProgrammer Nope, I tried it from another browser before I posted this and without opening the web-page there first, I get the complete json. They could be doing something that is ip based but you would have to try that.
score: 0

http://stackoverflow.com/comment/47616135
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29741161
has text: @haim770 changed still not working
score: 0

http://stackoverflow.com/q/29817631
answer count: 0
has title: RequireJS error: Timeout
type: Question
has body: I am testing a JavaScript project with Jasmine. Everything went well but suddenly nothing works anymore although I cannot remember to have changed anything. I get this error: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. The error occurs in this piece of code: describe("DesktopRouter", function(){ var router; beforeAll(function(done){ alert("1"); require(['jquery', 'backbone', '../../../public/js/app/routers/DesktopRouter'], function($, Backbone, DesktopRouter) { alert("2"); router = DesktopRouter; done(); } ); }); ... I can see the alert showing "1" but not the second one that should show "2". Instead nothing happens for a few seconds and then all specs return "failed" because router is undefined. I already tried to run it in Chrome, Firefox, Opera. I have an earlier version of this project that used to work. I added this version to my project again but it also didn't work any more. What could be wrong there? This is my HTML Code. Maybe I did something wrong here, as requirejs is running asynchronously. Jasmine Spec Runner v2.2.0 The Firebug console displays some errors: NS_ERROR_DOM_BAD_URI: Access to restricted URI denied occurs several times. And this one exists once: Error: Load timeout for modules: text!templates/navbar.html_unnormalized3,text!templates/footer.html_unnormalized5,text!templates/blockbrowser.html_unnormalized7,text!templates/login.html_unnormalized9,text!templates/sidebar.html_unnormalized11,text!templates/vehiclesidebar.html_unnormalized13,text!templates/companies.html_unnormalized15,text!templates/companies/companiesDeleteModal.html_unnormalized16,text!templates/companies/companiesAddModal.html_unnormalized17,text!templates/dashboard.html_unnormalized19,text!templates/main_grouped_vehiclelist.html_unnormalized20,text!templates/main_errorlist.html_unnormalized21,text!templates/main_servicelist_details.html_unnormalized22,text!templates/dashboard/dashboardMessageModal.html_unnormali…
tagged with: javascript
has comment: http://stackoverflow.com/comment/47762203
has comment: http://stackoverflow.com/comment/47762311
score: 0
has comment: http://stackoverflow.com/comment/47763500
tagged with: jasmine
has comment: http://stackoverflow.com/comment/47764214
has comment: http://stackoverflow.com/comment/93002793
type: UnansweredQuestion
tagged with: requirejs

http://stackoverflow.com/comment/47702664
type: Comment
type: QuestionComment
has text: and what you think about the problem? how can imake work the app with wp8
comment on: http://stackoverflow.com/q/29785903
score: 0

http://stackoverflow.com/q/29793844
accepted answer: http://stackoverflow.com/a/29794039
answer count: 3
has title: Toggling class in group of buttons
tagged with: button
favorite count: 0
has body: I have the following markup for a group of buttons: Today This Week This Month Custom I'm trying to replace class btn-default with class btn-primary on the button using jQuery so that when clicked, the clicked button will have the following class="btn btn-primary", and any other button in the group with class btn-primary will toggle back to btn-default. Is there a more elegant solution to what I have provided below? Do I have to write a function for every button? Also, I risk adding btn btn-default to a button which already has that class. Any help is greatly appreciated. $("#today").click(function () { $(this).parent().find("btn btn-primary").removeClass("btn btn-primary"); $(this).parent().addClass("btn btn-default"); $(this).addClass("btn btn-primary"); });
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
tagged with: css
possible better answer: http://stackoverflow.com/a/29794206
has comment: http://stackoverflow.com/comment/47716500
has comment: http://stackoverflow.com/comment/47716956
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29794654
downvote count: 0
type: Question
tagged with: javascript
tagged with: jquery
score: 4
has answer: http://stackoverflow.com/a/29794206
has answer: http://stackoverflow.com/a/29794039

http://stackoverflow.com/q/29704943
upvote count: 2
type: UnansweredQuestion
has body: I'm a total beginner and I'm about to finish my first website. But I just cant get the last button to work. Its the simplest task but this one is just not working. $( document ).ready(function() { alert("mailto script loaded!"); }) //eventhandler send-button $('#send').onclick(function() { alert( "Handler has beend called." ); }); Senden Can you guys give me a hint where the problem is? Thank you very much in advance. I googled everything but i unterstand basically what i need to do. I just cant see where i am going wrong.
score: 2
has comment: http://stackoverflow.com/comment/47545317
type: Question
has title: Cant call button as Event handler in jQuery
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/29704968
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29704971
favorite count: 0

http://stackoverflow.com/comment/47529802
has text: no no , i ask to him. because he may be missed to assign the `controller `and `ng-app` settings .
type: AnswerComment
comment on: http://stackoverflow.com/a/29696622
score: 0
type: Comment

http://stackoverflow.com/a/29827825
answers question: http://stackoverflow.com/q/29825571
upvote count: 2
has comment: http://stackoverflow.com/comment/47786564
has comment: http://stackoverflow.com/comment/47810558
type: Answer
has comment: http://stackoverflow.com/comment/47818330
score: 2
has comment: http://stackoverflow.com/comment/47811199
has body: Yes, javascript works in a similar way. booleans, numbers, and strings are stored by value. So, in this code snippet, for example, var a = 122; var b = 122; a === b will be true. Everything else, however, is stored by reference and automatically garbage-collected as you described in your question. So, for example, in this code snippet, var a = [1, 2, 3, 4] var b = [1, 2, 3, 4] a === b will be false. Edit: In Python, array and dictionary equality are by value, but class instances are equal only if they are the same instance. In javascript, an Object is basically a dictionary where the keys must be strings. Because Objects are used in javascript to fill the same role as class instances in Python (you'd be surprised at how well it works), Objects are equal only if they are the same Object. Arrays inherit from Object, so they are also by reference.
has comment: http://stackoverflow.com/comment/47786824
downvote count: 0

http://stackoverflow.com/a/29819110
answers question: http://stackoverflow.com/q/29818759
type: Answer
upvote count: 1
score: 1
has body: A cloned element is not linked to the original element. What is more likely is that the selector you are using to delete an element has too broad a scope and so is deleting them all. This can also happen if you are selecting by ID and, as a commenter has suggested, you have cloned the ID to each element as well. Without some code snippets, it's hard to fully diagnose the issue.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47765370
accepted answer of: http://stackoverflow.com/q/29818759

http://stackoverflow.com/a/29835740
type: Answer
has comment: http://stackoverflow.com/comment/47833896
downvote count: 0
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29807548
type: AcceptedAnswer
has body: Your security rule requires role = 99 but you are never setting it. The following seems to solve your issue: // create the employee record and associate the firebase uid var employee = _this.store.createRecord('employee', { id: userData.uid, firstName: _this.get('firstName'), lastName: _this.get('lastName'), role: 99 }); To answer the greater question, yes the write is done in multiple parts. The hasMany relationships are saved individually, so as not to completely overwrite any changes that may be happening on other clients. More specifically, each hasMany link is added or deleted in a separate write, so there could be 2 or more writes. In the case of your code, the business/&lt;id&gt;/employees&lt;employee_id&gt; link was saved first which meant that on the second pass - while writing the main business/&lt;id&gt; hash - the !data.exists() part of your rule failed. This is fine, because the employee is created and linked to the business, but the role = 99 check also failed.
answers question: http://stackoverflow.com/q/29807548

http://stackoverflow.com/q/29796925
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47726727
has comment: http://stackoverflow.com/comment/47729804
accepted answer: http://stackoverflow.com/a/29805216
tagged with: php
type: AnsweredQuestion
upvote count: 2
has body: I'm trying to follow this guide: Google Sheets as a Database – INSERT with Apps Script using POST/GET methods (with ajax example) I know that I've to put 'Google Sheet/Apps Script Code' in a spreadsheet. But I don't know what I have to put in 'code.gs' and 'index.html' for Google Apps Script. Because the stackoverflow example brings with 'form.php'. HTML A bar JavaScript // Variable to hold request var request; // Bind to the submit event of our form $("#foo").submit(function(event){ // Abort any pending request if (request) { request.abort(); } // setup some local variables var $form = $(this); // Let's select and cache all the fields var $inputs = $form.find("input, select, button, textarea"); // Serialize the data in the form var serializedData = $form.serialize(); // Let's disable the inputs for the duration of the Ajax request. // Note: we disable elements AFTER the form data has been serialized. // Disabled form elements will not be serialized. $inputs.prop("disabled", true); // Fire off the request to /form.php request = $.ajax({ url: "/form.php", type: "post", data: serializedData }); // Callback handler that will be called on success request.done(function (response, textStatus, jqXHR){ // Log a message to the console console.log("Hooray, it worked!"); }); // Callback handler that will be called on failure request.fail(function (jqXHR, textStatus, errorThrown){ // Log the error to the console console.error( "The following error occurred: "+ textStatus, errorThrown ); }); // Callback handler that will be called regardless // if the request failed or succeeded request.always(function () { // Reenable the inputs $inputs.prop("disabled", false); }); // Prevent default posting of form event.preventDefault(); }); form.php // You can access the values posted by jQuery.ajax // through the global variable $_POST, like this: $bar = $_POST['bar']; Change by Hawksey // fire off the request to /form.php request = $.ajax({ url: "https://script.google.com/macros/s/AKfycbzV…
possible better answer: http://stackoverflow.com/a/29801874
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29801874
tagged with: google-apps-script
tagged with: google-sheets
tagged with: javascript
has answer: http://stackoverflow.com/a/29805216
tagged with: ajax
has comment: http://stackoverflow.com/comment/47722458
answer count: 2
has title: Google Sheets as a Database with Ajax
has comment: http://stackoverflow.com/comment/47723046

http://stackoverflow.com/q/29761749
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/47699951
has comment: http://stackoverflow.com/comment/64849665
has body: I am building an app using Meteor. I am using the jquery datatables package - www.datatables.net to present my data/records. According to the documentation, I would connect the table to my MongoDB database by: $('#example').DataTable( { serverSide: true, ajax: '/data-source' }); The part I am unclear of is the 3rd line - Can someone help me understand how to make an ajax call to return data from my MongoDB database?? Here is more documentation on server-side processing for datatables: https://datatables.net/manual/server-side I have a collection named Products with the fields description, brand, price.
type: UnansweredQuestion
tagged with: mongodb
has answer: http://stackoverflow.com/a/43593108
has comment: http://stackoverflow.com/comment/47655688
has comment: http://stackoverflow.com/comment/47655647
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
tagged with: ajax
type: Question
has title: How to make ajax request to mongodb
tagged with: meteor
tagged with: datatable

http://stackoverflow.com/comment/47830067
has text: You checked that checkBoxID has the right value? You can also debug the jQuery result and review the selector.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29835610

http://stackoverflow.com/comment/47949038
comment on: http://stackoverflow.com/q/29822159
has text: I tried to load only the libraries, it worked. I had a deprecated function in my very basic initializing method which I used to test the libraries.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47639944
type: Comment
has text: thanks for the answers i just wanted to know is there any standard way of doing this may be some method in jQuery so i can pass number of digit and number else functions we can always write.Thanks
score: 0
comment on: http://stackoverflow.com/q/29745254
type: QuestionComment

http://stackoverflow.com/a/29787745
has body: Centering in general can be difficult with HTML/CSS. A good primer on all the good ways to do it is located on css-tricks.com here: https://css-tricks.com/centering-css-complete-guide/ For your specific situation adding position: absolute; top: 50%; margin-top: -65px; // height of the box Would do the trick, but using a flex box or another more complicated trick (outlined as css-tricks) would allow you to avoid the brittle margin-top hack, which limits centering to a specific number of lines.
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47705022
answers question: http://stackoverflow.com/q/29787611
upvote count: 1

http://stackoverflow.com/comment/47809333
type: Comment
has text: Yes, but that should make no difference. After you drop an item in your `TreeTable`, the **only** thing that should happen is that you add a new entry in your model. You don't add any controls or HTML DOM objects, because your updated model will trigger that for you. So if you drop on a treenode (whether closed or open) you just add a new entry as a child of the corresponding model entry. Should invoke no undesired behavior
comment on: http://stackoverflow.com/a/29802183
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47637562
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29752681
type: AnswerComment
has text: Can you explain me how this would play along with the controller "this" property declaration? Or would it be the same? I tought the "this" way of adding properties to the scope was a way to stop using the scope variable, but naming it as this.

http://stackoverflow.com/a/29700891
score: 1
has body: Set display:none on the table by default and set it to display:block when you find a result. You can set diplay:none inline on the element and change it using javascript inside the if statement if(matches &gt; 0)
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29699794
downvote count: 0

http://stackoverflow.com/a/29776639
type: AcceptedAnswer
type: Answer
has body: classname is a NodeList, addEventListener is a method for individual nodes. You need to loop over the elements: for (i = 0; i &lt; classname.length; i++) { classname[i].addEventListener('click', function() { this.className = 'done'; }); }
downvote count: 0
score: 6
has comment: http://stackoverflow.com/comment/47687904
upvote count: 6
accepted answer of: http://stackoverflow.com/q/29776494
answers question: http://stackoverflow.com/q/29776494

http://stackoverflow.com/q/29734135
tagged with: audio-player
has answer: http://stackoverflow.com/a/29734230
type: AnsweredQuestion
has title: JavaScript object oriented audio player not working
tagged with: oop
accepted answer: http://stackoverflow.com/a/29734230
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/47601605
tagged with: javascript
has body: I'm building a object oriented audio player in JavaScript. This is my code so far: var audio1 = new Audio("http://jplayer.org/audio/m4a/Miaow-07-Bubble.m4a", "audio/mpeg"); function Audio(src, type) { //create audioElement this.audioElement = document.createElement("audio"); this.audioElement.setAttribute("src", src); this.audioElement.setAttribute("type", type); document.getElementById("main").appendChild(this.audioElement); //create audioControls this.audioControls = document.createElement("div"); this.audioControls.setAttribute("class", "play button"); document.getElementById("main").appendChild(this.audioControls); this.playing = false; this.audioControls.onclick = function () { if (this.playing) { this.pause(); } else { this.play(); } } this.play = function() { this.audioElement.play(); this.playing = true; this.audioControls.setAttribute("class", "pause button"); }; this.pause = function() { this.audioElement.pause(); this.playing = false; this.audioControls.setAttribute("class", "play button"); }; } @font-face { font-family:"Ionicons"; src:url("http://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.eot?v=2.0.1"); src:url("http://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.eot?v=2.0.1#iefix") format("embedded-opentype"), url("http://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.ttf?v=2.0.1") format("truetype"), url("http://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.woff?v=2.0.1") format("woff"), url("http://code.ionicframework.com/ionicons/2.0.1/fonts/ionicons.svg?v=2.0.1#Ionicons") format("svg"); font-weight:normal; font-style:normal; } .button { font-family:"Ionicons"; font-size:48px; } .play:before { content:'\f488' } .pause:before { content:'\f478' } &lt;div id="main"&gt;&lt;/div&gt; The play button is displayed correctly, but when clicking it I get an error in my console that says: TypeError: this.play is not a function So I guess the error is that I can't access methods of the class from another method. I would be very …
score: 0

http://stackoverflow.com/q/29814158
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47755885
has comment: http://stackoverflow.com/comment/47755812
type: Question
has comment: http://stackoverflow.com/comment/47755966
has answer: http://stackoverflow.com/a/29814408
has body: // // The code above is to generate some options into selection. What I want to do there is, if the val in the #gameid is changed, the option list will change too, and so does for the #netid. However, the option doesn't change. It stay in the default value of the #gameid and #netid. I don't know what I am missing here. I need a help, please. [UPDATE] This code almost work. However, when I do the second change on the #cameid after all I have been select, it doesn't change the #campid selection anymore. It will do change it again if I do the change too on the #netid. $("#gameid" && "#netid").on('change', function(){ a = $("#gameid").val(), b = $("#netid").val(), c = a+b; $("#camp_id").empty(); for (var i = 1; i<=999; i++){ $("#camp_id").append(" "+(c+i)+" "); } });
has comment: http://stackoverflow.com/comment/47755985
has answer: http://stackoverflow.com/a/29814329
has answer: http://stackoverflow.com/a/29814492
has comment: http://stackoverflow.com/comment/47755853
has comment: http://stackoverflow.com/comment/47755826
has comment: http://stackoverflow.com/comment/47756009
has comment: http://stackoverflow.com/comment/47755894
has title: Generate option select on input change
has comment: http://stackoverflow.com/comment/47755845
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47755964
score: 0
has answer: http://stackoverflow.com/a/29814331
has comment: http://stackoverflow.com/comment/47755873
has answer: http://stackoverflow.com/a/29814322
answer count: 5

http://stackoverflow.com/comment/48089301
comment on: http://stackoverflow.com/q/29727436
has text: I had edit my question now. I had tried it But cannot make it success. Can you please let me know whats wrong.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47797032
comment on: http://stackoverflow.com/q/29835096
type: Comment
type: QuestionComment
has text: https://api.jquery.com/ready/
score: 0

http://stackoverflow.com/a/29803034
has body: You need to use focus event instead of click: $('input').on('focus',function(){ // Do something });
upvote count: 1
score: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29802649

http://stackoverflow.com/comment/47751033
type: Comment
comment on: http://stackoverflow.com/a/29811550
has text: But the widths need to be the same width as the tag... Automatically, the tag titles are coming from a database, and so I won't want hard code the widths for each tag...
score: 0
type: AnswerComment

http://stackoverflow.com/q/29776390
type: Question
tagged with: reactjs
answer count: 1
downvote count: 0
tagged with: refluxjs
tagged with: javascript
tagged with: reactjs-flux
has comment: http://stackoverflow.com/comment/47685258
has title: Reflux Stores - Avoiding regression issues/naming conflicts
favorite count: 0
has answer: http://stackoverflow.com/a/29777432
type: UnansweredQuestion
upvote count: 1
has body: We're building a rather complex React + Reflux application and have a couple of stores that listen to some actions originating from some other component. Eg: var FooStore = Reflux.createStore({ listenables: [FooActions, BarActions], ... }); I don't find this approach ideal for a couple of reasons: When extending the BarActions you can unknowingly introduce an action with the same name as a Foo action, which will result in a regression bug It's not necessarily obvious which functions relate to the BarActions when reading the code in the FooStore If you are aware of a naming conflict, then you need to create overly verbose actions How can I avoid these issues? EDIT My current approach to avoid these issues is to specifically state which actions the store is listening to over and above its main source of events: var FooStore = Reflux.createStore({ listenables: [FooActions], init: function() { this.listenTo(BarActions.shoot, this.onShoot); }, ... });
score: 1
has comment: http://stackoverflow.com/comment/47820352

http://stackoverflow.com/comment/47694494
comment on: http://stackoverflow.com/a/29782213
has text: What you say is correct but not relevant, as the `onclick` property is not used anywhere in the code, only the HTML `onclick` attribute which is not case sensetive.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47575964
has text: The mixin's lifecycle methods are indeed the answer. More on that in the [docs](https://facebook.github.io/react/docs/reusable-components.html#mixins). The last paragraph in the mixins section also states BinaryMuse's answer.
type: Comment
comment on: http://stackoverflow.com/a/29711516
score: 1
type: AnswerComment

twitter-bootstrap
tags question: http://stackoverflow.com/q/29833034
tags question: http://stackoverflow.com/q/29753527
tags question: http://stackoverflow.com/q/29817806
tag name: twitter-bootstrap
tags question: http://stackoverflow.com/q/29772609
tags question: http://stackoverflow.com/q/29805965
tags question: http://stackoverflow.com/q/29768713
tags question: http://stackoverflow.com/q/29838949
tags question: http://stackoverflow.com/q/29745889
tags question: http://stackoverflow.com/q/29730010
tags question: http://stackoverflow.com/q/29834776
tags question: http://stackoverflow.com/q/29797560
tags question: http://stackoverflow.com/q/29840823
tags question: http://stackoverflow.com/q/29699049
tags question: http://stackoverflow.com/q/29831881
tags question: http://stackoverflow.com/q/29711143
tags question: http://stackoverflow.com/q/29841727
tags question: http://stackoverflow.com/q/29764373
tags question: http://stackoverflow.com/q/29722599
tags question: http://stackoverflow.com/q/29725157
tags question: http://stackoverflow.com/q/29690952
tags question: http://stackoverflow.com/q/29738563
tags question: http://stackoverflow.com/q/29836199
tags question: http://stackoverflow.com/q/29732640
tags question: http://stackoverflow.com/q/29783192
tags question: http://stackoverflow.com/q/29805039
tags question: http://stackoverflow.com/q/29699762
tags question: http://stackoverflow.com/q/29707647
tags question: http://stackoverflow.com/q/29725969
tags question: http://stackoverflow.com/q/29795428
tags question: http://stackoverflow.com/q/29703554
tags question: http://stackoverflow.com/q/29784659
tags question: http://stackoverflow.com/q/29714638
tags question: http://stackoverflow.com/q/29756261
tags question: http://stackoverflow.com/q/29837385
tags question: http://stackoverflow.com/q/29741810
tags question: http://stackoverflow.com/q/29736439
tags question: http://stackoverflow.com/q/29713436
tags question: http://stackoverflow.com/q/29787358
tags question: http://stackoverflow.com/q/29806924
tags question: http://stackoverflow.com/q/29712076
tags question: http://stackoverflow.com/q/29719764
tags question: http://stackoverflow.com/q/29816570
tags question: http://stackoverflow.com/q/29708075
tags question: http://stackoverflow.com/q/29800224
tags question: http://stackoverflow.com/q/29832553
tags question: http://stackoverflow.com/q/29718849
tags question: http://stackoverflow.com/q/29822146
tags question: http://stackoverflow.com/q/29708759
tags question: http://stackoverflow.com/q/29725714
tags question: http://stackoverflow.com/q/29837371
tags question: http://stackoverflow.com/q/29807505
tags question: http://stackoverflow.com/q/29751206
tags question: http://stackoverflow.com/q/29758283
tags question: http://stackoverflow.com/q/29768413
tags question: http://stackoverflow.com/q/29767380
tags question: http://stackoverflow.com/q/29779764
tags question: http://stackoverflow.com/q/29689368
tags question: http://stackoverflow.com/q/29778833
tags question: http://stackoverflow.com/q/29766365
tags question: http://stackoverflow.com/q/29767553
type: Tag
tags question: http://stackoverflow.com/q/29787611
tags question: http://stackoverflow.com/q/29720573
tags question: http://stackoverflow.com/q/29831291
tags question: http://stackoverflow.com/q/29777617
tags question: http://stackoverflow.com/q/29700651
tags question: http://stackoverflow.com/q/29776760
tags question: http://stackoverflow.com/q/29796904
tags question: http://stackoverflow.com/q/29716853
tags question: http://stackoverflow.com/q/29832429
tags question: http://stackoverflow.com/q/29712261
tags question: http://stackoverflow.com/q/29780108
tags question: http://stackoverflow.com/q/29692809
tags question: http://stackoverflow.com/q/29796456
tags question: http://stackoverflow.com/q/29759236
tags question: http://stackoverflow.com/q/29778823
tags question: http://stackoverflow.com/q/29709320
tags question: http://stackoverflow.com/q/29771588
tags question: http://stackoverflow.com/q/29716773

http://stackoverflow.com/q/29735674
accepted answer: http://stackoverflow.com/a/29735776
answer count: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
upvote count: 2
score: 2
has answer: http://stackoverflow.com/a/29735776
type: AnsweredQuestion
has body: I am trying to add a button which will change the value of "box1" or "value!" to = 0. I've spent hours trying different approaches, can someone please point me in the right direction. Value 1 Value 2 Answer Calculate reset
has comment: http://stackoverflow.com/comment/47604470
has title: javascript variable reset button
has answer: http://stackoverflow.com/a/29735706
type: Question
has comment: http://stackoverflow.com/comment/47604467
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29735706
has answer: http://stackoverflow.com/a/29735719

http://stackoverflow.com/q/29732915
answer count: 1
tagged with: meteor
accepted answer: http://stackoverflow.com/a/29733246
favorite count: 0
type: AnsweredQuestion
has body: Is there any way to define a variable to be used only in a package, without exporting it to the client or the server? For example, //In /packages/fooPackage/foo.js packageScopedValue = 'foo'; //In /packages/fooPackage/package.js api.export('packageScopedValue', 'package'); //In /packages/fooPackage/other.js doStuffWith(packageScopedValue); Without polluting any other scope?
downvote count: 1
type: Question
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/29733246
has title: Package-scoped variable
upvote count: 0

http://stackoverflow.com/a/78552728
has body: If anyone is still looking at this in 2024 there is a more modern solution using "scroll-padding-top". This can just be applied to the html element: html { scroll-padding-top: 100px; } References: https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-padding-top https://getpublii.com/blog/one-line-css-solution-to-prevent-anchor-links-from-scrolling-behind-a-sticky-header.html
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29728412
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47772435
score: 0
comment on: http://stackoverflow.com/a/29823081
type: Comment
has text: add / remove class is `faa` and not `foo`.
type: AnswerComment

http://stackoverflow.com/q/29810975
type: Question
has comment: http://stackoverflow.com/comment/47750219
has title: Animate CSS on selection of
has comment: http://stackoverflow.com/comment/47784252
tagged with: javascript
has answer: http://stackoverflow.com/a/29811036
score: 0
has comment: http://stackoverflow.com/comment/47750071
has body: I am attempting to trigger a change of CSS for some objects further down in my code when one of the option tags is selected. I did not include them here as they are not pertinent to the issue at hand which is the jQuery. I am at a loss at this point. Here is what I have so far...is it even possible? ALL A B C D
has comment: http://stackoverflow.com/comment/47749977
answer count: 1
has comment: http://stackoverflow.com/comment/47749878
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47796406
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47749905
tagged with: css
has comment: http://stackoverflow.com/comment/47749978
has comment: http://stackoverflow.com/comment/47796518

http://stackoverflow.com/a/29779522
has comment: http://stackoverflow.com/comment/47689102
score: 6
type: Answer
has body: Since you are already returning a promise from the ajax call, then from your synchronous comparison, just return a resolved promise. Then, both code paths return promises that are resolved with the terminal value and the caller can use the same code to process the result no matter which way it works internally. This is a common design pattern for code that is sometimes synchronous and sometimes asynchronous. var myFunc = function (test) { if (test == 0) { return $.Deferred().resolve('value is zero '); } else { return $.post('/echo/html/', { html: 'false ', delay: .5 }).then(function (r2) { console.log('r2', r2); // this will be the return value of the promise return 'something from ajax finished'; }); } }; myFunc(1).then(function(value) { // value is here either way }); FYI, it does not make sense in your $.post() to use both a success handler function AND a .done() handler. If you're going to return a promise from the function (which is my recommendation), then you should use only promise handlers, not the success callback. You may also need to understand that it does nothing useful to return a value from the success handler of an ajax call. That return value just goes back into the asynchronous bowels of the ajax infrastructure and is never used by anything.
accepted answer of: http://stackoverflow.com/q/29779492
answers question: http://stackoverflow.com/q/29779492
upvote count: 6
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/29763477
answers question: http://stackoverflow.com/q/29763342
has comment: http://stackoverflow.com/comment/47658931
has comment: http://stackoverflow.com/comment/47659325
downvote count: 0
has comment: http://stackoverflow.com/comment/47658848
has comment: http://stackoverflow.com/comment/47659081
type: Answer
has comment: http://stackoverflow.com/comment/47658991
upvote count: 1
score: 1
has body: Try this, session_start(); $_SESSION['ProductName'] = $product-&gt;getProductName(); $_SESSION['ProductId'] = $product-&gt;getProductId(); $_SESSION['Stock'] = $product-&gt;getStock(); $_SESSION['UnitPrice'] = $product-&gt;getUnitPrice(); For multiple products, you may have to use an array of session. &lt;?php session_start(); if(!isSet($_SESSION['cart_items'])) { $_SESSION['cart_items'] = array(); } $items =$product-&gt;getProductName()."|".$product-&gt;getProductId()."|".$product- &gt;getStock()."|".$product-&gt;getUnitPrice(); array_push($_SESSION['cart_items'],$items); echo $_SESSION['cart_items'][0]; //First Product echo "&lt;br&gt;"; echo $_SESSION['cart_items'][1]; //Second Product ?&gt;
has comment: http://stackoverflow.com/comment/47659236

http://stackoverflow.com/q/29709354
linked to: http://stackoverflow.com/q/11485271
tagged with: javascript
linked to: http://stackoverflow.com/q/17954086
favorite count: 0
tagged with: google-chrome-extension
has answer: http://stackoverflow.com/a/29710316
has body: I'm trying to create a Chrome Extension that the user can login to with their Google account. I have based it on this sample code: https://developers.google.com/+/quickstart/javascript and it gets as far as gapi.auth2.init but then 400 errors with Error: redirect_uri_mismatch. The client ID is registered fine. The API call fails because the redirect_uri is wrong, but what URI do I set for an extension? The API call is made as so: gapi.auth2.init({ fetch_basic_profile: false, client_id: '1234_valid_id_1234', cookie_policy: 'none', redirect_uri: 'xxx', scope:'https://www.googleapis.com/auth/plus.login' }).then( 'xxx' as the uri is just an example, I've tried multitude of options in here, to no avail. The extension will load a dialogue as if it's going to begin the auth process but then craps out with the 400 error. I don't understand what URI an extension should be providing as a callback here, surely this isn't applicable? The client ID etc is fine - if I run the sample JS code on just a standard localhost website it all works fine, it's only when trying to use it in an extension that it breaks, because of the lack of callback URI.
type: UnansweredQuestion
upvote count: 1
tagged with: google-chrome
type: Question
score: 1
has comment: http://stackoverflow.com/comment/47557373
has comment: http://stackoverflow.com/comment/47555988
has title: Chrome Extension with G+ Signin - redirect_uri_mismatch
downvote count: 0
answer count: 1

http://stackoverflow.com/a/29711352
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29711234
upvote count: 1
answers question: http://stackoverflow.com/q/29711234
score: 1
has body: The thing you can do with ember is to write your very own adapter for this there are already many questions+answers out there: https://stackoverflow.com/a/17938593/1581725 https://stackoverflow.com/a/24411550/1581725 ... And there is also this blog entry here: http://eviltrout.com/2013/03/23/ember-without-data.html it's about using ember without ember-data. Found this little gem called normalizePayload - maybe this would also work for your case: https://stackoverflow.com/a/21790093/1581725

http://stackoverflow.com/q/29818844
has comment: http://stackoverflow.com/comment/47764605
accepted answer: http://stackoverflow.com/a/29819197
tagged with: blockui
tagged with: twitter-bootstrap
upvote count: 3
answer count: 1
has body: I use jquery BlockUI plugin to lock screen when request is executed. By default i set it for every ajax call. But i also have Bootstrap modals which load data inside using ajax. $(document) .ajaxStart(function() { $.blockUI({ message: $('#img-loader'), css: { border: 'none', padding: '5px', 'background-color': 'transparent', '-webkit-border-radius': '10px', '-moz-border-radius': '10px', opacity: .6, color: '#fff', cursor: 'wait' } }); }) .ajaxStop($.unblockUI); Problem - when i open modal screen become to dark (2 blockUI is applied). How can i unblockUI when modal is opened (use just Bootstrap background locker)? What i tried : $('.modal').on('shown.bs.modal', function() { $.unblockUI(); }); OR $('.modal').on('show.bs.modal', function() { $.unblockUI(); }); but this didn't work. It seems that BlockUI plugin block screen a bit later.
has answer: http://stackoverflow.com/a/29819197
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Don't use blockUI when open bootstrap modal dialog
favorite count: 0
tagged with: ajax
type: Question
score: 3

http://stackoverflow.com/comment/47532673
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29697322
has text: @TrueBlueAussie, I had added 2nd Part of your answer first. But then for some reason I started getting downvotes. So, yes. Your's is the correct answer in this case.

http://stackoverflow.com/a/29825351
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/29825020
type: Answer
answers question: http://stackoverflow.com/q/29825020
has body: You just have to add the start event in your sortable and update dimensions : $(function () { $(".grid").sortable({ tolerance: 'pointer', revert: 'invalid', placeholder: 'well placeholder tile', forceHelperSize: true, start: function( event, ui ) { ui.placeholder.height(ui.item.height()) ui.placeholder.width(ui.item.width()) } }); }); jsFiddle

angularjs
tags question: http://stackoverflow.com/q/29834080
tags question: http://stackoverflow.com/q/29797827
tags question: http://stackoverflow.com/q/29774583
tags question: http://stackoverflow.com/q/29810576
tags question: http://stackoverflow.com/q/29707386
tags question: http://stackoverflow.com/q/29697836
tags question: http://stackoverflow.com/q/29834623
tags question: http://stackoverflow.com/q/29775791
tags question: http://stackoverflow.com/q/29745699
tags question: http://stackoverflow.com/q/29837636
tags question: http://stackoverflow.com/q/29806037
tags question: http://stackoverflow.com/q/29765012
tags question: http://stackoverflow.com/q/29708998
tags question: http://stackoverflow.com/q/29711556
tags question: http://stackoverflow.com/q/29792166
tags question: http://stackoverflow.com/q/29797187
tags question: http://stackoverflow.com/q/29757976
tags question: http://stackoverflow.com/q/29703626
tags question: http://stackoverflow.com/q/29799628
tags question: http://stackoverflow.com/q/29716165
tags question: http://stackoverflow.com/q/29767603
tags question: http://stackoverflow.com/q/29717024
tags question: http://stackoverflow.com/q/29735496
tags question: http://stackoverflow.com/q/29776939
tags question: http://stackoverflow.com/q/29805648
tags question: http://stackoverflow.com/q/29817111
tags question: http://stackoverflow.com/q/29829737
tags question: http://stackoverflow.com/q/29747486
tags question: http://stackoverflow.com/q/29831637
tags question: http://stackoverflow.com/q/29689229
tags question: http://stackoverflow.com/q/29758326
tags question: http://stackoverflow.com/q/29831881
tags question: http://stackoverflow.com/q/29827171
tags question: http://stackoverflow.com/q/29832553
tags question: http://stackoverflow.com/q/29813285
tags question: http://stackoverflow.com/q/29693893
tags question: http://stackoverflow.com/q/29798658
tags question: http://stackoverflow.com/q/29830511
tags question: http://stackoverflow.com/q/29757165
tags question: http://stackoverflow.com/q/29696746
tags question: http://stackoverflow.com/q/29763683
tags question: http://stackoverflow.com/q/29837534
tags question: http://stackoverflow.com/q/29814201
tags question: http://stackoverflow.com/q/29845163
tags question: http://stackoverflow.com/q/29756703
tags question: http://stackoverflow.com/q/29797466
tags question: http://stackoverflow.com/q/29843222
tags question: http://stackoverflow.com/q/29779403
tags question: http://stackoverflow.com/q/29778224
tags question: http://stackoverflow.com/q/29694136
tags question: http://stackoverflow.com/q/29717527
tags question: http://stackoverflow.com/q/29802472
tags question: http://stackoverflow.com/q/29796693
tags question: http://stackoverflow.com/q/29698588
tags question: http://stackoverflow.com/q/29780563
tags question: http://stackoverflow.com/q/29722789
tags question: http://stackoverflow.com/q/29762382
tags question: http://stackoverflow.com/q/29723710
tags question: http://stackoverflow.com/q/29817771
tags question: http://stackoverflow.com/q/29840460
tags question: http://stackoverflow.com/q/29819690
tags question: http://stackoverflow.com/q/29724289
tags question: http://stackoverflow.com/q/29824294
tags question: http://stackoverflow.com/q/29703126
tags question: http://stackoverflow.com/q/29795402
tags question: http://stackoverflow.com/q/29760301
tags question: http://stackoverflow.com/q/29713109
tags question: http://stackoverflow.com/q/29740028
tags question: http://stackoverflow.com/q/29733057
tags question: http://stackoverflow.com/q/29781570
tags question: http://stackoverflow.com/q/29776676
tags question: http://stackoverflow.com/q/29772668
tags question: http://stackoverflow.com/q/29808749
tags question: http://stackoverflow.com/q/29809436
tags question: http://stackoverflow.com/q/29789542
tags question: http://stackoverflow.com/q/29784032
tags question: http://stackoverflow.com/q/29757960
tags question: http://stackoverflow.com/q/29829058
tags question: http://stackoverflow.com/q/29745058
tags question: http://stackoverflow.com/q/29699356

http://stackoverflow.com/comment/47576350
type: QuestionComment
score: 4
has text: 1, 2 doesn’t seem that random to me.
comment on: http://stackoverflow.com/q/29720879
type: Comment

http://stackoverflow.com/q/29749695
tagged with: gulp
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47638958
has comment: http://stackoverflow.com/comment/47636806
tagged with: css
tagged with: gulp-sourcemaps
has title: Gulp BootstrapCSS source maps
answer count: 0
type: Question
has body: I'm trying to generate the following CSS Source Map files, through gulp.js for the BootstrapCSS library. My gulp task is as folows: bower = require 'main-bower-files' sourcemaps = require 'gulp-sourcemaps' cssmin = require 'gulp-minify-css' gulpFilter = require 'gulp-filter' gulp.task 'compileVendorLibraries', -&gt; cssFilter = gulpFilter(['**/*.css']) gulp.src bower() .pipe cssFilter .pipe gulp.dest(dist.css + 'css') .pipe sourcemaps.init() .pipe rename({suffix: ".min"}) .pipe cssmin() .pipe sourcemaps.write() .pipe cssFilter.restore() And in index.html I have: &lt;link href="app/stylesheets/css/bootstrap.min.css" rel="stylesheet" type="text/css"&gt; However, I dont get the "original" bootstrap.css file in Chrome (source maps are activated) Whereas when I do it for my custom .less files as follows, I get the my original "styles.less" file: gulp.src sources.less .pipe sourcemaps.init() .pipe less() .on 'error', swallowError .pipe cssmin() .pipe sourcemaps.write() .pipe gulp.dest dist.css + 'css'
tagged with: source-maps
score: 0
tagged with: javascript

http://stackoverflow.com/comment/47603786
score: 0
type: AnswerComment
type: Comment
has text: Wow , thankyou for writing this for me ... it dosent work just gives no value after number of chat messages: but still a great effort
comment on: http://stackoverflow.com/a/29734806

http://stackoverflow.com/a/29798694
has comment: http://stackoverflow.com/comment/47979678
score: 3
has body: If you absolutely have to use indexOf while(b.indexOf(a) != -1) { b = b.replace(a, '[X]'); } while(b.indexOf('[X]') != -1) { b = b.replace('[X]', '&lt;span style="color:yellow;"&gt;' + a + '&lt;/span&gt;'); } $("#targetDiv").html(b); You can also do this with RegExp var a = $("#inp1").val(); var b = $("#txt").val(); var re = new RegExp(a, 'g'); var divContent = b.replace(re, '&lt;span style="color:yellow;"&gt;' + a + '&lt;/span&gt;'); $("#targetDiv").html(divContent); Here is a fiddle with the indexOf http://jsfiddle.net/eva3ttuL/1/
has comment: http://stackoverflow.com/comment/47973494
accepted answer of: http://stackoverflow.com/q/29798248
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29798248
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/47876113
has comment: http://stackoverflow.com/comment/47852079
downvote count: 0

http://stackoverflow.com/comment/47658965
comment on: http://stackoverflow.com/q/29763688
score: 0
type: Comment
type: QuestionComment
has text: Can you create a jsFiddle or atleast provide us the HTML and JavaScript instead of Ruby

http://stackoverflow.com/comment/47793332
has text: This is an anti-patern. There is no reason to unwrap a promise just to wrap it again. Just return the promise returned by `$http.post(...)`
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29832838
type: Comment

http://stackoverflow.com/comment/47561157
comment on: http://stackoverflow.com/a/29712639
type: AnswerComment
has text: Yeah, I know that's what MDN says. I don't think it's the right terminology to describe something that is fully specified in the ES6 draft spec and is implemented in a lot of places already. It's no longer "experimental".
type: Comment
score: 0

http://stackoverflow.com/q/29714776
has body: I need to print only the column that has been created by me. function retrieveFieldsOfListView(listTitle,viewName){ var context = new SP.ClientContext.get_current(); var web = context.get_web(); var list = web.get_lists().getByTitle(listTitle); var listFields = list.get_fields(); context.load(listFields); context.executeQueryAsync(printFieldNames,onError); function printFieldNames() { var e = listFields.getEnumerator(); while (e.moveNext()) { var fieldName = e.get_title(); console.log(fieldName); } } function onError(sender,args) { console.log(args.get_message()); } } But this code is printing all the pre-defined fields along with my field. I don't want the pre-defined fields like 'modified,created,etc'. I want only the coding changes. UI changes are not upto me.
has title: How to print only the created columns in Sharepoint using JavaScript
has comment: http://stackoverflow.com/comment/47577547
type: Question
has comment: http://stackoverflow.com/comment/47585414
tagged with: sharepoint
score: 0
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29728984

http://stackoverflow.com/a/29724073
answers question: http://stackoverflow.com/q/29723975
has body: I bet there is some errors going on that you just don't see because nothing is set to display them. If the javascript version works, then in your case calls, use javascript to redirect them instead of using the header() method.
score: 0
type: Answer

http://stackoverflow.com/a/29840235
has body: Do this, its the reverse of ng-if. Simply saying ! (NOT) Value has the same effect as ng-else would. There are ng-else-if (called ng-elif) directives as well, if that's more what you're looking for. If If Though there is literally no point to creating an ng-else directive when you can simply negate the checked value in ng-if, you can modify the ng-if directive like so to achieve the exact same thing $scope.$watch($attr.ngIf, function ngIfWatchAction(value) { if (!value) { // add the ! here instead and name this new directive ngElse
downvote count: 0
answers question: http://stackoverflow.com/q/29840145
type: Answer
has comment: http://stackoverflow.com/comment/47806738
upvote count: 1
score: 1

http://stackoverflow.com/q/29719096
type: Question
has comment: http://stackoverflow.com/comment/47591539
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47758422
favorite count: 0
tagged with: skipper
has body: I've built a site with admin panel with sails.js and deployed it on Heroku. Then I've uploaded image with Skipper. When i try to: fs.readdir "#{__dirname}/../../assets/images/Projects", (err, file)-&gt; console.log file I can see my file in folder. But i can't get it with ajax or in img tag. Here is code to upload (also if you can help me to optimize this code, I would be very greatfull) : create: (req, res, next)-&gt; project_id = req.param('id') res.setTimeout(0) if !project_id res.set('Content-Type', 'text/html; charset=utf-8') return res.badRequest('No id provided.') images_name = [] files_counter = 0 fileName = (__newFileStream, cb)-&gt; name = uuid.v4() + path.extname(__newFileStream.filename) # Saving names in array to insert it database images_name.push name cb null, name uploadFile = req.file('uploadFile') uploadFile.upload {dirname: "#{__dirname}/../../assets/images/Projects", saveAs: fileName}, (err, files)-&gt; return res.serverError(err) if err if uploadFile.isNoop res.set('Content-Type', 'text/html; charset=utf-8') return res.badRequest('No images provided!') for image,index in files nImage = {} # Inserting name from array to database nImage.image = images_name[index] nImage.project_id = project_id ProjectImages.create nImage, (error, image) -&gt; if error res.status 400 return res.json error files_counter++ if files_counter == files.length res.status 200 return res.send "Images upload done"
has title: Uploaded file (image) with Sails.js (Node.js), but cant get it from a clientside. App on Heroku
answer count: 0
upvote count: 3
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/47584004
tagged with: heroku
score: 3
tagged with: sails.js
has comment: http://stackoverflow.com/comment/47758344

http://stackoverflow.com/a/29748921
score: 0
has body: You can check location.hash (http://www.w3schools.com/jsref/prop_loc_hash.asp) to determine if hash existed. If you want to do something in each variants of navigation to this div: click and scroll you can use something like this: $(document).bind('scroll', function() { if($(this).scrollTop() &gt; $('.your-div').top()) { alert('do something'); } })
type: Answer
answers question: http://stackoverflow.com/q/29748535

http://stackoverflow.com/a/29777985
answers question: http://stackoverflow.com/q/29775527
has comment: http://stackoverflow.com/comment/47687792
upvote count: 1
has body: Vano's suggestion of a jQuery plugin is good, and there's no reason not to use that. If you want to do it yourself, though, the code should be pretty simple: var timer = -1; //so the timer doesn't start until everything is rendered setInterval(function() { timer--; if (!timer) { window.location = logoutUrl; } else if (timer &lt;= 5) { $('#timeout').html("Redirecting in " + timer + " seconds"); } }, 1000); $(document).on('ready keypress mousemove focus click scroll', function() { timer = 15; }); Working example: http://jsfiddle.net/jvvgepo4/
accepted answer of: http://stackoverflow.com/q/29775527
score: 1
has comment: http://stackoverflow.com/comment/47687200
has comment: http://stackoverflow.com/comment/47686864
has comment: http://stackoverflow.com/comment/47686913
has comment: http://stackoverflow.com/comment/47687228
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47689636
has comment: http://stackoverflow.com/comment/47687414
has comment: http://stackoverflow.com/comment/47731520
type: Answer

http://stackoverflow.com/a/29840303
answers question: http://stackoverflow.com/q/29840093
score: 0
type: Answer
has body: If you want the span value in &lt;input class="form-control" name="userId" id="userId" value="userId" type="hidden" placeholder="Enter e-mail Id"&gt;, try this. $(document).ready(function() { $(function() { $("#Relation").dialog({ autoOpen: false }); $(".addRelation").on("click", function() { var uid = $(this).find('span.uid').html(); $('#userId').val(uid); $("#Relation").dialog("open"); }); }); });

http://stackoverflow.com/q/29788881
has title: Basic JavaScript Animation
has answer: http://stackoverflow.com/a/29788957
possible better answer: http://stackoverflow.com/a/29788948
type: Question
has answer: http://stackoverflow.com/a/29788948
tagged with: javascript
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/29788957
has body: After looking through JavaScript animation tutorials and looking at other stack over flow posts. I'm wondering why this example does not work when I try to implement it myself. Even when copied verbatim the animation does not work. This is the version I created based off of the example code given. I very aware of the other examples available which contain more code yet this person seems to be using less and achieving the same result and advertising it as working code. I also know about CSS3 and how much easier it is to use, I'm just curious as to why this won't work. Thanks for reading. Animation
has comment: http://stackoverflow.com/comment/47706938
tagged with: animation
type: AnsweredQuestion

http://stackoverflow.com/q/29808484
has title: Partial Rendering from menu commandLink of a templated page
has comment: http://stackoverflow.com/comment/47747705
tagged with: ajax
linked to: http://stackoverflow.com/q/4589087
has comment: http://stackoverflow.com/comment/47834560
has comment: http://stackoverflow.com/comment/47818504
has comment: http://stackoverflow.com/comment/47757230
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
has body: I've now tried several "solutions" but no one worked for me. First i introduce the problem. I have a strictly html 5 template which i use fo my project so it is not possible to change here anything. The Framework used is JSF 2.0 The Problem: I have a xhtml template like this: template.xhtml <h:head> SOME MAIN TITLE | <ui:insert name="title" /> <ui:insert name="stylesheet" /> <ui:insert name="script" /> </h:head> <h:body styleClass="skin-blue"> <ui:insert name="header"> <ui:include src="header.xhtml" /> </ui:insert> <ui:insert name="lsidebar"> <ui:include src="leftsidebar.xhtml" /> </ui:insert> <ui:insert name="content" /> <ui:insert name="footer"> <ui:include src="footer.xhtml" /> </ui:insert> </h:body> and a header.xhtml <ui:composition> </ui:composition> and so on and a leftsidebar.xhtml where are links to the pages <ui:composition> <h:link fragment="#"> <h:panelGroup id="management"> <h:outputText value="#{msg['sidebar.navLink.management']}" /> </h:panelGroup> </h:link> <h:link outcome="/pages/subfolder/content1.xhtml"> <h:outputText value="Click me to navigate to 1" /> </h:link> <h:link outcome="/pages/subfolder/content2.xhtml"> <h:outputText value="Click me to navigate to 2" /> </h:link> </ui:composition> and last but not least a content page with: content.xhtml <h:body> <ui:composition> <ui:define name="title"> <h:outputText value="#{msg['content.pageTitle']}" /> </ui:define> <ui:define name="stylesheet"/> <h:outputStylesheet name="some.css" library="css" /> </ui:define> <ui:define name="script"/> <h:outputScript name="some.js" library="js" /> </ui:define> <ui:define name="content"> <Some content here> </ui:define> </ui:composition> </h:body> Now I want to navigate from a link or commandLink or something else what renders to an a href (without any other jsf added tags) from the leftsidebar.xhtml to load the templated content.xhtml with only rendering this content.xhtml maybe by <f:ajax render=":some_id_in_the_content_page"> The reason why to do that is that th…
favorite count: 0
has comment: http://stackoverflow.com/comment/47757770
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47834620
linked to: http://stackoverflow.com/q/7746221
tagged with: jsf
tagged with: render
type: Question
linked to: http://stackoverflow.com/q/7108668
has comment: http://stackoverflow.com/comment/47747738
tagged with: javascript

http://stackoverflow.com/comment/47630971
has text: Better. Now just type up the whole solution, paint it green, and we are done :)
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29748751

http://stackoverflow.com/comment/47575905
type: Comment
comment on: http://stackoverflow.com/a/29720412
type: AnswerComment
has text: @GopsAB I updated the answer with a rewrite. Although it's not normally the way I would write code (I always do things object oriented), notice the differences between that code and the code in your question.
score: 0

http://stackoverflow.com/comment/47779921
score: 0
has text: i can't seem to get the latlong of circumference of the circlemarker? If i can, then i can move the 2nd line to the circumference of the circle
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29811251

http://stackoverflow.com/q/29750804
tagged with: javascript
has answer: http://stackoverflow.com/a/29751028
favorite count: 0
answer count: 5
has title: Javascript Start setinterval after page loads
has answer: http://stackoverflow.com/a/29750872
has answer: http://stackoverflow.com/a/29751061
type: UnansweredQuestion
downvote count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/29751016
score: -2
linked to: http://stackoverflow.com/q/807878
has answer: http://stackoverflow.com/a/29750839
type: Question
duplicate of: http://stackoverflow.com/q/807878
has body: I have a script which displays seconds before showing hiding the div. var seconds_left = 20; var interval = setInterval(function() { document.getElementById('timer_div').innerHTML = "Or wait " + --seconds_left + " seconds to play the video."; if (seconds_left &lt;= 0) { //alert('The video is ready to play.'); $('#def').fadeOut('slow'); clearInterval(interval); } }, 1000); The problem is.. even the page is not fully loaded, the counting automatically starts. What can i do to make the counting start after the page fully loaded?

http://stackoverflow.com/comment/47558395
type: Comment
comment on: http://stackoverflow.com/a/29710720
type: AnswerComment
has text: One more thing, that I forgot to mention: for authentication, I'd recommend [Passport](http://passportjs.org/) -- that's one major component that Express won't handle for you.
score: 0

http://stackoverflow.com/a/29793975
has comment: http://stackoverflow.com/comment/47727881
upvote count: 1
has body: The error is in your directive Check this ,i have used the same directive in my app .directive('fileModel', ['$parse', function ($parse) { return { restrict: 'A', link: function(scope, element, attrs) { var model = $parse(attrs.fileModel); var modelSetter = model.assign; element.bind('change', function(){ scope.$apply(function(){ modelSetter(scope, element[0].files[0]); }); }); } }; } this is my html to input(type="file", file-model="myFile", accept="image/*", image="image", id='fileInput') This is a small service which I have created to handle the upload function fileUpload (file, uploadUrl) { var cropedImage = dataURItoBlob(file); var fileData = new FormData(), uploadedImage = ''; fileData.append('fileUpload', cropedImage); return $http({ withCredentials: true, method: "POST", url: uploadUrl, data: fileData, headers: {'Content-Type': undefined}, transformRequest: angular.identity }); } Try this, it's working for me
has comment: http://stackoverflow.com/comment/47758823
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29793650

http://stackoverflow.com/q/29743395
has comment: http://stackoverflow.com/comment/47620172
has comment: http://stackoverflow.com/comment/47620373
type: Question
accepted answer: http://stackoverflow.com/a/30097388
has body: When I use GET, everything works fine. However, I struggle to use POST to achieve the same effect. Here are the code I have tried: 1. app.post("/download", function (req, res) { res.download("./path"); }); 2. app.post("/download", function (req, res) { res.attachment("./path"); res.send("ok"); }); 3. app.post("/download", function (req, res) { res.sendFile("./path"); }); None of them work. What is the correct way to do this? EDIT: I submit a POST request through a HTML form to /download. ./path is a static file. When I use code in method 1, I can see the correct response header and response body in the developer tool. But the browser does not prompt a download.
linked to: http://stackoverflow.com/q/51993596
answer count: 1
tagged with: javascript
tagged with: express
has answer: http://stackoverflow.com/a/30097388
downvote count: 1
favorite count: 0
upvote count: 12
has comment: http://stackoverflow.com/comment/47621264
has comment: http://stackoverflow.com/comment/47620476
linked to: http://stackoverflow.com/q/7288814
has title: Express js: How to download a file using POST request
score: 11
has comment: http://stackoverflow.com/comment/47619908
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47619935

http://stackoverflow.com/q/29748782
upvote count: 1
tagged with: webview
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47631053
has comment: http://stackoverflow.com/comment/47630657
has answer: http://stackoverflow.com/a/29749514
tagged with: javascript
type: AnsweredQuestion
tagged with: android
favorite count: 0
has body: I am trying to call a WebView method from a method which is called by javascript in the webview. Webview then should return value that is used within the method. html event -> javascript -> jSinterface -> android method &lt;-> webview Apparently Webview runs in ui thread while js doesn't and webview's methods must be called from same thread. This method can be used to call methods from non-ui thread: webView.post(new Runnable() { public void run() { webView.loadUrl("javascript:" + s + ";"); } }); But I want to return result as well. return webView.getUrl() for example. How can I do that?
type: Question
accepted answer: http://stackoverflow.com/a/29749514
has title: Android returns methods must be called on same thread error
score: 0

http://stackoverflow.com/comment/47640022
type: Comment
comment on: http://stackoverflow.com/a/29745291
score: 1
has text: Well @DaumantasJakas of course you can still make a JS wrapper (and in this case i don't really see why using JQuery if you havent already imported it in other parts of your code) but you asked for an alternative way of styling inputs. That's the way using CSS alone. Of course it has some limitation in respect of a JS solution that is much more powerful.
type: AnswerComment

http://stackoverflow.com/comment/47519531
has text: My code looks like var Array; function Name(){ var MyLocalVar = … } would it be better to make it AllMyFile(){ var Array; function Name(){ var MyLocalVar = … }… } AllMyFile()
score: 0
comment on: http://stackoverflow.com/q/29691302
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29833231
tagged with: jquery
has comment: http://stackoverflow.com/comment/47793155
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
tagged with: checkbox
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47794139
type: Question
has comment: http://stackoverflow.com/comment/47793105
has title: Detecting if an HTML checkbox was selected
has answer: http://stackoverflow.com/a/29833603
accepted answer: http://stackoverflow.com/a/29833603
tagged with: javascript
has body: I have created the following jQuery script to check if my "chkboxAdd" checkbox has been clicked or not. (function ( $ ){ $.fn.myfunction = function(){ $("input[type='checkbox']").click(function() { if($(this).attr('name') == 'chkboxAdd' && $(this).attr('checked') == true ) { alert('Checkbox add is checked!'); } else { alert('Checkbox add is NOT checked!'); } }); }; })(jQuery); However after clicking the "chkboxAdd" checkbox, the alert prompt always go on the else clause instead of the if clause and prompts: Checkbox add is NOT checked! I have included the relevant HTML snippets for reference. Thank you in advance. Page ID Page Name Action <?php <?php echo $row["PAGEID"]; ?> <?php echo $row["PAGENAME"]; ?> Add

http://stackoverflow.com/comment/47731407
has text: @A.Wolff what do you mean sorry?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29801573

http://stackoverflow.com/comment/47599436
type: QuestionComment
has text: No, you cannot use a synchronous loop. What are looking for is a way to loop asynchronous. Look into promises, post your code (you can [edit] your question), then we can help you.
comment on: http://stackoverflow.com/q/29732539
score: 0
type: Comment

http://stackoverflow.com/comment/47645301
score: 0
type: Comment
type: QuestionComment
has text: @MarcoBonelli you can see this link. i've just taken a screenshot http://postimg.org/image/wepviivyd/
comment on: http://stackoverflow.com/q/29755686

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

http://stackoverflow.com/a/29702757
answers question: http://stackoverflow.com/q/29702649
has comment: http://stackoverflow.com/comment/47541444
has comment: http://stackoverflow.com/comment/47541419
has comment: http://stackoverflow.com/comment/47543313
has body: You should use jQuerys callback to create an infinitely recursing function. Just add a function after the declaration in your animate function, and then call the same function, but invert the passed boolean. Also, animate will do this incrementing very nice and smoothly for you! function scrollTopOrBottom(top){ if(top) $("body, html").animate({scrollTop: 0}, function(){ scrollTopOrBottom(false); }); else $("body, html").animate({scrollTop: $("document").height()}, function(){ scrollTopOrBottom(true); }); } scrollTopOrBottom(false); Update: As mentioned, this could create a * * ahem * * Stack Overflow, but the question is not concerned with that at this point. If you want to be safe, use a stop() after each $("body, html") statement to stop the call from proceeding if another one is in progress, therefore deferring overflow. Note: You could also wrap the if statement in {} but since it's one statement I find it a bit more legible, more sentence-like than code-like. But thats preference.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47541506
score: 8
has comment: http://stackoverflow.com/comment/47541349
has comment: http://stackoverflow.com/comment/47543204
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29702649
upvote count: 8
has comment: http://stackoverflow.com/comment/47541320

http://stackoverflow.com/q/29803359
has comment: http://stackoverflow.com/comment/47734611
has comment: http://stackoverflow.com/comment/47734899
answer count: 1
tagged with: javascript
tagged with: monitoring
tagged with: jquery
has title: How can I automatically find out which jQuery selectors are slow on my site ? Is there a plugin for this?
has comment: http://stackoverflow.com/comment/47734642
tagged with: performance-testing
has answer: http://stackoverflow.com/a/29803428
has body: I would like to automatically detect whenever a jQuery selector is slow (> some_millis) I want it to console log something about the line number. My first idea would be to override the core jQuery selector code to insert such a test there, but are there existing plugins to achieve this, has anyone attempted something similar ? Could some browser tool do it (maybe filter the method calls in a profiler) ? Note that I do not want to put some perf monitoring js code around each selector call !
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47735150
score: 0
accepted answer: http://stackoverflow.com/a/29803428
has comment: http://stackoverflow.com/comment/47734823
type: Question

http://stackoverflow.com/comment/48033748
type: Comment
comment on: http://stackoverflow.com/a/29721373
has text: The answer did not solve the problem rather arises some new problem.Actually i'm running timer inside a frame so when i used your code i had to click the frame portion to fire the onblur moreover onblur marking any click outside that particular frame as a focus lose even though i was clicking just another frame on the same window.
score: 0
type: AnswerComment

http://stackoverflow.com/q/29789935
downvote count: 1
type: Question
type: AnsweredQuestion
tagged with: javascript
score: -1
answer count: 3
upvote count: 0
tagged with: jquery
favorite count: 0
has body: I'm trying to fade a div in/out on a center slider item. I'm using owl-slider, the center slide/item gets assigned the class .center by the slider. Each slide has a div called Age, and I'm trying to make it so this Age div is hidden on all slides which don't have the .center class, and it fades in on the center slide. The center slide is navigated by the owl-prev/owl-next controls, so this is what I was thinking to trigger the change. Is it a more efficient way to do this? Example: The issue I'm having is how to test for the presence of the .center class on document load, and also how to initially set the Age div not visible on load also. I've tried $(".item-age").hide(); and it works, but when I click the next control all Age divs appear, not just the one associated with .center. This is what I'm trying: ` $(".owl-next").click(function(){ if ($('.owl-item').hasClass('center')){ $('.item-age').fadeIn(); } });`
possible better answer: http://stackoverflow.com/a/29790062
accepted answer: http://stackoverflow.com/a/29790959
has answer: http://stackoverflow.com/a/29790976
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47708851
has answer: http://stackoverflow.com/a/29790062
has answer: http://stackoverflow.com/a/29790959
has title: Fading div in and out on center slider item

http://stackoverflow.com/comment/47516402
comment on: http://stackoverflow.com/q/29689732
score: 0
type: Comment
has text: You'll have to show us the code that actually uses the result of the ajax call because that is probably where your coding error is, but you left that out of your question.
type: QuestionComment

http://stackoverflow.com/q/29828705
has answer: http://stackoverflow.com/a/29829182
type: Question
has title: Re-render the data in one way binding ng-repeat
tagged with: javascript
downvote count: 0
answer count: 1
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 2
has body: I am using one way binding in ng-repeat. still i want to refresh the ng-repeat when the array value is changed. Please suggest with your ideas: Example : TO DO List add Numbers The code can be found here at Plnkr

http://stackoverflow.com/comment/47789965
comment on: http://stackoverflow.com/q/29830951
score: 0
type: Comment
has text: You really need to fix that HTML
type: QuestionComment

http://stackoverflow.com/q/29748336
downvote count: 0
favorite count: 0
has body: Does anybody know how I can create an "arbitrarily" sized picture data url, with a single color - without using canvas? Basically, I'd like to create a GIF or PNG with a certain color and size. I need this to create place holder images with the correct dimensions, while waiting for the server to send proper images. I want this because it will perform well on a mobile phone, in combination with width: 100%. The image would consume the correct amount of pixels. I don't want to use canvas because I imagine it would be slower than altering a couple of bytes in a data URL.
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/png
tagged with: data-uri
answer count: 0
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47629046
tagged with: http://stackoverflow.com/tag/gif
tagged with: javascript
has title: Create a single color arbitrary size picture data url in javascript?
has comment: http://stackoverflow.com/comment/47629159

http://stackoverflow.com/a/29701237
score: 1
accepted answer of: http://stackoverflow.com/q/29700739
has comment: http://stackoverflow.com/comment/47540091
has comment: http://stackoverflow.com/comment/47539033
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47540112
has body: Try to execute this line: $("#lyristool").load("../path/tool.html #tool"); before loading the other script. I think your binding is not working because those elements don't exist on the page at the moment of binding. In order to be able to do that, you should put all your binding code in a document.ready callback.
type: Answer
has comment: http://stackoverflow.com/comment/47539913
has comment: http://stackoverflow.com/comment/47540478
answers question: http://stackoverflow.com/q/29700739
downvote count: 0

http://stackoverflow.com/comment/47591121
score: 0
type: Comment
type: QuestionComment
has text: APRULE, please see my modified answer which better suits your needs. @gerdi, good suggestion!
comment on: http://stackoverflow.com/q/29728412

deferred-execution
tags question: http://stackoverflow.com/q/29811418
type: Tag
tag name: deferred-execution

http://stackoverflow.com/comment/47561783
type: QuestionComment
score: 4
has text: Use script type='text/javascript'
comment on: http://stackoverflow.com/q/29713268
type: Comment

http://stackoverflow.com/comment/47632937
type: QuestionComment
comment on: http://stackoverflow.com/q/29735690
has text: @AndresBastias It's still not clear exactly what you're trying to do. What do you want to update the L.markers to?
score: 0
type: Comment

http://stackoverflow.com/a/29699723
type: Answer
has body: You could use $(window).width() $(window).height() to get the width and height of the screen and use it accordingly. &lt;script&gt; $(document).ready(function() { var width = $(window).width(); if (width&lt;=480) { $('#simple-menu').sidr(); } else { // you could call the other version of the slider. } }); &lt;/script&gt;
accepted answer of: http://stackoverflow.com/q/29699517
has comment: http://stackoverflow.com/comment/47536441
has comment: http://stackoverflow.com/comment/47536700
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47535710
answers question: http://stackoverflow.com/q/29699517
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29753713
score: 14
tagged with: javascript
has answer: http://stackoverflow.com/a/29753725
answer count: 2
has answer: http://stackoverflow.com/a/29753823
downvote count: 0
has comment: http://stackoverflow.com/comment/47639889
has body: The following indicates the expression "true instanceof Boolean" evaluates to false. Why would this expression evaluate to false? $(document).ready(function() { var $result = $('#result'); if(true instanceof Boolean) { $result.append('I\'m a Boolean!'); } else { $result.append('I\'m something other than a Boolean!'); } });
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/203739
has title: Why is 'true instanceof Boolean' equal to false in JavaScript
duplicate of: http://stackoverflow.com/q/203739
upvote count: 14
type: Question

http://stackoverflow.com/comment/47566787
score: 0
type: Comment
has text: i changed output same as above just look at above by the way thank you very much
comment on: http://stackoverflow.com/a/29715784
type: AnswerComment

http://stackoverflow.com/q/29697570
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47531889
type: AnsweredQuestion
tagged with: spring-boot
has comment: http://stackoverflow.com/comment/47537112
has body: Basically, I have a HTML search form which allows me to search within the database. A JavaScript function is called when the form is submitted but I'm not redirected to the required page. "Request method 'POST' not supported" is the error message received. My code: &lt;form th:object="${devices}" method="POST" onsubmit="return fireAction()"&gt; &lt;input type="text" id="search" name="search" /&gt; &lt;input type="submit" value="Search"/&gt; &lt;/form&gt; function fireAction() { var searchInput = document.getElementById('search').value; var searchFilter = document.getElementById('deviceAttributes').value; var checkbox = document.getElementById('lastEntry').checked; alert(searchInput + " " + searchFilter + " " + checkbox); if (searchInput == "" || searchInput == null) { alert("Search field cannot be null."); return false; } else if (checkbox) { window.location.href = '/current/' + searchInput + '/filter/' + searchFilter; } else { window.location.href = '/showForm/' + searchInput + '/filter/' + searchFilter; } } @RequestMapping(value = "/showForm/{keyword}/filter/{searchFilter}", method = RequestMethod.POST) public String showForm(@PathVariable("keyword") String keyword, @PathVariable("searchFilter") String searchFilter, Model model) { Devices devices = new Devices(); devices.setSearch(keyword); devices.setSearchFilter(searchFilter); model.addAttribute( "addDevices", device.findByDevicesName(devices.getSearch(), devices.getSearchFilter())); return "showForm"; } @RequestMapping(value = "/current/{keyword}/filter/{searchFilter}", method = RequestMethod.POST) public String currentDevices(@PathVariable("keyword") String keyword, @PathVariable("searchFilter") String searchFilter, ModelMap model) { model.addAttribute("devices", new Devices()); Devices devices = new Devices(); devices.setSearch(keyword); devices.setSearchFilter(searchFilter); List&lt;Devices&gt; newList = device.allDevices(); ListIterator&lt;Devices&gt; iterator = newList.listIterator(); List&lt;Devices&gt; r…
has comment: http://stackoverflow.com/comment/47537581
accepted answer: http://stackoverflow.com/a/29722174
has comment: http://stackoverflow.com/comment/47531987
type: Question
has comment: http://stackoverflow.com/comment/47532149
tagged with: javascript
has answer: http://stackoverflow.com/a/29722174
has title: Request method 'POST' not supported Spring Boot

http://stackoverflow.com/q/29718212
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47571021
tagged with: javascript
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/29718255
has title: Button that toggles font-weight in text area when clicked
has comment: http://stackoverflow.com/comment/47570877
has comment: http://stackoverflow.com/comment/47570886
upvote count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47570970
answer count: 1
tagged with: toggleclass
favorite count: 0
has comment: http://stackoverflow.com/comment/47571054
has comment: http://stackoverflow.com/comment/47571004
type: UnansweredQuestion
has body: I am trying to make a button that changes the font-weight to bold when it is clicked and then back to normal again when it is un-clicked. But the hard part is that I only want the part of the text area that they clicked on the bold button for to be bolded, so I do not want all of the text area to be bold. I tried making it were all of the text area would be bold at first but it won't work. I am sure it is probably really easy, but I can't figure it out. I will put my code below, thank you for your time. Bold JavaScript: $(document).ready(function(){ $('#bold').click(function(){ $('.textdoc').toggleClass('.boldClass'); }); }); PS:This obviously is not all my code, comment telling me if you think I need to post all of it, but I think that the problem could just be solved with the code I have here.
has comment: http://stackoverflow.com/comment/47571151
has comment: http://stackoverflow.com/comment/47570840

http://stackoverflow.com/q/29755296
tagged with: javascript
has answer: http://stackoverflow.com/a/29756159
downvote count: 0
has answer: http://stackoverflow.com/a/29755425
favorite count: 0
has title: 'ECONNREFUSED' when trying to using socket to connect to remote computer over TCP
type: UnansweredQuestion
tagged with: sockets
upvote count: 1
tagged with: node.js
score: 1
tagged with: tcp
type: Question
answer count: 2
has body: I'm having some trouble trying to connect to a remote machine using node.js net API. This code works perfectly locally, but when I try and test it with another person's machine, it gives me the error: 'ECONNREFUSED' This is the server side code. var net = require('net'); var HOST = '127.0.0.1'; //local host var PORT = 18000; net.createServer(function(sock) { // We have a connection - a socket object is assigned to the connection automatically console.log('CONNECTED: ' + sock.remoteAddress +':'+ sock.remotePort); // Add a 'data' event handler to this instance of socket sock.on('data', function(data) { console.log('DATA ' + sock.remoteAddress + ': ' + data); // Write the data back to the socket, the client will receive it as data from the server sock.write('You said "' + data + '"'); }); // Add a 'close' event handler to this instance of socket sock.on('close', function(data) { console.log('CLOSED: ' + sock.remoteAddress +' '+ sock.remotePort); }); }).listen(PORT, HOST); console.log('Server listening on ' + HOST +':'+ PORT); // using sockets to connect to another computer on TCP This is the client side code: var net = require('net'); var HOST = '127.0.0.1'; //change this to IP address of the computer I'm trying to connect to var PORT = 18000; var client = new net.Socket(); client.connect(PORT, HOST, function() { console.log('CONNECTED TO: ' + HOST + ':' + PORT); // Write a message to the socket as soon as the client is connected, the server will receive it as message from the client client.write('I am Chuck Norris!'); }); // Add a 'data' event handler for the client socket // data is what the server sent to this socket client.on('data', function(data) { console.log('DATA: ' + data); // Close the client socket completely client.destroy(); }); client.on('error', function(data){ console.log('connection error'); }); // Add a 'close' event handler for the client socket client.on('close', function() { console.log('Connection closed'); }); Any idea what I might be doing wron…

http://stackoverflow.com/comment/47776758
comment on: http://stackoverflow.com/a/29825011
type: AnswerComment
score: 0
type: Comment
has text: Thank you. I tried the solution suggested in the link http://stackoverflow.com/questions/24233814/how-to-disable-the-weird-condition-check-in-jslint but it is not working.

http://stackoverflow.com/comment/47776951
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29817668
has text: Bergi, "edge of legality"?
type: Comment

http://stackoverflow.com/comment/47537635
has text: make the tag img instead of button and then after 'continue' add this ; this.src = (isRunning) ? 'img1.jpb' : 'img2.jpg'
comment on: http://stackoverflow.com/a/29700445
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29803270
accepted answer of: http://stackoverflow.com/q/29799320
has comment: http://stackoverflow.com/comment/47764202
has comment: http://stackoverflow.com/comment/47759597
score: 1
upvote count: 1
has body: This solution is specifically for your approach. You can use the module's run block to assign the prototype. In File 2 add the following: angular.module("Test").run(function(BaseController) { ChildController.prototype = Object.create(BaseController.prototype); }); BaseController gets injected and is available for creating the prototype. Since this code runs before any controller gets instantiated you get your prototypal inheritance. Also keep in mind that ChildController.$inject has to contain all of BaseController.$inject. An alternative would be to attach BaseController to the module itself: angular.module("Test").BaseController = BaseController; ... ChildController.prototype = Object.create(angular.module("Test").BaseController.prototype); The code would still be private and the constructor function is still only accessible through the module. You can also look for alternatives to inheritance. Depending on the situation hierarchical controllers might be a viable solution. &lt;div ng-controller="BaseController"&gt;&lt;%-- Handle Generic stuff --%&gt; ... &lt;div ng-controller="ChildController"&gt;&lt;%-- Handle specific stuff --%&gt;
downvote count: 0
has comment: http://stackoverflow.com/comment/47765995
has comment: http://stackoverflow.com/comment/47810151
answers question: http://stackoverflow.com/q/29799320
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47844282
has comment: http://stackoverflow.com/comment/47757932
type: Answer

http://stackoverflow.com/comment/47753641
score: 0
comment on: http://stackoverflow.com/q/29812728
has text: In the DOM, I see angular's ng-repeat comment just inside the controller declaration. but no div inside.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/86595512
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29789767
has text: Have a look at it: https://stackoverflow.com/a/49790265/8494462

http://stackoverflow.com/a/29702227
answers question: http://stackoverflow.com/q/29699712
type: Answer
score: 3
downvote count: 0
upvote count: 3
has body: Easy, simply download this file here: https://github.com/Matt-Esch/virtual-dom/blob/master/dist/virtual-dom.js and then include it in your page: &lt;script src="virtual-dom.js"&gt;&lt;/script&gt; Now you can access it like: virtualDom.create(...); virtualDom.diff(...); virtualDom.h(...); virtualDom.patch(...);

http://stackoverflow.com/comment/47635547
type: Comment
has text: The goal of the `ScriptEvaluationJob` is to evaluate (execute) the script. If it needs to parse a string because no AST is available yet, that's a minor annoyance but does not affect the naming :-)
comment on: http://stackoverflow.com/a/29751078
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47776982
type: QuestionComment
has text: Do you know how to make it work with external css like code that I have posted?
score: 0
comment on: http://stackoverflow.com/q/29825063
type: Comment

http://stackoverflow.com/q/29696856
type: Question
has title: JSON String loop and print
answer count: 1
score: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47530042
has comment: http://stackoverflow.com/comment/47530471
has answer: http://stackoverflow.com/a/29697346
has comment: http://stackoverflow.com/comment/47529843
tagged with: javascript
has body: I have a JSON string in this format {"prey":["{\"distance\": 8.686924173343307, \"signal\": \"-59\", \"frequency\": 2447, \"mac\": \"00:00:00:00:00:00\", \"ip\": \"192.168.43.27\"}"]} I am parsing this json using var jsonSpy = JSON.parse(userList); what I am trying to do it get the distance out of it using the code bellow I have two variants both do the same thing. I can get it to output each individual array of distance, signal, frequency, mac and ip but can't get the individual bits of data as shown in the code bellow. I know the loop and the each do the same thing the json prints out a string but when I try to get the distance I get an undefined message not an error it just returns undefined. for(var i = 0; i &lt; jsonSpy.prey.length; i++) { console.log(jsonSpy.prey[i]); console.log(jsonSpy.prey[i].distance); ctx.fillRect(jsonSpy.prey[i].distance, 300, 20, 20); } $.each(jsonSpy.prey, function(i, item) { console.log(jsonSpy.prey[i]); console.log(jsonSpy.prey[i].distance); ctx.fillRect(jsonSpy.prey[i].distance, 300, 20, 20); });
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47529969
has comment: http://stackoverflow.com/comment/47529884
accepted answer: http://stackoverflow.com/a/29697346
has comment: http://stackoverflow.com/comment/47529808
has comment: http://stackoverflow.com/comment/47529927

http://stackoverflow.com/a/29692398
answers question: http://stackoverflow.com/q/29692127
type: Answer
has comment: http://stackoverflow.com/comment/47522239
has body: No, it won't work. document.getElementById() method accepts only one argument. However, you may always set classes to the elements and use getElementsByClassName() instead. Another option for modern browsers is to use querySelectorAll()method: use $("div[id*='view']") DEMO :http://jsfiddle.net/mkufymqr/1/
score: 0

http://stackoverflow.com/a/29728362
upvote count: 4
has comment: http://stackoverflow.com/comment/47590490
has comment: http://stackoverflow.com/comment/47590917
type: AcceptedAnswer
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/47590850
accepted answer of: http://stackoverflow.com/q/29728278
has comment: http://stackoverflow.com/comment/47590526
has comment: http://stackoverflow.com/comment/47590621
type: Answer
has comment: http://stackoverflow.com/comment/47590907
has comment: http://stackoverflow.com/comment/47590925
has body: when you use header('Location: ../homepage.php'); it wont execute the two lines afterward. That is the whole problem. You can do it either by passing variables through header like this : header('Location: ../homepage.php?log'); or setting session in your php script and use redirect afterwards. You also need php file in order to catch the parameter you just send and use if like this : if(isset($_GET['log'])){ echo "&lt;script language='javascript'&gt; console.log('Email already exists'); &lt;/script&gt;"; echo "&lt;script&gt; console.log('ccccc'); &lt;/script&gt;"; } or : if(isset($_SESSION['log'])){ echo "&lt;script language='javascript'&gt; console.log('Email already exists'); &lt;/script&gt;"; echo "&lt;script&gt; console.log('ccccc'); &lt;/script&gt;"; } It depends on what method you used earlier. So turn your homepage.html into homepage.php and put it there.
answers question: http://stackoverflow.com/q/29728278

http://stackoverflow.com/q/29804245
type: Question
tagged with: c#
tagged with: google-maps
downvote count: 0
tagged with: javascript
favorite count: 0
answer count: 1
score: 1
tagged with: asp.net
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/29835519
has title: find google map places with name from coordinates that is points in map
has body: i create my google map with coordinates that is comming from my database. in my table i have coordinates which i points with google pointer in my asp.net page. but now i wants to search with name of city which i have coordinate of search name in my db and highlight with color in google map i have the following code to fetch my db coordinates:

http://stackoverflow.com/q/29793372
has body: Can I share a cookie (set, read and update it) between two directions of mi website, for example, localhost/mysite/path1 and localhost/mysite/path2, using javascrit or jquery? UPDATE I'm trying to do this: 1.- In localhost/mysite/index.php set a cookie with an array in json: $.cookie("cart", cart_json, { expires: date}, {path: "/"}); 2.- In localhost/mysite/folder/file.php both read and modified it with another array in json: a = $.cookie("cart") #manipulate a and save it in new_cart_json $.cookie("cart", new_cart_json, { expires: date}, {path: "/"}); 3.- I back to localhost/mysite/index.php, try to read the cookie and as result have the content put in cart_json. I check the cookies and now I have 2 cookies called "cart": One in the path /mysite and anothe in the path /mysite/folder
score: 0
has title: Share cookies over folders
answer count: 0
type: UnansweredQuestion
tagged with: cookies
type: Question
has comment: http://stackoverflow.com/comment/47717649
has comment: http://stackoverflow.com/comment/47718481
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47816386

http://stackoverflow.com/comment/47807482
score: 1
has text: I think missing `.value` it should be `document.getElementById('staffname').value`
type: Comment
comment on: http://stackoverflow.com/q/29840617
type: QuestionComment

http://stackoverflow.com/q/29752297
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29752756
has comment: http://stackoverflow.com/comment/47637551
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/29752658
has title: Angular JS - Adding a jquery plugin to jQlite
type: AnsweredQuestion
upvote count: 3
type: Question
has answer: http://stackoverflow.com/a/29752756
tagged with: jqlite
has body: I need to do some dom traversal on a $element, but jQuery or jQlite don't do what I need out of the box so I need to use a jQuery plugin called closestChild. https://github.com/lolmaus/jquery.closestchild/blob/master/jquery.closestchild.js I have installed using bower and I'm trying to load it after angular.min.js in my script tags but still getting the following error. Uncaught TypeError: Cannot read property 'fn' of undefined So, I assume that jQlite that comes with Angular doesn't give you the $ to work with by default? Or am I just doing things in the wrong order?
tagged with: javascript
answer count: 2
score: 3
has comment: http://stackoverflow.com/comment/47637635
downvote count: 0
has answer: http://stackoverflow.com/a/29752658

http://stackoverflow.com/comment/113922874
comment on: http://stackoverflow.com/a/29964878
score: 0
type: Comment
type: AnswerComment
has text: It seems that many times it's null, and yet the other field that tells you whether it's opened or not - isn't. How come? How could it know if it's currently opened or not, if it doesn't know when it's opened? Also, how come there is no known format for the times it's opened?

http://stackoverflow.com/comment/47764842
type: Comment
type: QuestionComment
has text: You would need to use a loop and append the required HTML elements to the DOM.
score: 2
comment on: http://stackoverflow.com/q/29819114

http://stackoverflow.com/comment/47522802
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29693062
has text: I'm not tied to AJAX. My broader question is: 'How do I refresh my page after the 'next' button is clicked, and include data entered in the page in my refreshed page?' What's the best way to do this?
type: AnswerComment

http://stackoverflow.com/comment/47795056
type: QuestionComment
score: 1
has text: @DavidGrinberg Don’t forget the `;`s.
comment on: http://stackoverflow.com/q/29834131
type: Comment

http://stackoverflow.com/a/29816615
has comment: http://stackoverflow.com/comment/47760626
has comment: http://stackoverflow.com/comment/47760568
has body: updating the answer as per the updated question. This code will work for you. Give it a try. for (var i = 1; i <= 5; i++) { $('#feed').append(' '+ i +': Test '); } But I tell you again not to use the value tag, you already have your counter in id so split it fro there if you want. Cheers!!
has comment: http://stackoverflow.com/comment/47760436
score: 0
answers question: http://stackoverflow.com/q/29816414
type: Answer
has comment: http://stackoverflow.com/comment/47760730

http://stackoverflow.com/a/29811412
type: AcceptedAnswer
downvote count: 0
has body: That code is really close to working. It will work correctly if you replace $(this) with $(e.target). This will get the left and top offsets of the click event, not the window itself. (function($) { $(document).ready(function() { $(window).click(function(e) { var relativeX = (e.pageX - $(e.target).offset().left), relativeY = (e.pageY - $(e.target).offset().top); alert("X: " + relativeX + " Y: " + relativeY); }); }); })(jQuery); http://jsfiddle.net/IronFlare/7wsamt87/
type: Answer
accepted answer of: http://stackoverflow.com/q/29811284
score: 6
answers question: http://stackoverflow.com/q/29811284
upvote count: 6

http://stackoverflow.com/comment/48337489
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29785784
has text: Well unfortunately that approach seems to have [undesirable side effects](https://github.com/myndzi/pool2/issues/6) so I'll most likely have to go back to my initial approach, which was stubbing Promise.delay() directly.
score: 0

http://stackoverflow.com/comment/47637305
comment on: http://stackoverflow.com/q/29749532
type: Comment
has text: Hey @Quentin I am using a different connection in the rest of my system this was a quick mock to test how to login thank you for mentioning though. Also I am still debugging the issue just hoping someone may of had the same issue or can spot a problem Im missing.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47660984
type: Comment
comment on: http://stackoverflow.com/a/29763793
has text: in RegresiController .controller('RegresiController', function($scope, shareDataService) { $scope.xi = []; $scope.yi = []; shareDataService.addXi($scope.xi); shareDataService.addYi($scope.yi); });
type: AnswerComment
score: 0

http://stackoverflow.com/a/29746236
answers question: http://stackoverflow.com/q/29746118
type: Answer
has body: Do it with classnames, and use ".closest(selector)" to select the closest element (parents) matching the selector to select the "current row". This will only work on the delete button at each row. $(".button-remove").on("click", function(e) { e.preventDefault(); $(this).closest(".row").remove(); }); I would recommend changing the class-names to something js specific.
score: 0

http://stackoverflow.com/q/29705217
answer count: 1
tagged with: javascript
tagged with: variables
has answer: http://stackoverflow.com/a/29705446
score: 0
has title: How this javascript variable is set
linked to: http://stackoverflow.com/q/29682494
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/29682494
has comment: http://stackoverflow.com/comment/47545955
has body: I would like to know how a particular variable in a &lt;script&gt; tag is set. Because even when I disable Javascript in my browser, it is still set, I don't get how? The variable can be found here: https://admin.booking.com/hotel/hoteladmin/ html &gt; head &gt; script &gt; token For more informations about why I need to understand this, here is my original post.
type: Question
has comment: http://stackoverflow.com/comment/47545952

http://stackoverflow.com/q/29715307
has title: Collection_select redirecting with parameters with the help of javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29715548
tagged with: ruby
has body: I am trying to make a redirect the user to a route 'attendance/:domain' when the option from the dropdown that I made changes. I am doing this using javascript. Earlier implementations like: window.location = "&lt;%= url_for(:controller =&gt; 'attendance', :action =&gt; 'index') %&gt;?" + id; just add the id to the earlier link so if I had 'attendance/2' it would become 'attendance/23' instead of 'attendance/3' . So I am trying to use the path provided by ruby like so: config.rb: get 'attendance/:domain', to: 'attendance#index', as: 'attendance_domain' view: &lt;div class="form-group col-lg-3 col-md-5 "&gt; &lt;%= label_tag(:domain, "Domeniu", class: "control-label") %&gt; &lt;%= collection_select(nil, :id, @domains, :id, :complete_name, {selected: -1}, {:onchange=&gt; "redirectToIndex(this.value)",:selected =&gt; params[:domain],class: "form-control"}) %&gt; &lt;/div&gt; javascript in view: function redirectToIndex(trainerId){ window.location ="&lt;%= url_for(attendance_domain_path(" + trainerId + ")) %&gt;"; } In this implementation the link that I am redirected to is : http://localhost:3000/attendance/ + trainerId + which is not what I wanted. Instead of trainerId it should be the value of that variable. Any tips please ? In the end my question is : How can I redirect with parameters using collection_select. This dropdown will be available on the same page so the parameters need to change accordingly not like in the situation described above.
upvote count: 1
tagged with: ruby-on-rails
type: AnsweredQuestion
score: 1
type: Question
possible better answer: http://stackoverflow.com/a/29715548
answer count: 2
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29715579
accepted answer: http://stackoverflow.com/a/29715579

http://stackoverflow.com/comment/47730963
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29801414
score: 1
has text: Just strip out the styles you want for the buttons and toss out the rest. http://getbootstrap.com/customize/

http://stackoverflow.com/comment/47596104
type: QuestionComment
has text: I'm guessing you mean form, not forum.
score: 2
comment on: http://stackoverflow.com/q/29731448
type: Comment

http://stackoverflow.com/a/29790420
score: 1
has comment: http://stackoverflow.com/comment/47776486
downvote count: 0
has body: If you want to find all the documents with information = 'doctor', why not just query without the name? db.user.find({information: "doctor" });
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29790124

http://stackoverflow.com/comment/47715059
type: Comment
comment on: http://stackoverflow.com/q/29793245
type: QuestionComment
score: 0
has text: _if the parameters are invalid_ what parameters are we talking about? Post a relevant example.

http://stackoverflow.com/a/29836773
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47800324
downvote count: 0
has comment: http://stackoverflow.com/comment/47801614
accepted answer of: http://stackoverflow.com/q/29836745
type: Answer
has comment: http://stackoverflow.com/comment/47800377
has comment: http://stackoverflow.com/comment/47800527
score: 5
answers question: http://stackoverflow.com/q/29836745
upvote count: 5
has body: Use .html instead of .text so you keep the HTML. There's also no need to use [] in the regexp when you're just replacing one character. However, you need to escape the pipe character outside a character set, since it means alternation. $("#doit").click(function() { $('#mainNav').html(function(index, text) { return text.replace(/\|/g, ''); }); }); Home| About| Areas of Practice| In the News| Contact Remove pipes
has comment: http://stackoverflow.com/comment/47800406
has comment: http://stackoverflow.com/comment/47800304

http://stackoverflow.com/comment/47773405
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29823029
score: 0
has text: please have a look at answer updated by me

http://stackoverflow.com/q/29828331
favorite count: 0
tagged with: tinymce
type: Question
has body: I have a TinyMCE editor on my website and I would like to have the editable area (or the whole thing) displayed in A4 format. Basically, I would like to view the document in the same way as in MS Word. (width, pagebreaks etc.) Is that even possible? Please point me in the right direction.
has comment: http://stackoverflow.com/comment/76566527
has comment: http://stackoverflow.com/comment/76566518
has answer: http://stackoverflow.com/a/53574922
answer count: 3
score: 18
upvote count: 18
tagged with: tinymce-4
has answer: http://stackoverflow.com/a/45369331
downvote count: 0
has answer: http://stackoverflow.com/a/62507668
has title: TinyMCE display as A4
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/a/29743235
downvote count: 0
answers question: http://stackoverflow.com/q/29743152
upvote count: 2
type: Answer
has body: For specifying the css you can use the .css()-function of jQuery: $('.top-bar-section ul li').css({ '-webkit-transform' : 'skewX(-15deg)', '-moz-transform' : 'skewX(-15deg)', '-ms-transform' : 'skewX(-15deg)', '-o-transform' : 'skewX(-15deg)', 'transform' : 'skewX(-15deg)' }); Demo Or you can specify a second class, e.g.: .top-bar-section ul li.london { transform: skewX(-15deg); } and call $('.top-bar-section ul li').addClass('london'); inside your if-condition. For removing the class you can use .removeClass() Reference .css() .addClass() .removeClass
accepted answer of: http://stackoverflow.com/q/29743152
score: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/47752819
type: QuestionComment
comment on: http://stackoverflow.com/q/29812338
has text: You can validate your JS here: http://www.jslint.com/..And where is your `addMessages`?
score: 0
type: Comment

http://stackoverflow.com/a/29825197
downvote count: 1
has comment: http://stackoverflow.com/comment/47776868
score: -1
answers question: http://stackoverflow.com/q/29824815
has comment: http://stackoverflow.com/comment/47777603
upvote count: 0
has comment: http://stackoverflow.com/comment/47776810
has body: This is where you use link and pass it to your controller. Html: &lt;my-fancy-directive my-attribute="something"&gt;&lt;/my-fancy-directive&gt; Javascript: app.directive('myFancyDirective', function() { restrict:'E', replace:true, controller:function($scope){ $scope.theAttribute = ""; }, link:function(scope,elem,attr) { attr.$observe('myAttribute',function(newValue,oldValue){ if(newValue != oldValue) scope.theAttribute = newValue; }) } }); Bonus tip: to remember the variables in the linkfunction, just think of "sea". Scope, Element, Attributes
has comment: http://stackoverflow.com/comment/47777536
type: Answer

http://stackoverflow.com/q/29819137
has body: I need a way of generating dynamic forms based on a document structure in order to update existing values of its attributes or add values to attributes that are multivalued. I have a controller in angular that receives a document class name and id and pulls a specific document of that class. The controller reads the document and saves data like number of attributes, attribute type, if the attribute is multivalued or not and the values. Each class is different in number of attributes, attribute types. Here is an example of the data generated by my controller for a specific document of a specific class: CLASS/id {cid: "Disease/54d49a8c3b70f6cce63dc475"} N° ATTRIBUTES:3(without counting multivalues of the same attribute) ///////////////////////////////////////////////////////////////////////////////////////////// ATTRIBUTE NAME:displayName ///////////////////////////////////////////////////////////////////////////////////////////// ATTRIBUTE DATA TYPE:text MULTI VALUE ATTRIBUTE:0(not multivalue field) ATTRIBUTE N° OF VALUES:1(existing n° of values at the moment) ATRIBUTE ARRAY POSITION:0 ---&gt; value displayName #1 ///////////////////////////////////////////////////////////////////////////////////////////// ATTRIBUTE NAME:identifier ///////////////////////////////////////////////////////////////////////////////////////////// ATTRIBUTE DATA TYPE:text MULTI VALUE ATTRIBUTE:1(multivalue field) ATTRIBUTE N° OF VALUES:1(existing n° of values at the moment) ATRIBUTE ARRAY POSITION:0 ---&gt; value identifier #1 ///////////////////////////////////////////////////////////////////////////////////////////// ATTRIBUTE NAME:r ///////////////////////////////////////////////////////////////////////////////////////////// ATTRIBUTE DATA TYPE:date MULTI VALUE ATTRIBUTE:1(multivalue field) ATTRIBUTE N° OF VALUES:3(existing n° of values at the moment) ATRIBUTE ARRAY POSITIONS:0 ---&gt; value r #1 ATRIBUTE ARRAY POSITIONS:1 ---&gt; value r #2 ATRIBUTE ARRAY POSITIONS:2 ---&gt; value r #3 …
accepted answer: http://stackoverflow.com/a/29822579
tagged with: angularjs-scope
score: 3
downvote count: 0
answer count: 1
tagged with: angularjs-ng-repeat
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
upvote count: 3
has title: AngularJS : dynamic form generation
type: Question
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/29822579
tagged with: javascript

http://stackoverflow.com/comment/47800532
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29836210
has text: So you want to navigate full screen sections of a web page by using swipe or something similar? And for that swiping to not trigger links that may be on that page. That's a job for touch events, they can be separated from clicks. Doable but not with a simple trick, only some solid coding. Here's the closest and least complicated example I have at hand : http://codepen.io/Shikkediel/pen/RNRGaa?editors=001.
score: 0

http://stackoverflow.com/q/29815425
tagged with: drag-and-drop
type: UnansweredQuestion
tagged with: gridpanel
type: Question
has answer: http://stackoverflow.com/a/29815825
has title: extjs 5, deine dropzone on gridpanel, but cannot drop, why?
answer count: 1
tagged with: javascript
has body: I want to drag a pic and drop to gridpanel. I definde a gridpanel and code is below, viewConfig: { listeners: { render: 'onPlaylistgridviewRender' } }, onPlaylistgridviewRender: function(component, eOpts) { var gridView = component, grid = gridView.up('playlistgridpanel'); grid.dropZone = Ext.create('Ext.dd.DropZone', component.el, { notifyDrop: function(source, e, data){ return true; } }); } I drag a pic , when mouse is over the grid, this icon shows dropping is forbidden. what's wrong here? Thanks.
tagged with: extjs
score: 0

http://stackoverflow.com/q/29813403
score: 2
type: AnsweredQuestion
has title: Update undefined in sailsjs model afterCreate hook
upvote count: 2
tagged with: orm
type: Question
tagged with: sails.js
has comment: http://stackoverflow.com/comment/47780930
tagged with: waterline
has comment: http://stackoverflow.com/comment/47756095
downvote count: 0
answer count: 1
tagged with: javascript
has body: In my sailsjs app, I'm trying to add a default avatar for my user after the user is created so I have this afterCreate hook in models/User.js: var User = { // ... attributes: { avatar: { model: 'Image' }, // ... }, afterCreate: function(user, next){ var url = sails.config.s3 + "/" + sails.config.default_avatar; sails.log.info(user); // This displays the proper user var data = { url: url, isAvatar: true, user: user.id }; Image.create(data) .exec( function (err, image) { sails.log.info(image); // This displays the proper image User.update(image.user, { avatar: image.id}) .exec( sails.log.info ); }); next(); }, } I keep getting the error: /Users/rcanty/Workspace/project/server/api/models/User.js:55 return User.update(image.user, { avatar: image.id}).exec( sails.log.info ^ TypeError: undefined is not a function at /Users/rcanty/Workspace/project/server/api/models/User.js:55:19 at bound (/usr/local/lib/node_modules/sails/node_modules/lodash/dist/lodash.js:957:21) at applyInOriginalCtx (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/normalize.js:416:80) at wrappedCallback (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/normalize.js:315:18) at callback.success (/usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/switchback/lib/normalize.js:33:31) at _switch (/usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/switchback/lib/factory.js:48:28) at /usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/query/dql/create.js:241:9 at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:157:25 at bound.&lt;anonymous&gt; (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/schema.js:151:44) at fn (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/callbacksRunner.js:60:10) at iterate (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:149:13) at Object.async.eachSeries (/usr/local/lib/node_modu…
favorite count: 0
has answer: http://stackoverflow.com/a/29814401
accepted answer: http://stackoverflow.com/a/29814401
tagged with: node.js

http://stackoverflow.com/comment/47689880
score: 1
has text: you are pushing an object that has repeating keys `name` and `value` into `info`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29779800

asp.net-web-api
tags question: http://stackoverflow.com/q/29691881
tags question: http://stackoverflow.com/q/29819781
tag name: asp.net-web-api
type: Tag
tags question: http://stackoverflow.com/q/29830235
tags question: http://stackoverflow.com/q/29820205
tags question: http://stackoverflow.com/q/29759598
tags question: http://stackoverflow.com/q/29748684

http://stackoverflow.com/q/29800640
linked to: http://stackoverflow.com/q/2674392
tagged with: google-maps-api-3
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/29803182
has title: Google Maps API: Move map center to a position on my page?
accepted answer: http://stackoverflow.com/a/29803182
downvote count: 0
has body: maybe there is a solution for this: I'm using the Gmap api to embed a map undernaeth an overlay that I have on top of my map. The overlay has a little arrow on the right side and I want my map marker to be positioned at this point (or a few pixels beside it) I know it would be possible to use a GMaps Infowindow, but I have it this way. So I'm able to use $("#arrow").offset() in order to get its position on the page, but I don't know how to move or pan the map center to this pixel-destination. window.onload = function() { var myOptions = { center: new google.maps.LatLng(47.259998, 11.398032), zoom: 17, mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI: true }; var map = new google.maps.Map(document.getElementById("map"), myOptions); var marker = new google.maps.Marker({ position: new google.maps.LatLng(47.260071, 11.404705), map: map, }); console.log( $("#arrow").offset().top ); } Update: This is the code I have in my page-template right now. I have on last problem though. If my page has a width of lets say 1440px the position of the marker relative to my little arrow works just fine: https://goo.gl/u489nd However as soon as I resize the page to a smaller width and load the page again the marker is behind the overlay and not positioned relative to the little arrow. https://goo.gl/k4rPYv google.maps.event.addDomListener(window, 'load', initMap); window.onresize = function() { positionMap(); } function initMap() { var myOptions = { center: new google.maps.LatLng(47.260071, 11.404705), zoom: 17, mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI: true, draggable: false, mapTypeControl: false, zoomControl: false, scaleControl: false, scrollwheel: false }; var map = new google.maps.Map(document.getElementById("map"), myOptions); var marker = new google.maps.Marker({ position: new google.maps.LatLng(47.260071, 11.404705), map: map, title: 'Österreichisches Rotes Kreuz Innsbruck' }); } function positionMap() { var arrowPos = $("#map-center").position(); con…
type: AnsweredQuestion
score: 1
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/47732009
tagged with: javascript

http://stackoverflow.com/q/29740089
has body: With below code i got all uploaded images with DropZone,but i now i have a simple problem, it already showing Original images as thumbnail but i need to show thumbnail with base64 same as dropzone made when want to upload new image. dropzone.js init: function() { var thisDropzone = this; var pageid = $("#pageid").val(); $.getJSON('plugin/dropzone/get_item_images.php?id='+pageid, function(data) { $.each(data, function(key,value){ var mockFile = { name: value.name, size: value.size }; thisDropzone.options.addedfile.call(thisDropzone, mockFile); thisDropzone.options.thumbnail.call(thisDropzone, mockFile, "/admin/uploads/"+value.name); thisDropzone.emit("complete", mockFile); }); }); }, So the problem is with this code i able to show uploaded images with dropzone but it show thumbnail with original images not real thumbnail that created with base64. dropzone made thumbnail with base64 when you want to upload new image, i want to show thumbnail like this.
tagged with: php
linked to: http://stackoverflow.com/q/28412229
type: AnsweredQuestion
downvote count: 2
has title: How to create thumbnail for uploaded images on DropZone.js?
has answer: http://stackoverflow.com/a/29830131
type: Question
upvote count: 12
tagged with: http://stackoverflow.com/tag/json
score: 10
tagged with: javascript
answer count: 1
accepted answer: http://stackoverflow.com/a/29830131
tagged with: jquery
favorite count: 0
tagged with: dropzone.js

http://stackoverflow.com/a/29871982
answers question: http://stackoverflow.com/q/29757899
type: Answer
has body: In your css add this code inside img img { opacity: 0.4; filter: alpha(opacity=40); /* For IE8 and earlier */ } change the values depending on the opacity you desire
score: 0

http://stackoverflow.com/comment/47675415
comment on: http://stackoverflow.com/a/29771609
has text: Since you did not post the content of the Default.asp - link1 is the ID *I* gave the link. If there is no ID, change it to `.....getElementsByTagName("a")[2]` or whatever points at the actual link you are trying to access
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47611289
type: Comment
type: QuestionComment
has text: Can you fiddle the problem?
score: 0
comment on: http://stackoverflow.com/q/29738930

http://stackoverflow.com/comment/105609324
type: Comment
comment on: http://stackoverflow.com/a/29775356
type: AnswerComment
score: 0
has text: any idea how we write karma unit testing for addName()(testName) this.?

http://stackoverflow.com/comment/47778033
comment on: http://stackoverflow.com/q/29825571
type: QuestionComment
type: Comment
score: 1
has text: You may want to go to a chat room for a discussion, you'll find a better answer because this question doesn't involves any code error. http://chat.stackoverflow.com/

http://stackoverflow.com/q/29842798
tagged with: javascript
tagged with: jquery
tagged with: ruby-on-rails-4
has body: I tried searching but didn't get the right question/answer. I would like to construct/organize a zip in a path the user predefines. How is it possible to open a prompt dialog in JS and pick the path of the directory selected by the user. I use ruby on rails, jquery/javacript.
downvote count: 0
has comment: http://stackoverflow.com/comment/47822588
favorite count: 0
tagged with: ruby
has comment: http://stackoverflow.com/comment/47815025
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47811909
tagged with: ruby-on-rails
score: 2
answer count: 0
has comment: http://stackoverflow.com/comment/47818430
has title: How to ask a user to define a path to download in Javascript
type: Question

http://stackoverflow.com/q/29814371
answer count: 1
has comment: http://stackoverflow.com/comment/47756459
has comment: http://stackoverflow.com/comment/47757574
has comment: http://stackoverflow.com/comment/47756282
has comment: http://stackoverflow.com/comment/47756265
has title: How does a JavaScript interpreter handle null?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47756219
has comment: http://stackoverflow.com/comment/47756248
has comment: http://stackoverflow.com/comment/47758412
type: Question
linked to: http://stackoverflow.com/q/801032
has answer: http://stackoverflow.com/a/29815008
tagged with: null
has body: I've been wondering about the use of the keyword null in the JS language. In cases like C/C++, NULL is stood to mean something like a null pointer, i.e. a pointer to 0 (though there are macro definitions, etc, which can change this), but how is JS specified to handle the keyword? Is there some specification that says how it should be processed?
tagged with: javascript
linked to: http://stackoverflow.com/q/5515310
has comment: http://stackoverflow.com/comment/47757609
has comment: http://stackoverflow.com/comment/47757093
score: 0

http://stackoverflow.com/q/29839392
tagged with: javascript
score: -1
answer count: 3
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29908578
has title: Jira/Javascript if statement
type: UnansweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/29839464
has answer: http://stackoverflow.com/a/29839491
tagged with: jira
type: Question
has body: brand new to javascript and im trying to do an if statement with the condition : if (issue.issueTypeObject.name == "Specials") If it equals specials then do this: &lt;!-- @@Formula: if (issue.get("resolutiondate") == null || issue.get("customfield_10007")==null) return null; else if ((issue.get("resolutiondate").getTime() - issue.get("customfield_10007").getTime()) / (1000*60*60*24) &lt;1) return 0; else return (issue.get("resolutiondate").getTime() - issue.get("customfield_10007").getTime()) / (1000*60*60*24); --&gt; else do this &lt;!-- @@Formula: if (issue.get("resolutiondate") == null || issue.get("customfield_10002")==null) return null; else if ((issue.get("resolutiondate").getTime() - issue.get("customfield_10002").getTime()) / (1000*60*60*24) &lt;1) return 0; Else return (issue.get("resolutiondate").getTime() - issue.get("customfield_10002").getTime()) / (1000*60*60*24) --&gt; and i just cant seem to get it right
has comment: http://stackoverflow.com/comment/47894815

http://stackoverflow.com/a/29791564
answers question: http://stackoverflow.com/q/29791376
accepted answer of: http://stackoverflow.com/q/29791376
has comment: http://stackoverflow.com/comment/47712200
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/47712335
has comment: http://stackoverflow.com/comment/47712133
type: AcceptedAnswer
has body: To choose a random video, simply place all possible languages into an array and choose one at random: var languages = ['FR', 'NL']; var playing = 'FR'; function video_idle() { $('#mediaplayer').attr('src',playing + '.mp4' ).show(); mediaplay_video= document.getElementById('mediaplayer'); mediaplay_video.play(); mediaplay_video.onended = function(e) { console.log('&gt;&gt;&gt; Playing finished: ', e); playing = languages[Math.floor(languages.length * Math.rand())]; video_idle(); }; } languages.length * Math.rand() gives you a random float between 0 and the length of your array, then Math.floor() rounds it down, so that you get a random integer from 0 to length-1, which are your array-keys.

http://stackoverflow.com/q/29726253
favorite count: 0
has body: I started learn JavaScript and in some tutorials I saw that was used document.getElementById() and in some tutorials in same case was used "this" that was passed from control that fired the event. Maybe someone can explain why should I prefer one way over an other? Thank's a lot
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29726317
has answer: http://stackoverflow.com/a/29726278
downvote count: 0
score: 1
has title: Why not passing "this" instead of using document.getElementById() in JavaScript
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47586556
tagged with: javascript
upvote count: 1

http://stackoverflow.com/q/29791020
has comment: http://stackoverflow.com/comment/47710940
accepted answer: http://stackoverflow.com/a/29791069
tagged with: angularjs-ng-repeat
has comment: http://stackoverflow.com/comment/47710884
has body: Below is my JSON object which I would like to display the name in both the parent and child array. $scope.result= [ { "id": 1, "name": "1002", "parentArray": [ { "id": 28, "name": "PRODP1", "shortCode": "PRODP1" } ] } I want to display Name:1002 Parent_Name:PRODP1 I tried {{item.name}} which will only display 1002.But I need to display the name of parentArray as well.
has comment: http://stackoverflow.com/comment/47711162
possible better answer: http://stackoverflow.com/a/29791066
tagged with: angularjs
has answer: http://stackoverflow.com/a/29791066
upvote count: 2
type: AnsweredQuestion
has title: Display an Array inside Object using ng-repeat -AngularJs
has answer: http://stackoverflow.com/a/29791069
type: Question
answer count: 2
score: 2
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/29709745
accepted answer of: http://stackoverflow.com/q/29709411
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29709411
has comment: http://stackoverflow.com/comment/47638097
type: Answer
has comment: http://stackoverflow.com/comment/47555464
score: 1
has comment: http://stackoverflow.com/comment/47638220
upvote count: 1
has body: It is a resetting issue. Use the below CSS to set all margin and padding to 0. * {margin:0; padding:0;} Here is a jsfiddle Update: To keep only the top and bottom "borders" just set your padding only for top and bottom. .accordion { padding: 10px 0; } Here is a jsfiddle

http://stackoverflow.com/comment/47873754
comment on: http://stackoverflow.com/a/29689761
has text: you should still use r71 anyways... theres a big difference between the two
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47795063
score: 0
type: QuestionComment
has text: [animate docs](http://api.jquery.com/animate/), animate takes an optional complete callback that gets called once animation is done
type: Comment
comment on: http://stackoverflow.com/q/29834190

http://stackoverflow.com/comment/47739479
type: AnswerComment
comment on: http://stackoverflow.com/a/29805508
score: 0
type: Comment
has text: alright, never mind. When I set the line above the line, everything just worked fine.

http://stackoverflow.com/q/29719341
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29720884
tagged with: browser
answer count: 2
downvote count: 0
tagged with: web
favorite count: 0
has body: i would like to execute a loop in chrome console ,but i want to stop it when it is running (without closing web browser).So how to do that . Thanks much for any helps . This is my script ,i want to stop this: for(var i=0;i&lt;20;i++) { (function (i) { setTimeout(function () { { scrollBy(1500, 999999); } }, 8000 * i); }(i)); }; setTimeout(function () { alert('Finish--------------!'); }, 8000 * (i));
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29720884
possible better answer: http://stackoverflow.com/a/29720650
score: 1
has answer: http://stackoverflow.com/a/29720650
has comment: http://stackoverflow.com/comment/47575681
has comment: http://stackoverflow.com/comment/47575608
upvote count: 1
type: Question
has title: Stop command is excuting from web browser console

http://stackoverflow.com/comment/47685159
comment on: http://stackoverflow.com/a/29775420
type: AnswerComment
has text: you call the policies based on the restriction of the end point. So if UserController.create is limited to those with level 4 for example, then in the above example you will put ['policy04.js'] on the create action and then have policy04.js check to make sure that they are indeed at level 4.
type: Comment
score: 0

http://stackoverflow.com/a/29829796
type: Answer
has body: It's best practice to use the class attribute when it's not unique. Using pure javascript, you could then get all of the elements with a certain class and hide them: var langElems = document.getElementsByClassName('lang-fr'), i; for (var i = 0; i < langElems.length; i ++) { langElems[i].style.display = 'none'; } Le plus grand faible des hommes, c'est l'amour qu'ils ont de la vie. Hello world Le plus grand faible des hommes, c'est l'amour qu'ils ont de la vie. And, here is a way to toggle showing and hiding the elements using a select option: // get all elements with the class 'lang; var langElems = document.getElementsByClassName('lang'); function updateLang() { // selection value var selectedLang = document.getElementById("select-lang").value; // loop through the langauge elements for (var i = 0; i < langElems.length; i++) { // show those that have the selected val as a class if (hasClass(langElems[i], selectedLang)) { langElems[i].style.display = 'block'; } else { // hide those that do not langElems[i].style.display = 'none'; } } } // helper to check if an element contains a class function hasClass(element, cls) { return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1; } English French Le plus grand faible des hommes, c'est l'amour qu'ils ont de la vie. Hello world Le plus grand faible des hommes, c'est l'amour qu'ils ont de la vie. HTH
answers question: http://stackoverflow.com/q/29829451
score: 0

http://stackoverflow.com/comment/47710693
has text: thanks all for reply, i was found the solution, just add respond to success function and it's works, thanks a lot..
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29743459
type: QuestionComment

http://stackoverflow.com/comment/47652563
has text: Also, you need to wrap the JS from Bootply in jQuery $(document).ready(function(){ .. js code here.. }(); so that is binds properly after the DOM is loaded.. Otherwise the click handler won't work.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29758283

http://stackoverflow.com/a/29759390
has comment: http://stackoverflow.com/comment/47651346
answers question: http://stackoverflow.com/q/29759236
score: 1
has comment: http://stackoverflow.com/comment/47651627
has comment: http://stackoverflow.com/comment/47651885
has comment: http://stackoverflow.com/comment/47651462
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47652718
accepted answer of: http://stackoverflow.com/q/29759236
has body: Using jQuery you can use the .on() event listener to detect the click of the 'expand' button and then use .slideToggle() to handle the share button reveal/hiding. $('.expandBtn').on( "click", function() { $('.shareItems').slideToggle( "slow", function() { // Animation complete. }); }); Facebook Twitter Expand See this fiddle.
type: Answer
upvote count: 1

http://stackoverflow.com/q/29722599
has body: I have a dropdown button and an input field. If you click on the button it shows a list of Names (that are written in JSON). I want to add the following things but I am not sure how to do it: When choosing a name I want it to appear in the input field. When writing in the input field I want the list to appear (with result that correspond to that letter). I would prefer to do as much as possible with angular but of course i regular javascript or JQuery is required that's fine too. Let me know if you have questions. Name {{x.name }}
tagged with: angularjs
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47579844
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29723092
type: Question
has comment: http://stackoverflow.com/comment/47579799
tagged with: javascript
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/47579751
tagged with: jquery
favorite count: 0
has title: Dropdown menu and input field work together using Angular
has answer: http://stackoverflow.com/a/29723317

http://stackoverflow.com/comment/48281628
score: 0
comment on: http://stackoverflow.com/a/30064651
type: Comment
has text: Well, I have tested it out, and yes the problem does seem to be fixed now (at least from a little quick testing on my end). However, because of the this problem (and some other buggy behavior that may have been related to my own JavaScript interfering with the Google libraries) I have rewritten my site to use a purely back-end implementation of oauth2 (as described here: https://developers.google.com/identity/protocols/OpenIDConnect). Which in the end I think will be a better solution for my users.
type: AnswerComment

http://stackoverflow.com/comment/47677194
has text: Thanks @AmmarCSE that did it! Any idea how to remove the old data and load the new one as the items are clicked through so that only one set of menu items appear? Thanks!
type: AnswerComment
comment on: http://stackoverflow.com/a/29773149
score: 0
type: Comment

http://stackoverflow.com/a/29765380
has body: Try this one $(document).ready(function(){ setInterval(function(){ //code goes here that will be run every 5 seconds. $.ajax({ type: "POST", url: "php_file.php", success: function(result) { //alert(result); } }); }, 5000); });
score: 0
answers question: http://stackoverflow.com/q/29764767
type: Answer

http://stackoverflow.com/a/29760085
type: Answer
answers question: http://stackoverflow.com/q/29759812
has body: Ok, I think I found something to work, actually it does work, but I still feel it's overly complicated. Here is what the code looks like. the only way to predict the future, is to create it... About Me Contact 1 2
score: 0

http://stackoverflow.com/comment/47780013
type: Comment
has text: even with the updated manifest I get the same error: Refused to load the image 'http://images.instagram.com/transparent.gif' because it violates the following Content Security Policy directive: "img-src https: data:".
comment on: http://stackoverflow.com/a/29821152
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47539156
type: Comment
type: QuestionComment
has text: So to get the width, you'd want to do it with javascript. But you need to figure out when you want to get it/what events fetch it, and does it change on resize events? then you'd apply it with javascript as well (or jquery). You can do something like document.getElementById("mydiv").offsetWidth to find the width in JS
comment on: http://stackoverflow.com/q/29701125
score: 0

http://stackoverflow.com/a/29827267
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/29809593
downvote count: 0
type: Answer
has body: Found the solution. http://www.magpcss.org/ceforum/viewtopic.php?f=6&amp;t=12909 Quoting the member answer : OnWebKitInitialized and other CefRenderProcessHandler methods are called in the renderer process. You need to implement "CefApp::GetRenderProcessHandler()" and pass the CefApp instance to CefExecuteProcess().

http://stackoverflow.com/a/29737601
type: Answer
has comment: http://stackoverflow.com/comment/47608597
score: 1
upvote count: 1
has body: You should put the below code inside the success callback. (Ajax works asynchronous.) if (fahrenheit &gt; 55) { $(".scarf").html('&lt;img src="img/scarf.svg"&gt;&lt;/img&gt;'); } else { $(".scarf").html(""); };
accepted answer of: http://stackoverflow.com/q/29737563
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29737563

http://stackoverflow.com/comment/47682922
type: QuestionComment
has text: this is just allowing other key as well.
type: Comment
comment on: http://stackoverflow.com/q/29775955
score: 0

http://stackoverflow.com/q/29715612
tagged with: internet-explorer-11
has title: ModalWindow with out address bar and title string
has comment: http://stackoverflow.com/comment/47566275
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29716163
has body: I have tried to create a new modal window.But it shows an address bar and title is shown as about:blank.The code is shown @ http://jsfiddle.net/visibleinvisibly/vhudmz5u/ The content I guess in IE11 we cant hide the addressbar.Please let me know if you have any idea as to how to set the title for the modal popup.. Thanks in advance Alex
downvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47608616
upvote count: 2
type: UnansweredQuestion
score: 2

http://stackoverflow.com/comment/47574024
type: Comment
has text: @adeneo - Sorry, was not targeted to your solution. :P
comment on: http://stackoverflow.com/a/29719665
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47731340
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29801573
has text: I've just checked it by inspecting the element and it's still the same unfortunately.
type: Comment

http://stackoverflow.com/comment/47578353
type: Comment
comment on: http://stackoverflow.com/a/29721646
score: 0
type: AnswerComment
has text: Why does `Promise.map` fail to guarantee execution order?

http://stackoverflow.com/a/29743221
has comment: http://stackoverflow.com/comment/47619434
answers question: http://stackoverflow.com/q/29743191
type: Answer
has comment: http://stackoverflow.com/comment/47619556
has body: Add word-break:break-all; to the div map-data-box, so that the text will break down to fit in the div.
has comment: http://stackoverflow.com/comment/47620616
has comment: http://stackoverflow.com/comment/47619465
has comment: http://stackoverflow.com/comment/47620656
has comment: http://stackoverflow.com/comment/47619503
score: 0
has comment: http://stackoverflow.com/comment/47619416

http://stackoverflow.com/comment/104829845
score: 0
comment on: http://stackoverflow.com/q/29800010
has text: For anyone from the future, this page shows API-by-API browser compatibility: https://webrtc-stats.callstats.io/verify
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47584709
type: AnswerComment
type: Comment
has text: Additionally, no href was created for `{{> ionTab}}` :( Note that I did not define `waitOn` and `data` in the route definition. Maybe passing the actual url into `path` parameter of `ionTab` template doesnt work...
comment on: http://stackoverflow.com/a/29724705
score: 0

http://stackoverflow.com/comment/47789117
type: Comment
has text: @Sonia let us know if any of the answers solved the problem. If not, please provide more details. thanks.
type: QuestionComment
comment on: http://stackoverflow.com/q/29810431
score: 0

http://stackoverflow.com/q/29829205
possible better answer: http://stackoverflow.com/a/29829370
has answer: http://stackoverflow.com/a/29829370
has answer: http://stackoverflow.com/a/62199639
downvote count: 0
favorite count: 0
answer count: 9
has answer: http://stackoverflow.com/a/58748962
has answer: http://stackoverflow.com/a/57464108
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29829414
has answer: http://stackoverflow.com/a/29829361
upvote count: 121
linked to: http://stackoverflow.com/q/19101573
has title: Sort an array so that null values always come last
has answer: http://stackoverflow.com/a/78041243
has body: I need to sort an array of strings, but I need it so that null is always last. For example, the array: var arr = [a, b, null, d, null] When sorted ascending I need it to be sorted like [a, b, d, null, null] and when sorted descending I need it to be sorted like [d, b, a, null, null]. Is this possible? I tried the solution found below but it's not quite what I need. How can one compare string and numeric values (respecting negative values, with null always last)?
type: Question
accepted answer: http://stackoverflow.com/a/29829361
score: 121
tagged with: javascript
has answer: http://stackoverflow.com/a/77741034
has comment: http://stackoverflow.com/comment/47784761
has answer: http://stackoverflow.com/a/43247385
linked to: http://stackoverflow.com/q/8537602

http://stackoverflow.com/comment/47626170
has text: P.S. You should check your console for errors, it would have told you that there was no method `click`
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29747002

http://stackoverflow.com/comment/47661490
has text: "substr" does not return an array, does it? So why are you returning "cookie[0]" instead of just "cookie" ?
comment on: http://stackoverflow.com/q/29757662
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29807044
has answer: http://stackoverflow.com/a/33603077
tagged with: webpack
tagged with: koa
has comment: http://stackoverflow.com/comment/47742056
tagged with: javascript
type: UnansweredQuestion
has title: WebPack io.js generators support
has comment: http://stackoverflow.com/comment/47756994
score: 3
downvote count: 0
has body: I would like use the WebPack to compile server-side scripts which contain the Harmony (ES6) generators. I would like to keep them and not use any kind of polyfills or transpilers. But the WebPack complains about a missing loader. Does WebPack support to compile a straight forward generator please? Stack: io.js webpack koa framework
has comment: http://stackoverflow.com/comment/47743223
favorite count: 0
type: Question
tagged with: io.js
has comment: http://stackoverflow.com/comment/47754372
has comment: http://stackoverflow.com/comment/54981232
has comment: http://stackoverflow.com/comment/47756734
upvote count: 3
has comment: http://stackoverflow.com/comment/54980582
answer count: 1
has comment: http://stackoverflow.com/comment/47754383
tagged with: ecmascript-6
has comment: http://stackoverflow.com/comment/47761223

http://stackoverflow.com/comment/47762198
has text: Best framework is opinion based from user to user
score: 1
comment on: http://stackoverflow.com/q/29817614
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29773947
tagged with: javascript
tagged with: date
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/29775049
favorite count: 0
has title: AngularJS form custom validation (future date)
tagged with: angularjs
upvote count: 2
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29775049
has body: I am trying to add validation to my AngularJS app and I want to test if a specific date is in the future. What is the best practice to do so if I have 2 selects for this? For example: {{currentYear+n}} {{n+1}} I want to add a custom rule to validate the date if it is in the future and not in the past.
type: Question

http://stackoverflow.com/comment/47738010
comment on: http://stackoverflow.com/a/29799526
type: Comment
has text: Why the blinking fade transition? The galleries are broken and unoperable. You cannot click on a user action element and let the code mess the count. If one clicks *LEFT* the gallery should go left, not left and than immediately right.... Messy and not user-friendly
score: 0
type: AnswerComment

http://stackoverflow.com/q/29708181
answer count: 1
tagged with: javascript
has title: Plain Javascript plugin return error in console
linked to: http://stackoverflow.com/q/1369004
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I'm pretty new to javascript so i need some help. I'm trying to make a simple plugin (only for learn of course, to understand things better ), but i got in some troubles and some help will be appreciated. My plugin is basic, I'm trying to animate some content on scroll , so here is my code: JS: (function() { //============================= //=======CONSTRUCTOR=========== //============================= this.hAnimate = function() { this.hanimate = null; this.el = null; //default options var defaults = { class : 'hanimate' } // Create options and extend defaults if (arguments[0] && typeof arguments[0] === "object") { this.options = extendDefaults(defaults, arguments[0]); } } //============================== //===========FUNCTIONS========== //============================== hAnimate.prototype.init = function() { window.addEventListener('scroll' , function(){ this.el = document.querySelector(this.options.class); var distanceY = window.pageYOffset || document.documentElement.srollTop, scrollDelay = this.el.getAttribute('data-scroll'); if ( distanceY > scrollDelay ){ this.el.classList.add('scrolled'); } else{ if(this.el.classList.contains('scrolled')){ this.el.classList.remove('scrolled') } } }); } function extendDefaults(source, properties) { var property; for (property in properties) { if (properties.hasOwnProperty(property)) { source[property] = properties[property]; } } return source; } }()); HTML: This is my header and CSS: .wrapper{ width:80%; margin:0 auto; min-height:5000px} .hanimate{ position:fixed; top:0; left:0; width:100%; height:5em; display:flex; align-items:center; justify-content:center; background:#f2f2f2; } [data-effect='bg-red']{ transition:background .7s; } .scrolled[data-effect='bg-red']{ background:red; } so when I'm trying to run it trows me an error in console ReferenceError: options is not defined this.el = document.querySelector(this.options.class); demo here UPDATE So i did some research but simply I just can't figure it, I am a beginner , I kno…
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29708910
type: Question
has comment: http://stackoverflow.com/comment/47552147
has comment: http://stackoverflow.com/comment/47552238
has comment: http://stackoverflow.com/comment/47552451
has comment: http://stackoverflow.com/comment/47552898
score: 0

http://stackoverflow.com/comment/47673371
type: AnswerComment
has text: oh any suggestion for it?
comment on: http://stackoverflow.com/a/29771409
type: Comment
score: 0

http://stackoverflow.com/a/29725214
has body: It looks to me like you want to get the first and last values and keep them separated by a whitespace character. Here's the easiest way I can think to do that: var arr1 = ["avd befe, bla, bla, bla, bla", "cveve devev, bla, bla, bla, bla", "aava beve. cavbr, bla, bla, bla, bla", "feve gyhyh, bla, bla, bla, bla", "ibtbt, bla, bla, bla, bla"] function clean(str) { var foo = str.split(",")[0]; var bar = foo.substr(0, foo.indexOf(" ")) + foo.substr(foo.lastIndexOf(" ")); return str.replace(foo, bar); } for (var i = 0; i &lt; arr1.length; i++) { arr1[i] = clean(arr1[i]); }
has comment: http://stackoverflow.com/comment/47584718
has comment: http://stackoverflow.com/comment/47584760
answers question: http://stackoverflow.com/q/29725011
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47584664
has comment: http://stackoverflow.com/comment/47584878

http://stackoverflow.com/comment/47780078
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29824399
type: AnswerComment
has text: Extend your question and show me where are you passing index to the select

http://stackoverflow.com/q/29721562
accepted answer: http://stackoverflow.com/a/29724467
possible better answer: http://stackoverflow.com/a/46170849
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/46170849
favorite count: 0
has comment: http://stackoverflow.com/comment/47581566
has body: I'm trying to add an image paste function to my web application, using the standard routine: $('textarea').on('paste', function (ev) { var clipboardData = ev.originalEvent.clipboardData; $.each(clipboardData.items, function (i, item) { if (item.type.indexOf("image") !== -1) { var reader = new FileReader(); reader.readAsDataURL(item.getAsFile()); reader.addEventListener('loadend', ...); ... } }); }); The full sample can be found here: http://jsfiddle.net/t8t2zj6k/ It works correctly when I copy &amp; paste an image from an image viewer software, but when I'm trying to do the same thing using a file browser (e.g. Finder on Mac or Nautilus on Linux) as a result I get only a text string with the file path or even an image with file type icon instead of an original file. Is there any way to handle pastes from a file browser properly?
type: AnsweredQuestion
upvote count: 9
has title: Pasting from a file browser and HTML5 Clipboard API
tagged with: clipboarddata
has comment: http://stackoverflow.com/comment/47582219
type: Question
score: 9
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47582462
linked to: http://stackoverflow.com/q/6333814
tagged with: javascript
has answer: http://stackoverflow.com/a/29724467
has comment: http://stackoverflow.com/comment/47581805

http://stackoverflow.com/q/29811420
has comment: http://stackoverflow.com/comment/47751209
has title: Javascript document.GetElementById('iframe_id').src = 'link' working only once
tagged with: javascript
has comment: http://stackoverflow.com/comment/47754426
has comment: http://stackoverflow.com/comment/47751161
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: so here's a very simple question but I'm having difficulties on solving it see i have an iframe and i want to change it's src depending on the link that was clicked here's the javascript code function showOverlay(id) { var str1 = 'abstract.php?id='; var link = str1.concat(id); document.getElementById(id).style['display'] = "block"; document.getElementById(id).style['opacity'] = "1"; document.getElementById('abstract_frame').src = link; } function hideOverlay(el, evt) { if (el && evt) { el.style.display = evt.target == el ? 'none' : ''; } document.getElementById('abstract_frame').src = ''; } so I used document.getElementById('abstract_frame').src = link; to set the src then on the hideOverlay function I used document.getElementById('abstract_frame').src = ''; to set the src back to a blank link. so the problem is when I call on the showOverlay again to set another src link to the iframe with a different value i get a blank screen here's the html/php echo ' '; echo " "; echo " "; echo " ". strtoupper($title) ." "; echo " "; echo " "; echo " "; echo "Authors :"; $tags = explode('|',$run['author']); foreach($tags as $i =>$key) { echo 'Dr.'.$key.''; } echo " "; echo " "; echo " "; echo " "; echo " "; echo ($run['abstract'] != "" ? " Abstract|" : "" ); echo " "; echo " Full Article"; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " ".$run['journal'].", ". $run['volume'] .", ". date("F, Y",strtotime($run['publication_date'])) ."@ Pg.". $run['pages'] ." "; echo " "; echo " "; echo " "; echo " "; here's some visuals
has comment: http://stackoverflow.com/comment/47752989
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47753404
tagged with: iframe
tagged with: php
answer count: 0
type: Question

http://stackoverflow.com/q/29832590
has answer: http://stackoverflow.com/a/29832889
score: -3
has comment: http://stackoverflow.com/comment/47791946
has comment: http://stackoverflow.com/comment/47792006
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29832889
downvote count: 3
has title: Animation to move an element does not work
type: Question
has comment: http://stackoverflow.com/comment/47791718
answer count: 2
upvote count: 0
tagged with: javascript
has body: I'm testing a simple animation to move the text Animation Area In this simple code I cant find where I made a mistake. What I get is only a text at a default location but it doesn't move. why?
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29833044
has answer: http://stackoverflow.com/a/29833044
has comment: http://stackoverflow.com/comment/47792103
favorite count: 0
has comment: http://stackoverflow.com/comment/47791790
has comment: http://stackoverflow.com/comment/47792344
has comment: http://stackoverflow.com/comment/47791819
has comment: http://stackoverflow.com/comment/47791821

http://stackoverflow.com/a/29740503
answers question: http://stackoverflow.com/q/29739486
downvote count: 0
score: 6
upvote count: 6
has body: You can't use double quotes inside your double-quoted string without escaping them. The internal server error is caused by Perl trying to tell you that $html = "..."TEXT/JAVASCRIPT"..."i am here"..."; is not valid Perl code. If you check your server's error log, you'll see something like "Bareword found where operator expected at...". The simpler solution is to use a here document: #!C:\wamp\bin\perl\bin\perl.exe use strict; use warnings; my $html = <<"END HTML"; Content-Type: text/html <TITLE>Hello World Hello World Your IP Address is $ENV{REMOTE_ADDR} Have a nice day END HTML print $html;
type: Answer

http://stackoverflow.com/a/29794719
has body: When you are using a jQuery UI widget, you first have to instantiate the widget before calling any functions on it: $(function() { //Instanciate the widget $( ".fromdate" ).datepicker(); //Access to widget's functions alert($( ".fromdate" ).datepicker('getDate')) }); jsFiddle Note: $(function(){ YOUR CODE HERE }); is just a shortcut for $(document).ready(function(){ YOUR CODE HERE });
answers question: http://stackoverflow.com/q/29794536
has comment: http://stackoverflow.com/comment/47726359
upvote count: 1
has comment: http://stackoverflow.com/comment/47725775
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/47526183
comment on: http://stackoverflow.com/q/29694815
score: 0
type: Comment
type: QuestionComment
has text: @rdans That's pedantic...

http://stackoverflow.com/comment/47624780
type: Comment
has text: hmmm, this is strange. did you check, if the port is free? if not, try an other port...
comment on: http://stackoverflow.com/a/29745251
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47788515
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29829597
has text: Removing the @Controller had no effect, I still get an error code of 200

http://stackoverflow.com/q/29708442
has title: Is it possible to catch the change in resolution of streaming video of webRTC?
type: Question
accepted answer: http://stackoverflow.com/a/29712062
has body: we are doing a project on webRTC,and we have some requirement which need us to catch the event when the resolution of streaming video(remote stream) changes in WEB RTC is there any possible way by which we can achieve this?? thanks in Advance for your help
tagged with: webrtc
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47554045
has answer: http://stackoverflow.com/a/29712062
upvote count: 3
tagged with: node.js
has comment: http://stackoverflow.com/comment/47552653
type: AnsweredQuestion
score: 3

http://stackoverflow.com/comment/47630196
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29748069
score: 0
has text: Could you explain what you mean under "hard-coding" the url in the jqGrid definition, and want kind of "your own function" you need? If you would write an example then I would show which jqGrid parameters can be used. Probably you need just use `loadonce: true` option in combination with `postData`.

http://stackoverflow.com/comment/47538581
has text: Thanks, fixed, forgot to wrap in Date.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29700230
type: AnswerComment

http://stackoverflow.com/comment/47603765
comment on: http://stackoverflow.com/a/29735100
score: 0
type: Comment
has text: then, i've got a local page (file:///...) in html, in this page there's an a href that points to a php page on my server, this php file does the facebook login and save the facebook id and the facebook username, then i need to return to my local page (file:///...) passing the FBID and the FBUSERNAME @Snake
type: AnswerComment

http://stackoverflow.com/a/29818619
score: 0
answers question: http://stackoverflow.com/q/29818319
type: Answer
has body: Common problem, you must have loaded your controller on ui-router and also in the HTML file. Just remove it from HTML file, always use router to inject controllers, its just good practice.

http://stackoverflow.com/comment/47776938
has text: @A1rPun yes, twice, but what about difference in milliseconds between one `.html()` and one `.innerHTML`? 1 millisecond or less? I do talk only about this particular question.
comment on: http://stackoverflow.com/q/29824906
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47810078
has text: `eval` [link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) might get you somewhere. On the other hand: stack overflow isn't here to create the code for you, we are here to help you solve errors or specific problems. Please show us what you've tried and we'll see if we can improve it. Also, have a look at [this page](http://stackoverflow.com/help/how-to-ask)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29841884
score: 0

http://stackoverflow.com/comment/47844042
has text: added FireFox Example.
score: 0
comment on: http://stackoverflow.com/a/29830261
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29780435
has comment: http://stackoverflow.com/comment/47691082
type: Answer
downvote count: 0
has body: If u dont want to change data you get from server - you can create selection model separately: &lt;li ng-repeat="(k, m) in tags" ng-class="{'selected':selectedModel[$index]}" ng-click="selectedModel[$index] = !selectedModel[$index]"&gt; http://plnkr.co/edit/QpoAs9XFknKug8mpNkkO?p=preview Ofc, better to use ids not indexes, if u have any.
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29780045
answers question: http://stackoverflow.com/q/29780045

http://stackoverflow.com/comment/47650670
type: AnswerComment
comment on: http://stackoverflow.com/a/29759156
type: Comment
has text: Too bad about the `width: auto`, great answer otherwise. ;-)
score: 0

http://stackoverflow.com/comment/47704678
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29787574
has text: thanks for your response, Tried this one, but still it won't go back to the first slide. Thanks anyway
score: 0

http://stackoverflow.com/a/29756171
has comment: http://stackoverflow.com/comment/47644917
has body: This should do the trick for you... if($('html:contains("Hello World")').length &gt; 0){ alert('Hello World! I exist!'); }else{ alert('Goodbye cruel world!') }
has comment: http://stackoverflow.com/comment/47645244
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29755686
answers question: http://stackoverflow.com/q/29755686
score: 0
type: Answer

http://stackoverflow.com/q/29802567
has comment: http://stackoverflow.com/comment/47765068
type: Question
has body: I am trying to solve a problem where I have the following piece of code: var piggie = new Animal(Animal.PIG); How can a Constructor function (new Animal) also be an Object with properties (Animal.PIG)? I have tried this solution: function Animal(type) { this.typeOf = type; return { PIG: 'Pig' }; } But Animal.PIG is undefined? JS Fiddle is here: http://jsfiddle.net/bufr2b4c/
tagged with: properties
has answer: http://stackoverflow.com/a/29802706
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47733352
has title: Returning properties on a Javascript Constructor function
has answer: http://stackoverflow.com/a/29802914
tagged with: object
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47733309
tagged with: javascript
has comment: http://stackoverflow.com/comment/47763559

http://stackoverflow.com/a/29817728
has comment: http://stackoverflow.com/comment/47782285
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29739838
answers question: http://stackoverflow.com/q/29739838
type: Answer
has comment: http://stackoverflow.com/comment/49117254
has body: The approach you said is easy to implement. I have made a small sample for it. Click the Start Save button to start saving the state of Sunburst. Click Stop Save button after performing a few zooming actions. You can make any further changes to the chart. Now, clicking Load button will show you the saved state of the chart. var width = 500, height = 500, radius = Math.min(width, height) / 2; var x = d3.scale.linear() .range([0, 2 * Math.PI]); var y = d3.scale.sqrt() .range([0, radius]); var color = d3.scale.category10(); var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height) .append("g") .attr("transform", "translate(" + width / 2 + "," + (height / 2 + 10) + ") rotate(-90 0 0)"); var partition = d3.layout.partition() .value(function(d) { return d.size; }); var arc = d3.svg.arc() .startAngle(function(d) { return Math.max(0, Math.min(2 * Math.PI, x(d.x))); }) .endAngle(function(d) { return Math.max(0, Math.min(2 * Math.PI, x(d.x + d.dx))); }) .innerRadius(function(d) { return Math.max(0, y(d.y)); }) .outerRadius(function(d) { return Math.max(0, y(d.y + d.dy)); }); var root = getData(); var savedData = partition.nodes(root); var g = svg.selectAll("g") .data(partition.nodes(root)) .enter().append("g"); var path = g.append("path") .attr("d", arc) .style("fill", function(d) { return color((d.children ? d : d.parent).name); }) .on("click", click); var text = g.append("text") .attr("x", function(d) { return y(d.y); }) .attr("dx", "6") // margin .attr("dy", ".35em") // vertical-align .attr("transform", function(d) { return "rotate(" + computeTextRotation(d) + ")"; }) .text(function(d) { return d.name; }) .style("fill", "white"); function computeTextRotation(d) { var angle = x(d.x + d.dx / 2) - Math.PI / 2; return angle / Math.PI * 180; } var saveData = false; var savedData = []; d3.select("#saveBtn").on("click", function() { if (d3.select(this).attr("value") == "Start Save") { savedData = []; d3.select(this).attr("value", "Stop Save"); saveDa…
has comment: http://stackoverflow.com/comment/47905921

http://stackoverflow.com/q/29792448
has body: I do create a quizz where the questions are created dynamically, so I can't really know how much answsers the javascript is going to generate. Sending the data through Ajax is not the problem, but when it came to the PHP I would like to get the data from the form and I'm used to do it with the $POST['toto']... But I don't know the id (names) of the inputs. I thought 2 solutions, Create one field each time containing the number of answers. Or using a cookie so i could do a loop in the php file... Is there any better solution? Thank you goldiman
has title: Get post data without the name of the input
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/6334830
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29792481
has comment: http://stackoverflow.com/comment/47713591
favorite count: 0
duplicate of: http://stackoverflow.com/q/6334830
upvote count: 2
type: UnansweredQuestion
tagged with: php
score: 2

http://stackoverflow.com/q/29794441
has comment: http://stackoverflow.com/comment/47719315
answer count: 4
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/47719443
possible better answer: http://stackoverflow.com/a/29794752
has answer: http://stackoverflow.com/a/29794752
tagged with: http
has comment: http://stackoverflow.com/comment/47717987
type: Question
score: 3
has answer: http://stackoverflow.com/a/29795419
has answer: http://stackoverflow.com/a/29794812
has body: Looking at the jQuery documentation I found out the following: $.get( "example.php", function() { alert( "success" ); }) .done(function() { alert( "second success" ); &lt;--- }) .fail(function() { alert( "error" ); }) .always(function() { alert( "finished" ); }); I need to execute a method in Angular controller after making few ajax calls, like following: $q.all([ $http.get(ROOT + "Lookup/GetStates"), $http.get(ROOT + "Lookup/GetCountries"), $http.get(ROOT + "Address/GetAddresses"), ]).then(function (results) { $scope.states = jQuery.parseJSON(results[0].data.data); $scope.country = jQuery.parseJSON(results[1].data.data); $scope.addresses = jQuery.parseJSON(results[3].data); }); after the then gets executed (only after the then) I need to call a method $scope.setupControls() Is there a possibility for this?
accepted answer: http://stackoverflow.com/a/29794812
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Is there a second success in angular $q.all() as in jQuery $.get()
tagged with: ajax
has answer: http://stackoverflow.com/a/29795459
tagged with: angularjs

http://stackoverflow.com/comment/47693590
comment on: http://stackoverflow.com/q/29781721
score: 0
type: Comment
type: QuestionComment
has text: "I have tried different things", like what ?

http://stackoverflow.com/comment/48553192
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29723317
type: AnswerComment
has text: That is working on the jsFiddle, I added a minimum of 3 characters to activate the dropdown you can change this to 1 character, try it

http://stackoverflow.com/comment/47689886
comment on: http://stackoverflow.com/q/29779829
type: Comment
score: 0
has text: Use this http://getbootstrap.com/javascript/#carousel BootStrap 3 Carousel will do all of this for you. Implement Bootstrap's Carousel, then create an AJAX call that will load your images and dynamically create the needed HTML in your AJAX callback method upon SUCCESS callback/promise.
type: QuestionComment

http://stackoverflow.com/a/29780764
answers question: http://stackoverflow.com/q/29779134
type: Answer
accepted answer of: http://stackoverflow.com/q/29779134
score: 0
has comment: http://stackoverflow.com/comment/47691949
has comment: http://stackoverflow.com/comment/47691909
upvote count: 1
type: AcceptedAnswer
downvote count: 1
has body: Your ajax request lacks some configuration. You need to tell the request itself which url it should call, and specify the method. Just change those lines: status.innerHTML = 'Verifying...'; //window.location.replace("search.php?search="+str); // this is why your page reloads. you want to remove this var se = new XMLHttpRequest(); se.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); se.onreadystatechange = function(){ if (se.readyState == 4 &amp;&amp; se.status == 200){ status.innerHTML = se.responseText; } } se.open('POST',"search.php?search="+str); // you need to open the request, specifying the method and the url se.send(); here is an interesting read on ajax requests

http://stackoverflow.com/a/51542494
upvote count: 2
answers question: http://stackoverflow.com/q/29777915
downvote count: 0
has body: You could check to see if the selected options are less than 1 when removing an option, if it is add the item back. getValue() returns an array of currently selected values. To the user it just looks like its undeletable or not removable. var userSelectize = $(...).selectize({}); userSelectize[0].selectize.on("item_remove", function(value, item) { if (userSelectize[0].selectize.getValue().length &lt; 1) { this.addItem(value); } });
type: Answer
score: 2

http://stackoverflow.com/comment/132976448
type: Comment
has text: @Beau I'd have thought having like... a `ParallaxContainer` that listens with an `onScroll` and making it delegate state down is better (more contained, 'react' style etc.) than directly interacting with window?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/39884578

http://stackoverflow.com/comment/47726089
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29798702
has text: i also found this solution http://stackoverflow.com/questions/26308525/searching-dates-and-ignoring-time-in-mongodb which also worked is it better than $where condition ? should i use that?
type: AnswerComment

http://stackoverflow.com/q/29766991
has body: I am creating a string of where clause from an array of filters. var where_clause_string = "(((true &amp;&amp; ['SACRAMENTO','CITRUS HEIGHTS'].indexOf(raw_data[i]['city']) &gt; -1) || (false &amp;&amp; [].indexOf(raw_data[i]['city']) === -1)) || false)"; var raw_data_length = raw_data.length , filtered_data = []; for(var i = 0; i &lt; raw_data_length; i++) { if (eval(where_clause_string)) { filtered_data.push(raw_data[i]); } } Then, I am iterating over the data which is an array of objects and returning only that object which passes the truth test. It is giving the expected result, but the performance is screwed. It takes ~2-3 seconds to filter just 1500 rows. If the condition is hardcoded without the use of eval(), the process is very fast. What will be the alternative approach to achieve this?
accepted answer: http://stackoverflow.com/a/29767079
tagged with: eval
has comment: http://stackoverflow.com/comment/47665095
has comment: http://stackoverflow.com/comment/47665121
has comment: http://stackoverflow.com/comment/47665417
has comment: http://stackoverflow.com/comment/47665835
has comment: http://stackoverflow.com/comment/47665884
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47665136
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47665087
type: Question
tagged with: performance
has comment: http://stackoverflow.com/comment/47665094
has answer: http://stackoverflow.com/a/29767725
tagged with: javascript
has comment: http://stackoverflow.com/comment/47665035
has comment: http://stackoverflow.com/comment/47665179
answer count: 2
possible better answer: http://stackoverflow.com/a/29767725
has answer: http://stackoverflow.com/a/29767079
has title: javascript eval() method is degrading the performance while filtering
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/47681686
has text: i added the service, that was my first thought but i'm not able to make it working
score: 0
comment on: http://stackoverflow.com/q/29774838
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29871816
has body: I've only done this once, so I may be wrong, but it looks like you're bundling your app content into the exe? If you do this, node-webkit will extract the app contents into the %TEMP% folder and then run the content from there. Try checking the command line arguments to see if arg[0] will point you to the actual node-webkit exe that's running the app. From there, you should be able to construct a path to your configuration data.
answers question: http://stackoverflow.com/q/29837476
score: 0
type: Answer

http://stackoverflow.com/q/29768561
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29769369
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has title: Rotating a canvas object with keyboard
type: Question
has body: it's my first question. I'm doing an Asteroids game copy and I've started with spaceship movement, but I've got a problem with rotating it in canvas in js. The problem is how to stop rotation after pressing key? It's rotating in two directions, but when I release the key, object returns to its initial state. here is code: window.addEventListener('keydown',doKeyDown,true); window.addEventListener('keyup',doKeyUp,true); //var x = canvas.width/2; //var y = canvas.height/2; var keys = new Array(); function doKeyDown(evt){ keys[evt.keyCode] = true; } function doKeyUp(evt){ keys[evt.keyCode] = false; } var context = document.getElementById('pageCanvas').getContext('2d'); var angle = 0; var angle2 = 0; function convertToRadians(degree) { return degree*(Math.PI/180); } function incrementAngle() { angle -= 10; if(angle &gt; 360) { angle = 0; } } function decrementAngle(){ angle2 += 10; if(angle2&gt;360){ angle2 = 0; } } function drawRandomlyColoredRectangle() { context.save(); context.clearRect(0,0,500,500); fillStyle = "#000000"; context.fillRect(0,0,500,500); incrementAngle(); decrementAngle(); context.translate(200,200); if(37 in keys &amp;&amp; keys[37]){ context.rotate(convertToRadians(angle)); console.log("lewo"); }; if (39 in keys &amp;&amp; keys[39]){ //right //x += dx/5; //rotacja w prawo context.rotate(convertToRadians(angle2)); console.log("prawo"); }; context.fillStyle = "green"; context.fillRect(-25,-25,50,50); context.restore(); } setInterval(drawRandomlyColoredRectangle, 20); and fiddle http://jsfiddle.net/tomasthall/covyjaLb/2/ Help, please :c
tagged with: rotation
has answer: http://stackoverflow.com/a/29769369
tagged with: canvas
tagged with: javascript
score: 0

http://stackoverflow.com/a/29782855
accepted answer of: http://stackoverflow.com/q/29782817
downvote count: 0
has comment: http://stackoverflow.com/comment/47695734
answers question: http://stackoverflow.com/q/29782817
type: Answer
has comment: http://stackoverflow.com/comment/47736151
upvote count: 3
has comment: http://stackoverflow.com/comment/47695629
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47695662
has body: you can try like this: if(yourString.indexOf('A') === 0) { }
score: 3

http://stackoverflow.com/q/29744514
has comment: http://stackoverflow.com/comment/47621630
has body: I have some jquery to toggle a div to reveal some extra search fields on clicking a button. However those fields have an onchange event ("this.form.submit()" ) so every time they are used the div closes. I guess I need to set some sort of cookie that keeps the div open until a reset button is pressed. The current script is &lt;script type="text/javascript"&gt; $(function ($) { var reveal_wrapper = $('.advancedsearch'); $('button.advancedsearchbutton').click(function () { $(this).toggleClass('open'); reveal_wrapper.slideToggle(400); return false; }); }); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/47621616
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29744882
has comment: http://stackoverflow.com/comment/47622019
score: 0
answer count: 2
has title: Toggle div and keep open
has answer: http://stackoverflow.com/a/29744775
has comment: http://stackoverflow.com/comment/47622455
type: UnansweredQuestion

http://stackoverflow.com/q/29815830
has comment: http://stackoverflow.com/comment/47759257
downvote count: 0
accepted answer: http://stackoverflow.com/a/29816383
has comment: http://stackoverflow.com/comment/47759318
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29816537
has comment: http://stackoverflow.com/comment/47758929
tagged with: ajax
possible better answer: http://stackoverflow.com/a/29816537
has title: How to add html to returned json object via php and ajax
favorite count: 0
has body: I was wondering how to add a html link to each JSON item as it is returned. php file //relevant code, $result contains sql query with records from a search $records = array(); while($array = mysqli_fetch_array($result)) { $records[] = $array; } echo(json_encode($records)); Output html via ajax function responseReceived(e){ document.getElementById('response').innerHTML = e.target.responseText; } Response is a div tag. So I was wondering how would I add html link (to another page) to each item within the json. Because at the moment it outputs json but it's not allowing me to add html. This is the current output, which is as expected due to me entering data via a form, I just want to add a small html link next to him. [{"0":"1115","ID":"1115","1":"john","name":"john","2":"male","type":"male","3":"berk","country":"berk","4":"aus","region":"aus","5":"32.43","lon":"32.43","6":"32.54","lat":"32.54","7":"nothing to say","description":"nothing to say"}] Thanks, in advance.
upvote count: 2
tagged with: php
has answer: http://stackoverflow.com/a/29816383
score: 2
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47759455
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47759718

http://stackoverflow.com/comment/47818090
comment on: http://stackoverflow.com/a/29845957
type: Comment
score: 0
type: AnswerComment
has text: If the chart has correctly rendered and you want to call a JAVA function from the page, consider using AJAX as suggested by Korkut. We are really not sure about the problem, try to be more specific.

http://stackoverflow.com/q/29810342
has body: Wait $(document).ready(function() { var secondNormal = 40; var refreshIntervalId; refreshIntervalId = setInterval(function() { secondNormal -= 1; $(".wait").text(secondNormal); }, 1000); setTimeout(function() { clearInterval(refreshIntervalId); $(".waitDownloadLink").text("Click me to download"); }, secondNormal * 1000); }); When I start running the code and stay on the webpage, the code seems too work perfectly (or nearly). However, when I surf on other webpage right after I started the code, the timer is stuck between 12 - 18 second and then stops running. Why does this happen? And is there any solution to solve this? https://jsfiddle.net/s1zf18co/
has answer: http://stackoverflow.com/a/29810614
favorite count: 0
linked to: http://stackoverflow.com/q/5927284
has comment: http://stackoverflow.com/comment/47748714
has title: Why does setInterval() stop too early in this code?
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47748726
has comment: http://stackoverflow.com/comment/47748744
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29810566
has answer: http://stackoverflow.com/a/29810683
has comment: http://stackoverflow.com/comment/47748734
score: 0
linked to: http://stackoverflow.com/q/15871942
possible better answer: http://stackoverflow.com/a/29810548
tagged with: setinterval
has answer: http://stackoverflow.com/a/29810548
accepted answer: http://stackoverflow.com/a/29810683

http://stackoverflow.com/q/29712076
has body: I wanted to use slider panel to show reminders on the right of my div / page. For that I used mb-extruder. It was working fine until I included the bootstrap library. It shows the panel button with some gap. I checked all the properties using developer tools of Chrome. Except there is a width of the panel button (which was defined as 100%), there is no deviation. I am not sure why the width getting reduced when I add bootstrap. There is no sign of explicit css being applied. Here are reference images. without bootstrap with bootstrap
answer count: 1
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has title: jQuery mb-extruder with bootstrap
downvote count: 0
score: 1
tagged with: panel
favorite count: 0
type: Question
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/47559697
tagged with: css
has answer: http://stackoverflow.com/a/29941517
upvote count: 1

http://stackoverflow.com/q/29745371
type: UnansweredQuestion
tagged with: php
answer count: 4
has title: Ajax success message is not working
has answer: http://stackoverflow.com/a/29745423
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29746165
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/29745427
has answer: http://stackoverflow.com/a/29745504
has body: I want to submit form without refreshing page and display success/error message under form, also in case of success reset form. But I guess, I am doing something wrong in ajax code, php works fine. Ajax: $("#usignupform").validate({ submitHandler:function() { var $form = $(form), $messageSuccess = $('#mesSuccess'), $messageError = $('#mesError'); $.ajax({ url: "investor-invite.php", type: "POST", data: $(this).serialize(), complete: function(data) { if (data.status == 'success') { $messageSuccess.removeClass('hidden'); $messageError.addClass('hidden'); // Reset Form $form.reset(); return; } else { $messageError.removeClass('hidden'); $messageSuccess.addClass('hidden'); } } }); return false; } }); PHP: function NewUser(){ $data = mysql_query($query)or die(mysql_error()); if($data){ $response_array['status'] = 'success'; } else { $response_array['status'] = 'error'; } } if(isset($_POST['submit'])){ NewUser(); } HTML: --all fields-- Request Invite Success! Your message has been sent to us. Error! There was an error sending your message.

http://stackoverflow.com/a/29713947
upvote count: 1
has body: Your strategy is not healthy. You should change your scenario to avoid being in need of a variable declared locally, required globally, if you can. But here is the solution: function declareVariables() { window.$config = "MyConfigValue"; // note you can use array, it's better. } declareVariables(); And then you can use: console.log($config);
score: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29713829

http://stackoverflow.com/comment/47549713
comment on: http://stackoverflow.com/a/29706864
score: 0
type: Comment
has text: Yes, that's correct. But if not, the solution is valid.
type: AnswerComment

http://stackoverflow.com/q/29826443
tagged with: javascript
score: 0
answer count: 2
tagged with: state
tagged with: user-interface
has answer: http://stackoverflow.com/a/29826924
tagged with: model
has body: I'm using the following isText property to switch between a dropdown and a text input field in my view (combination of ng-click="family.isText = !family.isText" and ng-show), while iterating through all of the font families. font = { name: null, style: null, families: [{ name: null, parent: null, isText: true // <-- }] }; Here is the template I'm using: — Famille {{ _.capitalize(family) }} — Grande famille {{ _.capitalize(mainFamily) }} I don't want to send this kind of data to my back-end when the user saves the model, as it only has a sense in the view context. On the other hand, I find it not handy to create a familiesState-like property to store them. What would be a good, clean way to store model-related view data in AngularJS?
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47780388
has answer: http://stackoverflow.com/a/29826712
type: Question
has title: Where should I store model-related view data in AngularJS?

http://stackoverflow.com/a/29834332
has comment: http://stackoverflow.com/comment/47800742
answers question: http://stackoverflow.com/q/29829882
has comment: http://stackoverflow.com/comment/47800694
has body: You will have to share the single server-side io variable to your other modules via some combination of export or module method calls. Once you have the socket.io listener initialized like this: var io = require('socket.io').listen(server); You will need to share specific io instance with other modules that want to use socket.io. How exactly you share it depends upon the structure of your code and where you're trying to share it to. For example, you could have a module that just managed the initialization of io: var sockio = require("socket.io"); var io; // mysocketio.js // constructor function - should only be called once and passed the http server module.exports = function(server) { if (!server) { throw new Error("Must pass http server instance to mysocketio module constructor"); } if (!io) { io = sockio.listen(server); } return io; }; module.exports.getIO = function() { if (!io) { throw new Error("Must call constructor of mysocketio module before getIO()"); } return io; }; Then, in the one place you initialize it up with a specific http server, you could do this: var io = require("mysocketio")(server); In the other modules where you just want to use the "already initialized" io, you could do this: var io = require("mysocketio").getIO();
type: Answer
has comment: http://stackoverflow.com/comment/47801062
score: 3
has comment: http://stackoverflow.com/comment/47800539
downvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47801127
accepted answer of: http://stackoverflow.com/q/29829882
upvote count: 3

http://stackoverflow.com/a/29709779
type: Answer
score: 2
upvote count: 2
has body: There is CSS coming from the browser itself. You can reset this for your specific element by adding the following CSS: .accordion dd p{margin:0;} Each browser will have their own set of default CSS rules. This can make it difficult to develop cross browser code that looks the same in all browsers. You can normalize or reset your CSS depending on your preferences. Using one or the other is generally recommended over using nothing. Here is a good discussion on the differences between the two: What is the difference between Normalize.css and Reset CSS?
answers question: http://stackoverflow.com/q/29709411
downvote count: 0

http://stackoverflow.com/comment/47694470
comment on: http://stackoverflow.com/a/29782213
has text: I don't care if your code works. The explanation you give is misleading.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29719278
has comment: http://stackoverflow.com/comment/47573422
answers question: http://stackoverflow.com/q/29718833
score: 15
has comment: http://stackoverflow.com/comment/47573221
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47573188
has comment: http://stackoverflow.com/comment/47573477
has body: You said something interesting: x changed to 0 and remains as is. The only way in your code that can happen is if the onscroll function block makes a change because your HTML sets x. If your window.onscroll = function() is indeed firing, but you are not getting the right scroll position (i.e. 0), try changing the way the scroll position is returned: window.onscroll = function () { show.innerHTML = document.documentElement.scrollTop || document.body.scrollTop; }; I found out that document.documentElement.scrollTop always returns 0 on Chrome. This is because WebKit uses body for keeping track of scrolling, but Firefox and IE use html. Please try your updated snippet: var elem = document.getElementById('repeat'); var show = document.getElementById('show'); for (i = 1; i <= 300; i++) { elem.innerHTML += i + " "; } window.onscroll = function () { show.innerHTML = document.documentElement.scrollTop || document.body.scrollTop; }; #show { display:block; position:fixed; top:0px; left:300px; } x
has comment: http://stackoverflow.com/comment/47573304
type: Answer
has comment: http://stackoverflow.com/comment/59794017
accepted answer of: http://stackoverflow.com/q/29718833
has comment: http://stackoverflow.com/comment/47573372
has comment: http://stackoverflow.com/comment/47573253
upvote count: 15
has comment: http://stackoverflow.com/comment/47573394
has comment: http://stackoverflow.com/comment/47573470

http://stackoverflow.com/a/29834218
has body: Looks like you want to open a popup only on the first click. Just use addEventListener and removeEventListener to get rid of it after the first click. Here's the working code: function createPopup() { window.open('popup creating website', 'poppage', 'toolbars=0, scrollbars=1, location=0, statusbars=0, menubars=0, resizable=1, width=950, height=650, left = 300, top = 50'); document.body.removeEventListener('click', createPopup); } document.body.addEventListener('click', createPopup);
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29834146
downvote count: 0
has comment: http://stackoverflow.com/comment/47795258
type: Answer

http://stackoverflow.com/a/29768587
accepted answer of: http://stackoverflow.com/q/29768377
score: 0
has comment: http://stackoverflow.com/comment/47668249
has body: your raw php code should be echoing out the values in to the JavaScript 'id': '{&lt;?php echo $order_query['order_id']; ?&gt; }', what you are sending to Google Anlayitcs now is the id of "{$order_query['order_id']}" which is a text string and not going to work.
has comment: http://stackoverflow.com/comment/47668020
answers question: http://stackoverflow.com/q/29768377
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47668312
type: Answer
has comment: http://stackoverflow.com/comment/47668045

http://stackoverflow.com/comment/47633082
comment on: http://stackoverflow.com/q/29750449
score: 1
has text: Duplicate http://stackoverflow.com/questions/21703404/how-to-test-for-existence-of-css-class-in-javascript-without-jquery
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47664844
type: QuestionComment
has text: hope this help you http://stackoverflow.com/questions/15462991/trigger-autocomplete-without-submitting-a-form
comment on: http://stackoverflow.com/q/29766805
score: 0
type: Comment

http://stackoverflow.com/a/29690371
accepted answer of: http://stackoverflow.com/q/29690355
upvote count: 3
has body: Convert your string to integer first. var dec = parseInt(document.getElementById('number').value);
score: 3
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29690355
type: Answer

http://stackoverflow.com/q/29727419
has answer: http://stackoverflow.com/a/29727766
has comment: http://stackoverflow.com/comment/47591734
has comment: http://stackoverflow.com/comment/47591493
type: Question
has answer: http://stackoverflow.com/a/29727876
has comment: http://stackoverflow.com/comment/47592867
tagged with: javascript
has comment: http://stackoverflow.com/comment/47590875
has comment: http://stackoverflow.com/comment/47591576
answer count: 3
has answer: http://stackoverflow.com/a/29727805
has title: Is using var self = this a good way to sync between a class and events?
downvote count: 1
has body: Let's look at this simple code example (it's written in angularjs for the simplicity, but this happens all the times in JavaScript): angular.module('app',[]). directive('myDir', function(){ this.state = {a:1, b:2}; return { link: function(scope, elem, attrs){ elem.on('click', function(){ // "this" is not the class but the element this.state.a++; this.state.b++; console.log(this.state); }); } } }); When the onclick callback's going to be invoked, the "this" will not be the directives function but the element itself. So we all know the trick here and we create a closure and use var self = this to complete the work. angular.module('app',[]). directive('myDir', function(){ // create a closure for the rescue var self = this; this.state = {a:1, b:2}; return { link: function(scope, elem, attrs){ elem.on('click', function(){ self.state.a++; self.state.b++; console.log(self.state); }); } } }); Ok - this works and I've done this so many times, but I'm asking myself if this is the best way to do something like this? This always looked like a bad design workaround to me. Is there a better way to sync between a class and user events?
score: 8
favorite count: 0
upvote count: 9
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47589168
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47589181

http://stackoverflow.com/a/29800293
has body: EDIT: It looks like you can use localstorage in the uiwebview the same way as you can in other full browsers (Which is what Joran ended up finding to work). But you could also use the following if you want access to the variables in objective-c. ORIGINAL: Try using an Objective-c Javascript Bridge (Apple Docs). It allows you to essentially pass values back and forth between your objective-c code and the javascript page (Just like it sounds haha). So you could store the values in an objective c NSMutableDictionary and pass them on to the next page when it changes.
has comment: http://stackoverflow.com/comment/47732673
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29800127
has comment: http://stackoverflow.com/comment/47733051
answers question: http://stackoverflow.com/q/29800127
type: Answer
upvote count: 1

http://stackoverflow.com/comment/47777946
type: QuestionComment
comment on: http://stackoverflow.com/q/29825546
score: 0
has text: I need to send a confirmation email (generated via this form) to my clients / prospects. So the list is emails. When I clic on submit with the email in the uinput, it will send a confirmation email to my clients. I don't know how the confirmation email is generated (The guy before me made it). I only have access to the form.
type: Comment

http://stackoverflow.com/comment/47672851
comment on: http://stackoverflow.com/a/29770413
type: AnswerComment
has text: okay doing that, it has stopped showing anything in the organizations page. Do I need to serialize something?
score: 0
type: Comment

http://stackoverflow.com/a/29721437
answers question: http://stackoverflow.com/q/29721364
has comment: http://stackoverflow.com/comment/47579091
has comment: http://stackoverflow.com/comment/47579197
has comment: http://stackoverflow.com/comment/47578517
score: 0
has comment: http://stackoverflow.com/comment/47579190
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47579248
has body: You can use javascripts JSON.parse() method to parse your JSON into an object. Then you can iterate through the object's keys. var object = JSON.parse(json); var item; for (var i in object) { item = object[i]; }
has comment: http://stackoverflow.com/comment/47577498
accepted answer of: http://stackoverflow.com/q/29721364
type: Answer

http://stackoverflow.com/q/29802403
has comment: http://stackoverflow.com/comment/48057636
has comment: http://stackoverflow.com/comment/47732855
has comment: http://stackoverflow.com/comment/48082377
has title: How to check if the user is online using javascript or any library?
has answer: http://stackoverflow.com/a/29802459
has answer: http://stackoverflow.com/a/29802862
has answer: http://stackoverflow.com/a/29943141
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47733168
downvote count: 2
has body: I need some help on how I could check the internet connection using Javascript or jQuery or any library if available. cause i'm developing an offline application and I want to show a version if the user is offline and another version if the user is online. For the moment i'm using this code : if (navigator.onLine) { alert('online'); } else { alert('offline'); } But this is working very slow to detect. sometimes it's just connected to a network without internet, it takes 5 to 10 seconds to alert false (No internet). I took a look at Offline.js library, but I'm not sure if this library is useful in my case. and I don't know how to use it
score: 34
type: Question
has answer: http://stackoverflow.com/a/29939531
has answer: http://stackoverflow.com/a/29979433
tagged with: javascript
has comment: http://stackoverflow.com/comment/47732818
answer count: 11
linked to: http://stackoverflow.com/q/189430
linked to: http://stackoverflow.com/q/2384167
has answer: http://stackoverflow.com/a/29984356
has comment: http://stackoverflow.com/comment/48010488
has comment: http://stackoverflow.com/comment/47733060
has answer: http://stackoverflow.com/a/67173203
upvote count: 36
has answer: http://stackoverflow.com/a/29989087
tagged with: jquery
has answer: http://stackoverflow.com/a/29944775
favorite count: 0
has answer: http://stackoverflow.com/a/29924659
tagged with: offline
has answer: http://stackoverflow.com/a/29986116
linked to: http://stackoverflow.com/q/11701328

http://stackoverflow.com/q/29804674
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29805424
type: Question
has body: I have a regular html ordered list: Section1 Section2 Subsection1 Subsection2 Subsection3 Item3 and I made a small html form too: Insert After the section The point is to be able to populate the list dinamically using jQuery. For example, if in the text field 1 I type 'Section4' and in the text field 2 I type 'Section3', the function will add a new element with the text 'Section4' right after the already existing 'Section3'. I have done this, and it kind of works ok: $("#btn").click(function(){ var nuevo=$('#nuevo').val(); //var despues=$('#despues').val(); var nl = $(' ').text(nuevo).attr('id', nuevo ).slideDown(); $(".menu").append(nl); But as you see, I have commented out the line grabbing the value of the second text field, because I cannot understand how should I make the reference to the sibling item that will determine the placement of the new item. For instance, if the first item I attach is "Section7" and it goes appended to the very bottom of the list, how can I attach a "Section6" later on right before "Section7"? What jQuery functions would you say that I need to use in order to get going with this? Up to now I only knew a bit of pure javascript. I am trying to understand all the cool things with jQuery but in this case I am finding in the docs a lot of functions that are apparently very similar, so I am quite confused. Thanks!
has title: Choose insertion place in list with jQuery according to id of siblings
score: 0
has answer: http://stackoverflow.com/a/29805199
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29805009
has answer: http://stackoverflow.com/a/29805014
has answer: http://stackoverflow.com/a/29805009
accepted answer: http://stackoverflow.com/a/29805014
answer count: 4

http://stackoverflow.com/comment/47733054
comment on: http://stackoverflow.com/q/29798003
has text: map.fitBounds(layer.getBounds()); if you mean this.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29837371
favorite count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: css
answer count: 0
score: 1
tagged with: forms
upvote count: 1
tagged with: navigation
type: Question
has body: I am trying to reposition a search form/button inside of my navbar with lingering problems. My CSS has changed many times, and I have gotten the form and button to move, but into weir alignment that either changes the nav bar or the search form. Here is my current CSS, which shows no changes from the default bootstrap state. I want to make the search form a little longer, and have the bar and form move slightly down and to the left, in position with the nav list: TesterPage. Toggle navigation About Blog Resume Portfolio Search Bar Submit CSS: .container { background:#30302f; } .container a{ color: #fff; } .container a:hover{ text-decoration: underline; color: #fff; } .menuIcon { background:rgb(200,200,200); } .navbar-brand { height:auto; } .navbar-default { background-color: #30302f; } .navbar-default .navbar-nav>li>a { color: #fff; font-size: 18px; font-weight: bold; padding: 14px 14px; top: 16px; left: -50px; text-transform: uppercase; } .navbar-form .navbar-right .form-class{ left: -30px; top: 100px; } .navbar-default .navbar-nav>li>a:hover { color: #fff; text-decoration: underline; } #brandImage { max-width:60%; } @media (max-width:600px) { .navbar-brand { width:95%; padding:8px 2.5%; } #brandImage { max-width:100%; } } @media (min-width:990px) and (max-width:1200px) { .navbar-brand { width:250px; } } Many thanks! EDIT: I still try and edit the CSS code, and it slides my nav header to the left on the index, and misaligns it in other working pages :/
tagged with: javascript
has title: Altering the state/position of a search form in a nav bar
downvote count: 0

http://stackoverflow.com/q/29809763
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29809908
type: Question
has body: I'm attempting to pass a URL parameter to AngularJS controller using below code : &lt;div ng-app&gt; &lt;div ng-controller="TodoCtrl" ng-init="init(getParameter('myParam'))"&gt; &lt;/div&gt; &lt;/div&gt; function TodoCtrl($scope) { $scope.init = function(category) { $scope.category = category; alert(category); }; } function getParameter(theParameter) { var params = window.location.search.substr(1).split('&amp;'); for (var i = 0; i &lt; params.length; i++) { var p=params[i].split('='); if (p[0] == theParameter) { return decodeURIComponent(p[1]); } } return false; } http://jsfiddle.net/U3pVM/15042?myParam=test But it appears the function getParameter('myParam') is not being invoked correctly I expect alert(category); to display 'test' but instead it displays undefined. How to pass a URL parameter to AngularJS controller ? Update : Here is solution I went with : alert(gup('category' , $location.absUrl())) function getParameter( name, url ) { name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&amp;]"+name+"=([^&amp;#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( url ); return results == null ? null : results[1]; } Url is of form http://xxx.xxx.xxx?category=test
accepted answer: http://stackoverflow.com/a/29809806
tagged with: javascript
has title: Invoke function parameter as part of ng-init
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29809806
possible better answer: http://stackoverflow.com/a/29809908

http://stackoverflow.com/q/29759082
tagged with: contenteditable
type: Question
accepted answer: http://stackoverflow.com/a/29759439
upvote count: 4
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4
favorite count: 0
has body: So I am trying to add a delete button that appears on hover of elements inside a contenteditable, and clicking the delete button removes the element. Right now, I have something like this: button.on("click", function() { item.remove(); button.hide(); } However, I would like to make the removal undoable, so the user could press command+z to undo the deletion. As far as I know, you would have to use execCommand to delete the element, in order to do this (A custom solution for undoing is not an option). Is there any way to somehow use execCommand to delete a specific node (even something unselectable, like an iframe)?
has title: Use execCommand to remove an element so it is undoable
has answer: http://stackoverflow.com/a/29759439
type: AnsweredQuestion

http://stackoverflow.com/a/37459345
type: Answer
answers question: http://stackoverflow.com/q/29823223
has comment: http://stackoverflow.com/comment/62417980
score: 0
has body: Form Validation Example Name: E-mail Address: Telephone: Please do not call me. What can we help you with? Customer Service Question Comment Consultation Other Comments:

http://stackoverflow.com/comment/47570366
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29717833
has text: you can use the [IIFE](http://benalman.com/news/2010/11/immediately-invoked-function-expression/) pattern and wrap eveyrthing in a self executing function, which sets an inner scope and won't let variables leak to the global scope
score: 0

http://stackoverflow.com/q/29773253
tagged with: jquery
has title: One $this assignment between event handlers
has answer: http://stackoverflow.com/a/29773557
type: UnansweredQuestion
tagged with: performance
has answer: http://stackoverflow.com/a/29773422
tagged with: javascript
has body: I have a little piece of code: if (PZ_APP.dom.isAnyDomElement($textInputs)){ $textInputs.on("focus", function(){ var $this = $(this), placeholder = $this.attr('data-placeholder') || "Wpisz tekst..."; if ($this.val() === placeholder){ $this.val(""); } }).blur(function(){ var $this = $(this), placeholder = $this.attr('data-placeholder'); if ($this.val() === ""){ $this.val(placeholder); } }); Can I avoid multiple var $this = $(this) assignments between event handlers?
type: Question
score: 0
answer count: 2

http://stackoverflow.com/a/30064651
downvote count: 0
score: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29755539
answers question: http://stackoverflow.com/q/29755539
has comment: http://stackoverflow.com/comment/49099155
upvote count: 1
has comment: http://stackoverflow.com/comment/48281628
type: Answer
has body: Thanks for the report, Blair. It took us a while to dig into the root cause of this one, and were assisted by your comments. Assuming it's the bug we think it is - we pushed a fix to production around last Wednesday that resolves the issue. Please let me know if that's not the case!

http://stackoverflow.com/comment/47696006
type: QuestionComment
has text: try running node and running: os = require('os'); os.tmpDir();
comment on: http://stackoverflow.com/q/29782878
score: 0
type: Comment

http://stackoverflow.com/q/29757612
has body: I took this css theme which is working with javascript and i have a problem with the a.hover (not working): http://cssdeck.com/labs/zg4cr9hu This is the first time i use javascript and i think that the problem comes from the jquery.min.js file i took from the library... In the i wrote in the html page : Is this where the error comes from ? Or should i put something in the js file that i didn't touch (seems good without errors)... Thanks in advance for answers :)
downvote count: 6
accepted answer: http://stackoverflow.com/a/29757704
upvote count: 2
score: -4
has comment: http://stackoverflow.com/comment/47647595
has comment: http://stackoverflow.com/comment/47647636
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47647603
tagged with: javascript
type: Question
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47647753
has comment: http://stackoverflow.com/comment/47647593
has title: Javascript a.hover doesn't work
has answer: http://stackoverflow.com/a/29757704
has comment: http://stackoverflow.com/comment/47647651
tagged with: http://stackoverflow.com/tag/html
tagged with: css

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

http://stackoverflow.com/q/29804464
score: 0
answer count: 3
has body: How do I set my selector to be specific to each h1 and main within multiple repeated structure. I need to be able to click on a h1 and open the contained on the same section as per html bellow. As per the javascript bellow please answer what var trigger and var content should be to accomplish the requirements. Main Header Call to action contentcontent contentcontent First sub header Content contentcontent contentcontent Second sub header content contentcontent contentcontent Third sub header content contentcontent contentcontent My current JS looks like this: $(document).ready(function(){ var trigger = $("h1"); var content = $( "main" ); trigger.click(function(){ content.slideToggle( "slow" ); }); }); Here as JsFiddle with my current code: http://jsfiddle.net/vinicius5581/fLyy931s/
has title: Jquery Selectors for multipe slideToogle
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47744015
has answer: http://stackoverflow.com/a/29804565
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29804574
type: UnansweredQuestion
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29804552
tagged with: javascript

http://stackoverflow.com/q/29794118
has body: In my front end JavaScript application, I make an ajax request to fetch data from the server. As soon as I get the data, I want to return that piece of information to the view. var view_data; $.ajax({ url:"/getDataFromServer.json", //async: false, type: "POST", dataType: "json", success:function(response_data_json) { view_data = response_data_json.view_data; console.log(view_data); //Shows the correct piece of information return view_data; // Does not work. Returns empty data } }); // return view_data; --&gt; Keeping the return outside of the ajax call works but then I need to make my ajax call synchronous in order for this return clause to be executed after the ajax call fetches data. How would I do this?
possible better answer: http://stackoverflow.com/a/29794203
score: 15
tagged with: ajax
has answer: http://stackoverflow.com/a/67280945
answer count: 3
accepted answer: http://stackoverflow.com/a/29794185
has comment: http://stackoverflow.com/comment/72270247
has comment: http://stackoverflow.com/comment/47716443
has comment: http://stackoverflow.com/comment/98523511
favorite count: 0
has title: How to return data from ajax success function?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29794185
has comment: http://stackoverflow.com/comment/47717383
type: Question
has answer: http://stackoverflow.com/a/29794203
upvote count: 15
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/47553189
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29707434
score: 0
has text: Not enough information, I don't see any problems in this code. How do you populate the table? What's the point of `"use_storage"`? What do you mean by clicking leading to reloading?

http://stackoverflow.com/q/29796816
downvote count: 1
has comment: http://stackoverflow.com/comment/47721716
type: Question
has comment: http://stackoverflow.com/comment/47722249
has comment: http://stackoverflow.com/comment/47721947
tagged with: javascript
tagged with: jquery
tagged with: ajax
accepted answer: http://stackoverflow.com/a/29796999
answer count: 1
has body: I've wrote following code for searching via ajax. When key up fired, an ajax request is made after 500ms. But the searching animation doesn't stop (hide() method). $('#mainsearch .searchinput').keyup(function(e) { if (e.which !== 0) { var searchval = $(this).val().trim(); if(aSearch[searchval]) { $('#mainsearch #sugbox #sugres').html(aSearch[searchval]); }else if(prevs !== searchval) { prevs = searchval; clearTimeout($.data(this, 'timer')); var wait = setTimeout(function() {search(searchval)}, 500); $(this).data('timer', wait); } } }); function search(searchval) { console.log("searching for "+searchval) if(lastrequest &amp;&amp; lastrequest.readystate != 4){ // abort past requests lastrequest.abort(); lastrequest = null; delete lastrequest; $('#mainsearch #finding').hide(); } if(searchval != "") { // make an ajax call lastrequest = $.ajax({ url:"/ajaxsearch.php?key_word="+searchval, type: "GET", dataType:'json', cache:true, beforeSend:function() { $('#mainsearch #finding').delay(400).show(0); }, complete: function(jqXHR, status){ console.log('complete'); $('#mainsearch #finding').hide(); }, success:function(result){ $('#mainsearch #finding').hide(); if(result.length &gt; 0 ) { var outp = searchParse(result); $('#mainsearch #sugbox #sugres').html(outp); aSearch[searchval] = outp; } else $('#mainsearch #sugbox #sugres').html('&lt;li&gt;&lt;a href="#"&gt; Not Found &lt;/span&gt;&lt;/a&gt;&lt;/li&gt;'); $('#mainsearch #finding').hide(); }, error : function (xhr, ajaxOptions, thrownError) { $('#mainsearch #finding').hide(); } }); } } I get desired results in search with no error. but the hide() isn't hiding the animation. However, entering $('#mainsearch #finding').hide(); hides the animation. Note : Here #mainsearch #finding is a div which is animated by css3.
has comment: http://stackoverflow.com/comment/47721773
favorite count: 0
has title: Jquery ajax search loading animation does not stop
type: AnsweredQuestion
score: 2
upvote count: 3
has answer: http://stackoverflow.com/a/29796999

http://stackoverflow.com/comment/47814236
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29844090
has text: I started with window.setTimeout() and change it to window.delay(), is this wrong?
score: 0

http://stackoverflow.com/comment/47654087
comment on: http://stackoverflow.com/q/29760965
score: 0
type: Comment
type: QuestionComment
has text: `"Hello | There | Yes".split(' | ').join().split('').indexOf('|') === -1` AND `"Hello| There |Yes".split(' | ').join().split('').indexOf('|') !== -1`

http://stackoverflow.com/comment/47634763
comment on: http://stackoverflow.com/q/29751272
type: Comment
has text: If page reloads probably your JS code does not get triggered. It could be a JS error, or you are not loading jquery, etc. on the page.
type: QuestionComment
score: 0

http://stackoverflow.com/a/29746669
has comment: http://stackoverflow.com/comment/47625594
answers question: http://stackoverflow.com/q/29746607
has comment: http://stackoverflow.com/comment/47625654
score: 0
has body: HTML: Red CSS: .red-cell { background: #F00; /* Or some other color */ } JS: $( function() { $('#red').click( function() { $(this).toggleClass("red-cell"); }); });
type: Answer

http://stackoverflow.com/a/29816929
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/29816841
answers question: http://stackoverflow.com/q/29816841
type: AcceptedAnswer
downvote count: 0
has body: use direction:ltr; not the dir attribute
type: Answer

http://stackoverflow.com/a/29814888
score: 0
type: Answer
has body: Considering your output, you could write a loop for the fields you wish to print and just append &lt;br&gt; to each line; also make sure you properly escape your output for HTML: foreach (['EnrNo', 'Name', 'Batch Code', 'Start Date', 'End Date', 'Course', 'Duration'] as $field) { echo $field, ': ', htmlspecialchars($row[$field], ENT_QUOTES, 'UTF-8'), '&lt;br&gt;'; }
answers question: http://stackoverflow.com/q/29814446

http://stackoverflow.com/q/29810607
accepted answer: http://stackoverflow.com/a/29812245
upvote count: 2
has title: How to force https redirect on heroku with express 4.0?
possible better answer: http://stackoverflow.com/a/29812488
type: Question
tagged with: heroku
type: AnsweredQuestion
answer count: 2
has answer: http://stackoverflow.com/a/29812245
downvote count: 0
tagged with: javascript
tagged with: express
favorite count: 0
has body: I don't understand why my following code does not accomplish this? Can someone explain where I am going wrong? All http requests should be redirected to https on heroku, but not on localhost. If someone could point me to an example of this working I would really appreciate it. I feel like this should be very simple and straightforward. var app = express(); var https_redirect = function () { return function(req, res, next) { if(process.env.NODE_ENV === 'production'){ if(req.headers['x-forwarded-proto'] != 'https') { return res.redirect('https://' + req.headers.host + req.url); } else { return next(); } } else { return next(); } }; }; app.use(https_redirect()); var server = app.listen(config.port, config.ip, function () { }); exports = module.exports = app; I did some searching already and it looks like what I have should work.
tagged with: node.js
has answer: http://stackoverflow.com/a/29812488
score: 2

http://stackoverflow.com/comment/47811405
has text: Have you checked that it exists in your fonts directory?
type: QuestionComment
comment on: http://stackoverflow.com/q/29842583
score: 0
type: Comment

http://stackoverflow.com/comment/47823237
comment on: http://stackoverflow.com/a/29842741
type: Comment
has text: @JordiVermeulen: In fact, keeping backpointers as you suggest can be thought of as a way of caching this process. Without backpointers, recovering an optimal subset is O(n^2); with them it's just O(n), but you need an additional O(nc) space to hold the pointers (which usually isn't a big deal, since you need O(nc) space for the DP table anyway).
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47800517
comment on: http://stackoverflow.com/a/29817719
has text: I tried this and it works but I it has a side effect of all the validations firing for all my input showing up the error messages when it tab out of the first input on the form. I I have the following on all my inputs data-parsley-trigger="focusout"
type: AnswerComment
score: 0
type: Comment

angular-amd
tag name: angular-amd
type: Tag
tags question: http://stackoverflow.com/q/29689324
tags question: http://stackoverflow.com/q/29830659

http://stackoverflow.com/comment/47773601
has text: Of course the wrapper www.google.com/recaptcha/api.js, get loaded. then my code get executed. But In this case, i have to inject recaptcha__en.js, not api.js. So the question in how do i inject second level code that is recaptcha__en.js?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29822638

http://stackoverflow.com/q/29784975
upvote count: 1
type: Question
tagged with: jsonp
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has body: Here's the problem in an abstract way, I have multiple IPs. I want to figure on which of the IPs the server lies. The server hosts a json file to help with JSONP request. for (index = 0; index &lt; ipArray.length; ++index) { var ip = ipArray[index]; $.ajax({ url: utils.getJSONPRequestURL(ip), jsonpCallback: 'callback', dataType: "jsonp", success: function (data) {console.log(this.url)} }); } The above function works fine if the IPs are not reachable, it will call the success function which prints the url that succeded. However if one the calls return net::ERR_NETWORK_ACCESS_DENIED error. I will not get a success callback at all. Please note that if i remove jsonpCallback option from the ajax request and define window.callback = function(data) {console.log(data)} This will get called in spite of the above mentioned error, however I will not know on which URL did I get this callback from. Thank you in advance
has title: No success call for JSONP request if one of the multiple calls fail
has answer: http://stackoverflow.com/a/29785092
score: 1
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/47524210
has text: You can also directly use `Array.map` on `to_check` saving you a `forEach` + `push` : `var all = to_check.map(function(item) { return new Promise...});`
comment on: http://stackoverflow.com/a/29693722
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/29786495
downvote count: 0
has body: Something like this? $("form input[type=submit]").click(function() { var frmID = $(this).closest('form').attr('id'); alert(frmID); }); jsFiddle
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29786242
type: Answer
answers question: http://stackoverflow.com/q/29786242
score: 2

http://stackoverflow.com/comment/47742533
type: Comment
comment on: http://stackoverflow.com/a/29806413
score: 0
has text: If you understand why @AmmarCSE's answer is correct, then you'll understand what I'm asking.
type: AnswerComment

http://stackoverflow.com/a/44157033
accepted answer of: http://stackoverflow.com/q/29771258
type: Answer
has body: Its late but may be help full for others. If you want to select only one area at a time you can use builtin functionality. Use singleSelect: false in options at time of plugin initialization.
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29771258

http://stackoverflow.com/comment/47758280
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29813879
has text: Jquey ui docs say: $('#progress').progressbar({"value": progress}). Can it be the issue? And i noticed you initialize progressbar twice.
type: QuestionComment

http://stackoverflow.com/a/29832393
score: 0
answers question: http://stackoverflow.com/q/29828571
type: Answer
has body: With the help of a few comments I was able to find a solution for my issue! With using $('#catalogue-view-action-view-ct').load(url); there was actually no need to set the data-url. But in order to have the relative path work properly I needed to surround it with url.content like so: $('#catalogue-view-action-view-ct').load('@Url.Content("~/Catalogue_Items/ItemsActionViewPartial/")@Model.CatalogueItemID?loc=' + $('#LocationID').val() + '&amp;AsyncUpdateID=catalogue-view-action-view-ct'); loading this value produced the desired results. Thanks @Lal for leading me in the right direction!
accepted answer of: http://stackoverflow.com/q/29828571
type: AcceptedAnswer

http://stackoverflow.com/q/29815940
possible better answer: http://stackoverflow.com/a/29896256
has answer: http://stackoverflow.com/a/29896256
has body: The only implementation of jq seems to be in C. Is there anything comparable in (browser-side) JavaScript? The reason I'm asking is basically to work out how much it's worth investing in jq - I generally prefer toolkits that JS-based, since they can be installed via NPM, can be used in the browser et. And those are two environments likely to encounter JSON...
has answer: http://stackoverflow.com/a/68286677
tagged with: javascript
score: 12
has comment: http://stackoverflow.com/comment/47759202
has comment: http://stackoverflow.com/comment/47759172
tagged with: porting
answer count: 7
has answer: http://stackoverflow.com/a/45871967
has answer: http://stackoverflow.com/a/64285428
has comment: http://stackoverflow.com/comment/47759358
favorite count: 0
has title: JavaScript implementation of jq?
tagged with: jq
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/45871967
downvote count: 3
has answer: http://stackoverflow.com/a/64663330
type: Question
has answer: http://stackoverflow.com/a/55243234
upvote count: 15
has answer: http://stackoverflow.com/a/73343334

http://stackoverflow.com/q/29817399
has comment: http://stackoverflow.com/comment/47762010
has body: This is my Timer function var myTimer = setInterval(function () { var d = new Date(); var seconds = d.getMinutes() * 60 + d.getSeconds(); var fiveMin = 60 * 5; var timeleft = fiveMin - seconds % fiveMin; var result = parseInt(timeleft / 60) + ':' + timeleft % 60; //console.log(result); var timerObj = { timer : result } $scope.timerArray = timerObj; $scope.$apply(); if (timeleft === 1) { $scope.statusDetails = []; $scope.timeDetails(); $scope.get_dbStatus(); } }, 1000); This function will reset the above timer when I click a button. $scope.refreshStatusList = function(){ $scope.hide = true; $scope.$emit('LOAD'); clearInterval(myTimer); $scope.statusDetails = []; $scope.timeDetails(); $scope.get_dbStatus(); }; This is my refresh button in html page upon clicking it the timer must get reset. &lt;div class="col-lg-2"&gt; &lt;a href="#" title="Refresh" ng-click="refreshStatusList();"&gt; &lt;i class="fa fa-refresh fa-lg"&gt;&lt;/i&gt; &lt;/a&gt; &lt;/div&gt;
has comment: http://stackoverflow.com/comment/47761901
has title: Timer is not getting reset using clearInterval()
type: Question
has answer: http://stackoverflow.com/a/29817578
answer count: 2
has comment: http://stackoverflow.com/comment/47763747
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/47761824
has answer: http://stackoverflow.com/a/29817512
tagged with: timer
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47763801
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47769373
has comment: http://stackoverflow.com/comment/47763151

http://stackoverflow.com/q/29800596
type: Question
has comment: http://stackoverflow.com/comment/47729524
tagged with: outlook
has title: Convert SVG to JPEG to embedd in HTML
tagged with: javascript
score: 0
answer count: 1
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/3975499
has answer: http://stackoverflow.com/a/29804200
tagged with: http://stackoverflow.com/tag/jpeg
has body: I'm using jSignature to capture a signature. I can capture and redisplay the signature without a problem, but I need to put the signature as part of the message body in a html mail. The signature appears in a web based email browser like yahoo, but will not show up if the the mail is opened in Outlook. All other images in outlook appear OK.

http://stackoverflow.com/q/29843323
upvote count: 1
type: Question
has title: Image link with javascript
has comment: http://stackoverflow.com/comment/47812915
score: 1
has body: I am not into javascript, but I really want randomized pictures on my index page so was wondering if there is anything I could do with my current javascript to add image link to each picture? &lt; img id = "reklame" / &gt; &lt; script &gt; function getRandomImage() { var images = ['bilder/reklame.jpg', 'bilder/reklame1.jpg', 'bilder/reklame2.jpg', 'bilder/reklame3.jpg']; var image = images[Math.floor(Math.random() * images.length)]; return image; } function displayRandomImage() { var htmlImage = document.getElementById("reklame"); htmlImage.src = getRandomImage(); } displayRandomImage(); &lt; /script&gt;
tagged with: hyperlink
has answer: http://stackoverflow.com/a/29843752
has comment: http://stackoverflow.com/comment/47813036
tagged with: image
has answer: http://stackoverflow.com/a/29843879
tagged with: random
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29843570
has answer: http://stackoverflow.com/a/29844211
has comment: http://stackoverflow.com/comment/47813393
possible better answer: http://stackoverflow.com/a/29843570
accepted answer: http://stackoverflow.com/a/29843879
answer count: 4
has comment: http://stackoverflow.com/comment/47813197
type: AnsweredQuestion

http://stackoverflow.com/comment/47768176
score: 1
type: AnswerComment
has text: Now I feel silly - the answer was in the question. I just did not get the decimal values. Thank you.
type: Comment
comment on: http://stackoverflow.com/a/29820267

http://stackoverflow.com/q/29692960
has comment: http://stackoverflow.com/comment/47522937
type: AnsweredQuestion
score: 1
tagged with: date
has body: I have this field where I can insert the date and time through a datetimepicker: &lt;script&gt; $(function() { $('#datepicker').datetimepicker({dateFormat: 'dd-mm-yy'}); }); &lt;/script&gt; When I select the date and time, it will show the date and time perfectly in the textfield. Also when I press the submit button it will store the date and time perfectly through a DateTime() type in the database. Now I format the date that I read from the database from y-m-d to d-m-y in a function which is working fine. The problem is, if I go back to the page I submitted the date time in, it shows all the information I submitted in the input fields, except for the time. It only shows the date. This is my input field: &lt;input type="text" name="date" value={{$date}} id='datepicker'&gt; When I var_dump($date); a few lines before the input field, I get the date and time perfectly like I want it: 11-04-2015 09:09 but in the textfield it shows: 11-04-2015 So there is nothing wrong with the variable $date. When I submit again, it will save 11-04-2014 00:00:00. Which makes me think there's something wrong with the format the default value is displayed in the textfield. I already tried: dateFormat: 'dd-mm-yy HH::mm' in the script. I use: https://jqueryui.com/datepicker/ and: http://trentrichardson.com/examples/timepicker/ EDIT: Timepicker format JS: timeFormat: 'HH:mm'
type: Question
has title: time wont show time in textfield with datetimepicker
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47522530
upvote count: 1
has comment: http://stackoverflow.com/comment/47522531
favorite count: 0
has comment: http://stackoverflow.com/comment/47522638
has answer: http://stackoverflow.com/a/29699413
accepted answer: http://stackoverflow.com/a/29699413
tagged with: php

http://stackoverflow.com/q/29823441
answer count: 3
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/29919084
favorite count: 0
accepted answer: http://stackoverflow.com/a/29919084
has body: I'm running into a race condition when using Modernizr to load a CSS file. On my local and staging environments, it loads the CSS file below another stylesheet in the head. This is what I want it to do, so the rules defined in the asynchronously loaded file override the styles in the file that's not asynchronously loaded. But, on production, the asynchronously loaded file get's placed above the other stylesheet which makes the overrides in the asynchronously loaded file not work. The question is, is there a way to tell Modernizr where to load the async file? I've looked through the docs for Modernizr and the yepnope library that Modernizr uses to load files, but I'm not seeing anything. Side notes: I realize I can add more specificity or use the !important on the rules in the asynchronously loaded file, but want to avoid doing that. Also, I know there are other ways to accomplish this, for instance using jQuery to add the stylesheet after the last in the head, but I want to first see if this can be accomplished using Modernizr. Example: Local &amp; Staging (what I want) &lt;link rel='stylesheet' href='main.css' type='text/css'&gt; &lt;!-- Loaded asynchronously with Modernizr --&gt; &lt;link rel='stylesheet' href='overrides.css' type='text/css'&gt; Production (not what I want) &lt;!-- Loaded asynchronously with Modernizr --&gt; &lt;link rel='stylesheet' href='overrides.css' type='text/css'&gt; &lt;link rel='stylesheet' href='main.css' type='text/css'&gt;
tagged with: css
tagged with: modernizr
type: AnsweredQuestion
has title: How to tell Modernizr load (yepnope) to add CSS at bottom of head?
tagged with: yepnope
upvote count: 3
has answer: http://stackoverflow.com/a/31570338
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29823811
has answer: http://stackoverflow.com/a/29823811

http://stackoverflow.com/comment/47555324
score: 1
comment on: http://stackoverflow.com/q/29709744
has text: This is kind of a broad question. In short, the answer is Yes and how depends on what you use for storage. Server with SQL or MySQL or something like Firebase, etc. Not sure if your going to get a 'good' answer to your question.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29767384
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47665708
has comment: http://stackoverflow.com/comment/47665742
favorite count: 0
duplicate of: http://stackoverflow.com/q/7927419
has comment: http://stackoverflow.com/comment/47666167
has body: How to add custom event in html tag like: &lt;button oncustomevent="doSomething('string')"&gt; Thanks in advance
type: UnansweredQuestion
score: 3
downvote count: 0
answer count: 0
linked to: http://stackoverflow.com/q/7927419
type: Question
tagged with: javascript
upvote count: 3
has title: Adding custom events in html tag
has comment: http://stackoverflow.com/comment/47666184

http://stackoverflow.com/a/29713989
upvote count: 3
has comment: http://stackoverflow.com/comment/47563156
type: Answer
has body: Add this on top of your JS Function: $('.moving_container li').width($(window).width());
downvote count: 0
has comment: http://stackoverflow.com/comment/47564334
score: 3
answers question: http://stackoverflow.com/q/29713777
has comment: http://stackoverflow.com/comment/47563023

http://stackoverflow.com/q/29719755
favorite count: 0
has comment: http://stackoverflow.com/comment/47574115
type: Question
has comment: http://stackoverflow.com/comment/47574640
answer count: 2
has answer: http://stackoverflow.com/a/29720151
upvote count: 1
possible better answer: http://stackoverflow.com/a/29720151
has body: when reading jquery source code,I find that sometimes $().offsetParent() returns html while the native js returns body. while ( offsetParent &amp;&amp; ( !jQuery.nodeName( offsetParent, "html" ) &amp;&amp; jQuery.css( offsetParent, "position") === "static" ) ) { offsetParent = offsetParent.offsetParent; } here is the case: when offsetParent is body,here runs the code "offsetParent = offsetParent.offsetParent;" my test: console.log(document.getElementById('div').offsetParent); console.log($('#div').offsetParent()); the results: &lt;body&gt;...&lt;/body&gt; [html, prevObject: jQuery.fn.jQuery.init[1], context: document, jquery: "2.0.3", constructor: function, init: function…] but what is the reason ? why jquery do this work?
accepted answer: http://stackoverflow.com/a/29719793
has comment: http://stackoverflow.com/comment/47574277
has comment: http://stackoverflow.com/comment/47574253
has title: why jquery offsetParent() returns html while the native javascript returns body
downvote count: 0
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47574258
score: 1
has answer: http://stackoverflow.com/a/29719793

http://stackoverflow.com/q/29720170
has comment: http://stackoverflow.com/comment/47574906
has comment: http://stackoverflow.com/comment/47576987
has title: HTML Link, to save a file to my computer.
linked to: http://stackoverflow.com/q/23825871
has comment: http://stackoverflow.com/comment/47575033
has body: Hi guys I am using a simple html link to save a generated .xml file Save your file Problem is that, when I click on the above link, instead of opening the file dialog box to save the file in my local windows computer, the browser opens it like a web page. Is there any solution to the problem? Maybe some JavaScript or something.... Also is it possible to open the file dialog box at a defined folder path? Thank you so much !
has answer: http://stackoverflow.com/a/29720240
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/3749231
upvote count: 3
score: -2
linked to: http://stackoverflow.com/q/11353425
downvote count: 5
linked to: http://stackoverflow.com/q/7763505
linked to: http://stackoverflow.com/q/3802510
type: Question
has comment: http://stackoverflow.com/comment/47574971
has comment: http://stackoverflow.com/comment/47574911
has comment: http://stackoverflow.com/comment/47574880
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/10615797
has comment: http://stackoverflow.com/comment/47577520
favorite count: 0
has comment: http://stackoverflow.com/comment/47574980
linked to: http://stackoverflow.com/q/364946
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47740211
comment on: http://stackoverflow.com/q/29806037
has text: What is `val` in your function?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29790977
has comment: http://stackoverflow.com/comment/47758202
tagged with: javascript
has comment: http://stackoverflow.com/comment/47710981
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29791136
upvote count: 1
has comment: http://stackoverflow.com/comment/47710838
downvote count: 1
has comment: http://stackoverflow.com/comment/47710979
tagged with: jquery
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/47758119
has comment: http://stackoverflow.com/comment/47710985
has comment: http://stackoverflow.com/comment/47710895
has title: Show/Hide div inside DataList
has answer: http://stackoverflow.com/a/29815567
has body: I want to toggle Gridview on LinkButton.Both are inside Datalist ItemTemplate.Kindly help &lt;asp:DataList ID="dl_newtabs" runat="server" RepeatDirection="Vertical"&gt; &lt;ItemTemplate&gt; &lt;div class="solution_footer"&gt; &lt;asp:LinkButton ID="lnk_tabnew" runat="server" Text='&lt;%# Eval("service_name") %&gt;' CommandArgument='&lt;%# Eval("service_name") %&gt;' OnClick="lnk_tabnewclick" CssClass="toggdiv"&gt;&lt;/asp:LinkButton&gt; &lt;/div&gt; &lt;div id="Div1" style="max-height: 300px; overflow-y: scroll; float: left; width: 100%;" &gt; &lt;asp:Gridview id ="grddesc" runat="server"&gt; &lt;/asp:Gridview&gt; &lt;/div&gt; &lt;/asp:DataList&gt; This is what i so far done, On Click of LinkButton. $(document).ready(function () { $(".Div1").hide(); $(".solution_footer").click(function () { $(this).nextAll('div[class="Div1"]').eq(0).slideToggle(100); }); });
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47711031
type: Question
tagged with: c#

http://stackoverflow.com/comment/47988358
score: 0
has text: Where is your logic to post new messages? It may also be helpful to show your sails chat controller.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29725815

http://stackoverflow.com/a/29796445
answers question: http://stackoverflow.com/q/29795191
type: Answer
has comment: http://stackoverflow.com/comment/47725431
score: 0
has body: getValues() returns an Array with base 0, getRange() works with base 1, just sum 1 to the Range. Don't forget that when using for-in, the index in the Array is treated as a String.

http://stackoverflow.com/comment/47793325
score: 0
type: Comment
has text: Demo: http://jsfiddle.net/wmTYr/8/
type: QuestionComment
comment on: http://stackoverflow.com/q/29833182

date
tags question: http://stackoverflow.com/q/29694302
tags question: http://stackoverflow.com/q/29798271
tags question: http://stackoverflow.com/q/29797256
tag name: date
tags question: http://stackoverflow.com/q/29785294
tags question: http://stackoverflow.com/q/29727981
tags question: http://stackoverflow.com/q/29768582
tags question: http://stackoverflow.com/q/29702141
tags question: http://stackoverflow.com/q/29805539
tags question: http://stackoverflow.com/q/29828098
tags question: http://stackoverflow.com/q/29744803
tags question: http://stackoverflow.com/q/29700099
tags question: http://stackoverflow.com/q/29792168
tags question: http://stackoverflow.com/q/29779489
type: Tag
tags question: http://stackoverflow.com/q/29757869
tags question: http://stackoverflow.com/q/29813830
tags question: http://stackoverflow.com/q/29823726
tags question: http://stackoverflow.com/q/29830649
tags question: http://stackoverflow.com/q/29793473
tags question: http://stackoverflow.com/q/29812511
tags question: http://stackoverflow.com/q/29692960
tags question: http://stackoverflow.com/q/29773947
tags question: http://stackoverflow.com/q/29752484
tags question: http://stackoverflow.com/q/29717972
tags question: http://stackoverflow.com/q/29705425
tags question: http://stackoverflow.com/q/29770557
tags question: http://stackoverflow.com/q/29750806
tags question: http://stackoverflow.com/q/29734945
tags question: http://stackoverflow.com/q/29715723
tags question: http://stackoverflow.com/q/29794696
tags question: http://stackoverflow.com/q/29715354

http://stackoverflow.com/q/29689093
favorite count: 0
has answer: http://stackoverflow.com/a/29689182
has comment: http://stackoverflow.com/comment/47515343
has answer: http://stackoverflow.com/a/29689133
linked to: http://stackoverflow.com/q/5641997
linked to: http://stackoverflow.com/q/9899372
type: AnsweredQuestion
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29689164
accepted answer: http://stackoverflow.com/a/29689182
has body: &lt;!DOCTYPE&gt; &lt;html&gt; &lt;script&gt; var btn = document.createElement("BUTTON"); var txt = document.createTextNode("Text"); btn.appendChild(txt); document.body.appendChild(btn); &lt;/script&gt; &lt;/html&gt; I just started learning HTML and JavaScript. I was expecting the above code to output a button with a word "text" in it. Unfortunately, the output was blank. Can someone explain to me why this code didn't work?
upvote count: 0
has comment: http://stackoverflow.com/comment/47515281
tagged with: javascript
score: -1
possible better answer: http://stackoverflow.com/a/29689164
answer count: 3
has title: creating html document dynamically
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47515295

http://stackoverflow.com/comment/47547074
score: 0
has text: Can I share the submitted value across page refreshes within a service/factory?
comment on: http://stackoverflow.com/a/29705500
type: Comment
type: AnswerComment

http://stackoverflow.com/a/29729089
score: 1
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29727772
has body: JavaScript does not come with Validator functions that help validate a form. Instead you could build one or download one like you would jQuery, these extra pieces of code are called Libraries. Right now the browser does not understand what Validator is, so it results in an error. But if you include something like Parsley or Verify.js and write some code according to their documentation you can archive the result you want.
downvote count: 0

http://stackoverflow.com/q/29841274
has comment: http://stackoverflow.com/comment/47816140
tagged with: jsp
has title: Multiple form to single action in spring with single button
has comment: http://stackoverflow.com/comment/47810081
tagged with: javascript
score: 0
has body: I have a single jsp where there are two spring forms are available. &lt;form:form modelAttribute="obj1" action="/some"&gt; here i get the list of values and show then in dropdown. &lt;/form:form&gt; &lt;form:form modelAttribute="obj2" action="/some"&gt; here i have some other things like table etc and **a submit button**. &lt;/form:form&gt; Both obj1 and obj2 are model objects and get filled by two database call. @RequestMapping("some") public ModelAndView somemethod(){ return "modelandview"; } Now, How can i retrieve the selected value in dropdown to this controller action when submit button pressed. Now, i am able to get the data from another form(for example obj2 form). Probably, I can not use form inside another form option but if that is only the option and i will go ahead and try again. a
has comment: http://stackoverflow.com/comment/47810816
answer count: 1
has answer: http://stackoverflow.com/a/29868496
type: UnansweredQuestion
tagged with: spring
has comment: http://stackoverflow.com/comment/47810645
type: Question

http://stackoverflow.com/comment/70672644
has text: sorry, @Michael. like I said, I don't actually use `pm2` so I can't help any further than I already did. I just said what I said since it sounds like it will solve the OP's problem. Try looking at other answers in this thread. maybe they can help you out.
type: AnswerComment
comment on: http://stackoverflow.com/a/29766913
score: 0
type: Comment

http://stackoverflow.com/comment/47670394
has text: Are you certain that jQuery is a dependency of Backbone.js? I ran Backbone.js with just Underscore.js a while back with no problems.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29769887
type: AnswerComment

http://stackoverflow.com/comment/47722224
comment on: http://stackoverflow.com/a/29795319
score: 0
type: Comment
has text: can you please go through my code, it is right or not? thanks
type: AnswerComment

http://stackoverflow.com/comment/47572415
type: Comment
type: QuestionComment
has text: Yes, it's possible !
score: 2
comment on: http://stackoverflow.com/q/29718962

http://stackoverflow.com/q/29789982
has comment: http://stackoverflow.com/comment/47708877
has title: Select all class nodes except $(this)
type: Question
has answer: http://stackoverflow.com/a/29789992
accepted answer: http://stackoverflow.com/a/29789992
answer count: 1
linked to: http://stackoverflow.com/q/3572224
has comment: http://stackoverflow.com/comment/47709295
tagged with: javascript
tagged with: jquery
has body: In an event handler, where $(this) is an element that matches a .myclass how do I select all other .myclass elements, except $(this)?
score: 0
upvote count: 1
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47708970
has comment: http://stackoverflow.com/comment/47708861
duplicate of: http://stackoverflow.com/q/3572224
type: AnsweredQuestion

http://stackoverflow.com/comment/47806423
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29839752
has text: If you want to store the data you can store it in a `cookie` or `localStorage` and use it as a paramter for the function @RaphaelMüller suggested

http://stackoverflow.com/comment/47720626
type: AnswerComment
score: 0
type: Comment
has text: When you don't you the bracket and you hover "canvas" in the dev tools you can see that it's there. Your problem is that "canvas" is not a directive or doesnt do anything.
comment on: http://stackoverflow.com/a/29795869

http://stackoverflow.com/q/29808144
has comment: http://stackoverflow.com/comment/47748665
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47745791
upvote count: 1
has title: Unable to toggle multiple dynamic Google Maps marker points with checkbox
has comment: http://stackoverflow.com/comment/47745671
type: Question
has body: So, I've been trying to determine how to fix this problem for quite awhile now. I have a list of map points that are dynamically added with every update from the squad. JSFIDDLE Here's an example of what each update would look like: mapPoints.push(new google.maps.LatLng(33.730362 , -85.792725)); names.push("Alpha"); times.push("1425059747829"); colors.push("Red"); mapPoints.push(new google.maps.LatLng(33.7304572 , -85.792498)); names.push("Alpha"); times.push("1425059747829"); colors.push("Red"); mapPoints.push(new google.maps.LatLng(33.7304346 , -85.792634)); names.push("Alpha"); times.push("1425059747829"); colors.push("Red"); mapPoints.push(new google.maps.LatLng(33.73041 , -85.79264)); names.push("Alpha"); times.push("1425059172108"); colors.push("Blue"); mapPoints.push(new google.maps.LatLng(33.730312 , -85.792654)); names.push("Delta"); times.push("1425059747723"); colors.push("Blue"); mapPoints.push(new google.maps.LatLng(33.73023 , -85.79246)); names.push("Foxtrot"); times.push("1425059172145"); colors.push("Purple"); mapPoints.push(new google.maps.LatLng(33.72476 , -85.788185)); names.push("Golf"); times.push("1425050587395"); colors.push("Green"); Based on this information, I pass each mapPoint into a google maps marker, and label them based on their names. I then update a dynamic checkbox based on the squad names given, removing duplicates. Now, whenever I try and toggle visibility of all points associated with a squad name it only removes one point instead of all of them. Any help would be very appreciated! function updateCheckbox(names,markers){ var checkbox = $("#checkBoxes"); //check if names return null if names !=null create a dynamic list of checkboxes //based on live squads if(names!=null){ var $ctrl = $('&lt;input/&gt;').attr({type:'checkbox', checked:'yes',name:'chk'}); $("#checkBoxes").append($ctrl); //designate squad name to each checkbox $ctrl.after(names); console.log(names); // toggle display of the squads } $($ctrl).click(function () { if …
tagged with: javascript
has answer: http://stackoverflow.com/a/29812670
tagged with: google-maps-api-3
tagged with: google-maps
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47749495
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47749775
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29812670

http://stackoverflow.com/q/29823843
has answer: http://stackoverflow.com/a/29824161
has title: How do I select all check box when I click on Select button using jQuery
has answer: http://stackoverflow.com/a/29823976
score: 1
has comment: http://stackoverflow.com/comment/47774158
has comment: http://stackoverflow.com/comment/47774285
possible better answer: http://stackoverflow.com/a/29823970
has answer: http://stackoverflow.com/a/29824583
has answer: http://stackoverflow.com/a/29823970
accepted answer: http://stackoverflow.com/a/29823976
has answer: http://stackoverflow.com/a/29824337
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29824267
has answer: http://stackoverflow.com/a/41870477
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
answer count: 9
has answer: http://stackoverflow.com/a/29824124
has answer: http://stackoverflow.com/a/29824173
has body: I have HTML page which have multiple check boxes and individually they can be checked. I have button select, so what I am suppose to do is. When I click on select all the check boxes should get selected, and deselected. Html Select number company Type Address Code 1 APPLE IT San Jones US 2 DELL IT San Jones US 3 Amazon IT San Jones US 4 Microsoft IT San Jones US Output In the image I have select button. what I want is when I click on select button all the check boxes should get selected
upvote count: 1
has comment: http://stackoverflow.com/comment/47774234
type: Question

modernizr
tags question: http://stackoverflow.com/q/29823441
type: Tag
tag name: modernizr
tags question: http://stackoverflow.com/q/29716923
tags question: http://stackoverflow.com/q/29710793

http://stackoverflow.com/comment/47538460
type: QuestionComment
comment on: http://stackoverflow.com/q/29701216
score: 0
has text: @DrKey Yeah I know. That's why I left them a few options including `return`.
type: Comment

http://stackoverflow.com/q/29826383
type: UnansweredQuestion
score: 2
downvote count: 0
favorite count: 0
type: Question
has title: woocommerce checkout if statement
tagged with: php
upvote count: 2
has answer: http://stackoverflow.com/a/29829456
tagged with: wordpress
has body: I'm trying to create a select box on my client's woocommerce checkout page on Wordpress that asks where the customer heard about the site. I've got as far as creating it and am now trying to have a text box pop up when "other" is selected. So far, it's not happening. Here's the code I have for the drop down and the text box at the moment: /** * Add how did you hear about us field to the checkout **/ add_action('woocommerce_after_order_notes', 'how_did_you_hear'); function how_did_you_hear( $checkout ) { echo '&lt;div id="how_did_you_hear"&gt;'; woocommerce_form_field( 'hear_about_us', array( 'type' =&gt; 'select', 'class' =&gt; array('how_did_you_hear_about_us form-row-wide'), 'label' =&gt; __('How did you hear about us?'), 'required' =&gt; true, 'onChange' =&gt;'howdidOnchange();', 'options' =&gt; array( '' =&gt; __('-- Choose an option --', 'woocommerce'), 'Google' =&gt; __('Google', 'woocommerce'), 'Facebook' =&gt; __('Facebook', 'woocommerce'), 'Twitter' =&gt; __('Twitter', 'woocommerce'), 'Mother &amp; Baby Magazine' =&gt; __('Mother &amp; Baby Magazine', 'woocommerce'), 'eBay' =&gt; __('eBay', 'woocommerce'), 'Count the Kicks' =&gt; __('Count the Kicks', 'woocommerce'), 'Other (please specify)' =&gt; __('Other (please specify)', 'woocommerce')) ), $checkout-&gt;get_value( 'hear_about_us' )); echo '&lt;/div&gt;'; } /** * Process the checkout **/ add_action('woocommerce_checkout_process', 'how_did_you_hear_process'); function how_did_you_hear_process() { global $woocommerce; } /** * Update the order meta with field value **/ add_action('woocommerce_checkout_update_order_meta', 'how_did_you_hear_update_order_meta'); function how_did_you_hear_update_order_meta( $order_id ) { if ($_POST['hear_about_us']) update_post_meta( $order_id, 'How did you hear about us?', esc_attr($_POST['hear_about_us'])); } //Add text box if other is selected if ($_POST['hear_about_us'] == 'Other (please specify)') { add_action('woocommerce_after_order_notes', 'how_did_other'); function ho…
answer count: 1
tagged with: woocommerce
tagged with: javascript

http://stackoverflow.com/q/29759713
has body: I can use document.createRange() to get a range of individual characters in a textnode, then Range.getBoundingClientRect() to get the position on the screen of those characters. I want to do the same thing for text in an input element, which used to be possible in IE only with createTextRange. This jsfiddle sums up the problem - http://jsfiddle.net/sobu5ug2/2/ I can't use the same method for an input because Range.setStart/End only works on the element level, not the character level, for an input. I also tried window.getSelection().getRangeAt(0).getBoundingClientRect() but that returns a bounding rect of all 0's. I'd like to do this without actually selecting the text, if possible. Is there any way to do this in a modern browser? Thanks.
type: UnansweredQuestion
has title: How to get the bounding rect of selected text inside an ?
has answer: http://stackoverflow.com/a/74502290
upvote count: 5
tagged with: dom
type: Question
score: 5
has comment: http://stackoverflow.com/comment/47651661
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47651749

http://stackoverflow.com/q/29722215
has comment: http://stackoverflow.com/comment/47580345
has body: I want to build an application form where on can attach an image - it's just a couple of input elements - within a div (not an form element). The form shall be processed without an page redirect. So I use ajax. Everything works fine so far. But now I need to add an image. $('#submit_application').click(function () { //... $.ajax({ url: 'submit.php', type: 'post', data: { 'action': 'submit', 'image': $('#image_upload').val(), // .. 'someStringifiedJSON': JSON.stringify(foo) }, success: function (data, status) { // ... }, error: function (xhr, desc, err) { // ... } }); }); How can I get my file into php's $_FILES variable? Or how can I pass the file to php so that I can upload it?
tagged with: php
has answer: http://stackoverflow.com/a/29722371
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29722418
has comment: http://stackoverflow.com/comment/47580242
upvote count: 1
has comment: http://stackoverflow.com/comment/47580278
downvote count: 1
type: Question
has title: jQuery Submit Form (w/ file and text) without redirecting from current window
has comment: http://stackoverflow.com/comment/47579013
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29722418
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29722371
favorite count: 0
tagged with: ajax

http://stackoverflow.com/q/29758843
has comment: http://stackoverflow.com/comment/47650162
has comment: http://stackoverflow.com/comment/47650592
answer count: 1
has comment: http://stackoverflow.com/comment/47650296
score: 1
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/47650850
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29758949
upvote count: 1
has title: Literal and Instance Notations in Javascript
has comment: http://stackoverflow.com/comment/47650648
has comment: http://stackoverflow.com/comment/47650156
tagged with: literals
type: Question
downvote count: 0
tagged with: javascript
tagged with: webforms
has body: I know that there are two main methods of instantiating JavaScript objects. Where I get confused is where the two types of notations come into their own. Taking the below samples. Both the instance variables and the literal variables hold different values and both operations on each variable will return a different result. I have always worked in environments where the Literal notation is used exclusively, however as a .NET programmer I recognise the new keyword and think it makes JavaScript look a little more like c#. I work in a .NET shop and am currently playing in the WebForms world. My question is, why would you use one over the other and does one play better with ASP.Net WebForms? var instance1= new Menu1('Cheese', 'Onion'); var instance2 = new Menu1('Steak', 'Kidney'); var literal1 = Menu2; literal1.Initialise('Fish', 'Chips') var literal2 = Menu2; literal2.Initialise('Sausage', 'Mash') Literal - Original: var Menu2 = {} | Menu2; Menu2 = { //Properties Item1 : '', Item2 :'', //Functions Initialise: function(item1, item2) { Item1 = item1; Item2 = item2; }, GetItem : function(item) { switch(item) { case 'item1': return Item1; break; case 'item2': return Item2; break; } } } Literal - EDIT: var Menu2 = { //Properties Item1 : '', Item2 :'', //Functions Initialise: function(item1, item2) { this.Item1 = item1; this.Item2 = item2; }, GetItem : function(item) { switch(item) { case 'item1': return this.Item1; break; case 'item2': return this.Item2; break; } } } Instance Notation var Menu1 = function(item1, item2) { var _Item1 = item1; var _Item2 = item2; this.GetItem = function(item) { switch(item) { case 'item1': return _Item1; break; case 'item2': return _Item2; break; } } } Thanks
has comment: http://stackoverflow.com/comment/47650898

http://stackoverflow.com/comment/47658958
type: Comment
type: QuestionComment
has text: have you use `animateMotion` tag for svg??
score: 0
comment on: http://stackoverflow.com/q/29763664

http://stackoverflow.com/a/29781089
answers question: http://stackoverflow.com/q/29779764
has comment: http://stackoverflow.com/comment/47703149
score: 0
has body: I hope this will help you because it works perfectly for me Try this one
type: Answer
has comment: http://stackoverflow.com/comment/47694457

http://stackoverflow.com/q/29795255
has body: To convert a PNG to raw data, I put it on a canvas and then request the image data. However, when I request the data, it only contains zeroes. However, if I draw with .fillRect it returns the color of the rectangle drawn. It is as if the inserted image is not really there in the eyes of .getImageData. I have tried setting a timeout on calling .getImageData, but it still doesn't return the correct data, so I believe that it is not a race condition. This is for a Chrome plugin, so cross-platform is not an issue. I have also tried enabling/disabling hardware acceleration for Canvas. Relevant code follows: var item = JQuery(" Import "); var imagebuffercont = JQuery(" ").appendTo("body")[0].getContext("2d"); var uploader = JQuery(" "); uploader.change(function(){ if (this.files && this.files[0]) { var reader = new FileReader(); reader.onload = function (e) { var tmpelem = $(' '); tmpelem.attr('src', e.target.result); imagebuffercont.drawImage(tmpelem[0], 0, 0); var imgbuffer = imagebuffercont.getImageData(0,0,512,512).data; var pixels = []; for (var j = 0; j<512; j++) { var tmprow = []; for (var i = 0; i<512*4; i += 4) { tmprow.push({ red: imgbuffer[i], green: imgbuffer[i+1], blue: imgbuffer[i+2], alpha: imgbuffer[i+3] }); } pixels.push(tmprow); } console.log(pixels); } reader.readAsDataURL(this.files[0]); } });
has answer: http://stackoverflow.com/a/29806149
accepted answer: http://stackoverflow.com/a/29806149
type: Question
score: 0
tagged with: canvas
tagged with: javascript
answer count: 3
possible better answer: http://stackoverflow.com/a/29795346
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29795346
has title: getImageData() on Canvas return only 0 in all fields
has answer: http://stackoverflow.com/a/29795429
type: AnsweredQuestion

http://stackoverflow.com/a/29692851
accepted answer of: http://stackoverflow.com/q/29692822
has comment: http://stackoverflow.com/comment/47523035
upvote count: 2
has body: You don't need to create another regex variable using RegExp constructor. Just use only the below. var patternForEmail = /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})$/i; i at the last called case-insensitive modifier which helps to do a case-insensitive match. Example: &gt; var patternForEmail = /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})$/i; &gt; patternForEmail.test('foo@bar.com') true &gt; patternForEmail.test('@foo@bar.com') false
has comment: http://stackoverflow.com/comment/47522304
has comment: http://stackoverflow.com/comment/47522253
has comment: http://stackoverflow.com/comment/47522306
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47522519
answers question: http://stackoverflow.com/q/29692822
type: Answer

http://stackoverflow.com/comment/47722327
comment on: http://stackoverflow.com/a/29795869
type: Comment
has text: Thank you. The whole problem was that I didn't give it the `chart chart-line` class! When I did that, I indeed had to remove the curly braces. Now it is working! But now I wonder how I can hide the legend when the graph is hidden, since I don't make that element myself.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47742075
type: AnswerComment
has text: The point is to get what the height will be _without_ modifying the element. If you understand why @AmmarCSE's answer is correct, then I think you'll understand why your answer doesn't solve my problem.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29806413

http://stackoverflow.com/q/29825455
downvote count: 0
has answer: http://stackoverflow.com/a/55705786
score: 16
type: Question
has comment: http://stackoverflow.com/comment/47777491
has comment: http://stackoverflow.com/comment/47788420
has comment: http://stackoverflow.com/comment/47779948
possible better answer: http://stackoverflow.com/a/55705786
has comment: http://stackoverflow.com/comment/47784346
tagged with: javascript
has comment: http://stackoverflow.com/comment/47782969
has title: Uncaught TypeError: table.search(...).draw is not a function
has comment: http://stackoverflow.com/comment/47783412
has answer: http://stackoverflow.com/a/44706966
tagged with: datatables
upvote count: 16
has comment: http://stackoverflow.com/comment/47780606
has comment: http://stackoverflow.com/comment/47782603
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/73074470
has comment: http://stackoverflow.com/comment/47785765
has body: Added filtering to a jQuery DataTables plugin, and it is not working very well. I want to have two links that will search for records on specific search words. To figure out how to do that I first tried to use this example. It uses an input field to search for values in the table. It generates this error: Uncaught TypeError: table.search(...).draw is not a function My code: $(document).ready(function() { $('#store-list').dataTable({ "sPaginationType": "full_numbers" }); var table = $('#store-list').DataTable(); $('#myFilter').on( 'keyup', function () { table .search( this.value ) .draw(); } ); }); I have tried different things to make this work: Swapped .DataTable() with .dataTable().api() and .dataTable() Tried ( this.val() ) and ( $('#myFilter').val() ) (link) Tried table.search( this.value ).draw; (without () ) In desperation I tried without search and then without draw Can someone please help me find the error?
linked to: http://stackoverflow.com/q/27067590
answer count: 4
has comment: http://stackoverflow.com/comment/47781550
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29831524
accepted answer: http://stackoverflow.com/a/29831524

http://stackoverflow.com/comment/47635818
type: Comment
comment on: http://stackoverflow.com/a/29751486
has text: Thanks for the response, though this just seems to disable both of them so I cannot access either.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47740204
has text: Thanks i used your approach i was able to call factory conditions in controller but i am getting geoLocation is undefined. Do i need to pass that param in factory.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29805669
type: Comment

http://stackoverflow.com/q/29833676
tagged with: javascript
has comment: http://stackoverflow.com/comment/47794202
answer count: 1
has comment: http://stackoverflow.com/comment/47794016
favorite count: 0
has answer: http://stackoverflow.com/a/29833827
type: UnansweredQuestion
score: 6
tagged with: node.js
has comment: http://stackoverflow.com/comment/47794141
linked to: http://stackoverflow.com/q/10685998
tagged with: http://stackoverflow.com/tag/json
upvote count: 7
has title: Append to a JSON File (Node.JS, Javascript)
has comment: http://stackoverflow.com/comment/47794124
downvote count: 1
has body: I currently have a json file setup with the following format: { "OnetimeCode" : "Value" } And I'd like to be able to do two things: Append to the file (change the values in the file) Add New Items to the File (In the same format) I have been searching for almost an hour trying to find either a module (for Node) or just easy sample code that would allow me to accomplish this. I have tried using several plugins already, but rather than appending to the file, they completely rewrite it. One of the plugins is called "jsonfile" (npm install jsonfile) var jf = require('jsonfile'); // Requires Reading/Writing JSON var jsonStr = WEAS_ConfigFile; var obj = JSON.parse(jsonStr); obj.push({OnetimeCode : WEAS_Server_NewOneTimeCode}); jf.writeFileSync(WEAS_ConfigFile, obj); // Writes object to file But that does not seem to be working. Any help is appreciated! But Please, keep it simple. Also: I cannot use jQuery
type: Question
duplicate of: http://stackoverflow.com/q/10685998

http://stackoverflow.com/q/29744355
favorite count: 0
has comment: http://stackoverflow.com/comment/47621377
type: AnsweredQuestion
score: 1
has body: I'm having problems with the formatting of the following flot chart: I want my second series (gray) straight, just as square. It should start from 682 and end in 683. How to solve it? Options for my flot: var options = { grid: { clickable: true, hoverable: true }, series: { lines: { show: true, fill: true, lineWidth: 0, fillColor: { colors: [{opacity: 1 }, { opacity: 1}] }, }, }, colors: ["rgba(41, 150, 206, 0.9)", "rgba(67, 90, 110, 0.4)",], crosshair: { mode: "xy", color: "#323232", lineWidth: 1, }, xaxis: { mode: mode, show: true, position: "bottom", color: "#323232", font: { size: 10, lineHeight: 15, }, labelHeight: 15, }, yaxis: { show: true, position: "left", color: "#323232", labelWidth: 20, font: { size: 10, }, max: 150, min: 0, }, pan: { interactive: true, cursor: "move", frameRate: 60, }, tooltip: true, tooltipOpts: { id: 'flotTip', content: '%x : %y km/h', shifts: { x: 10, y: 20, }, defaultTheme: true, lines: { track: false, threshold: 0.05, }, } };
has answer: http://stackoverflow.com/a/29845982
accepted answer: http://stackoverflow.com/a/29845982
tagged with: plot
type: Question
has title: jQuery Flotcharts - straight series line ending on a datapoint
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/47765411
tagged with: flot
downvote count: 1
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47624760
has comment: http://stackoverflow.com/comment/47817574

http://stackoverflow.com/q/29705595
has body: how to validate alphanumeric and date formats without using regex and any other framework.Thanks in advance
type: Question
has answer: http://stackoverflow.com/a/29705823
upvote count: 0
answer count: 1
tagged with: javascript
has title: Validation without regex
has comment: http://stackoverflow.com/comment/47546736
score: -5
accepted answer: http://stackoverflow.com/a/29705823
favorite count: 0
type: AnsweredQuestion
downvote count: 5

http://stackoverflow.com/comment/47808107
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29838631
type: AnswerComment
has text: I tried the screen.addEventListener() and it didn't work. I changed 'screen' to 'window' and that didn't work; so I'm still looking into this. My guess it the LG smart phone and the Samsung Galaxy Tab Pro tablet mobile devices I'm using -- both Android -- do not fire the 'orientationchange' event or something.

http://stackoverflow.com/comment/47797304
has text: I've already seen it. Thanks anyway :-)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29835229

http://stackoverflow.com/comment/47598728
type: AnswerComment
type: Comment
has text: The `xtype` property is just a shorter alternative for creating objects than using a full class name. See documentation: http://docs.sencha.com/extjs/5.1/5.1.0-apidocs/#!/api/Ext.Component-cfg-xtype
comment on: http://stackoverflow.com/a/29732642
score: 0

http://stackoverflow.com/q/29742227
type: Question
has comment: http://stackoverflow.com/comment/47618300
has comment: http://stackoverflow.com/comment/47617624
has answer: http://stackoverflow.com/a/29742389
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47617636
linked to: http://stackoverflow.com/q/3846263
answer count: 1
tagged with: jquery
has body: Basically I have an a button as follows: Add to Cart And I have these JS codes: jQuery(".js-checkBackOrdered").click(function(){ if(jQuery("#backordered").length>0){ showpopup(); //should not execute the inline onclick here } }); jQuery("#confirmbtn").click(function(){ //execute the inline onclick event here }) jQuery("#closebtn").click(function(){ closepopup(); //do not proceed with the inline onclick event }) The problem I am having is, everytime I click on the button, the inline onclick is firing simultaneously with the external event. How to stop this and execute the productAddToCartForm.submit(this) afterwards? Please help.
has comment: http://stackoverflow.com/comment/47617963
has title: How to call inline onclick after external event - javascript/jquery?
type: UnansweredQuestion

http://stackoverflow.com/comment/47735206
type: QuestionComment
has text: I think I introduced the mismatched tags I encountered. But the xml I posted works.
type: Comment
comment on: http://stackoverflow.com/q/29783004
score: 0

http://stackoverflow.com/q/29746917
has answer: http://stackoverflow.com/a/29747153
has comment: http://stackoverflow.com/comment/47626231
has comment: http://stackoverflow.com/comment/47626267
type: Question
accepted answer: http://stackoverflow.com/a/29775663
has body: Here's my code: Submit I need to make my code to give the user a button that confirms their order after entering a valid number into the input box. For example: if (x == 1) { text = "Example" } then go from there to make another button that they can click to confirm that. Then they should be shown some text saying "confirmed order" - can anyone help me please? :)
tagged with: javascript
answer count: 6
score: 0
has comment: http://stackoverflow.com/comment/47626171
has answer: http://stackoverflow.com/a/29747258
has answer: http://stackoverflow.com/a/29747321
has comment: http://stackoverflow.com/comment/47627089
possible better answer: http://stackoverflow.com/a/29747483
has comment: http://stackoverflow.com/comment/47626380
has answer: http://stackoverflow.com/a/29775663
has answer: http://stackoverflow.com/a/29747483
has title: Defining Variables in JavaScript and Creating Buttons?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47626384
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47626244
has answer: http://stackoverflow.com/a/29747456

http://stackoverflow.com/comment/47560319
has text: @Vishwanath In the same way you access it in `signal.js`. Think of it as a single large ` ` with everything from `signal.js` at the top.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29712420

state
tag name: state
tags question: http://stackoverflow.com/q/29812226
tags question: http://stackoverflow.com/q/29826443
type: Tag

http://stackoverflow.com/a/29751835
has body: I ran the code with assumed anchor tag using http://www.yahoo.com and I do not get any errors. var arr = [ ]; $('a').filter(function () { var hf = this.href; if(hf.indexOf('www.') === 0) hf = hf.slice(4); hf = this.href.split('/')[2]; hf = hf.split('.').slice(-2).join('.'); console.log('hf: ', hf); $.inArray(hf, arr) == -1; }) link http://jsfiddle.net/r330k6sh/ There must be something going on with your html anchor or http vs https possibly.
answers question: http://stackoverflow.com/q/29751589
has comment: http://stackoverflow.com/comment/47636366
score: -1
upvote count: 0
has comment: http://stackoverflow.com/comment/47636608
type: Answer
has comment: http://stackoverflow.com/comment/47636476
downvote count: 1

http://stackoverflow.com/comment/47725801
has text: (S)he wasn't asking asking for a jQuery solution
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29798482
type: Comment

http://stackoverflow.com/comment/51177454
comment on: http://stackoverflow.com/a/29749922
type: Comment
has text: `dojo/on/debounce` is a shorthand function for debouncing event handlers. @Bergi's example could be rewritten with `dojo/on/debounce` as `var debouncedResize = debounce('resize', 2000); debouncedResize(window, function (event) { topic.publish('event/resize', event); });`
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47683238
has text: @YOU thanx. your advice works. But now I am not getting the value of `message` attribute on html page.
type: Comment
comment on: http://stackoverflow.com/q/29776233
type: QuestionComment
score: 0

http://stackoverflow.com/a/29816417
has body: It depends on your use-case, take this two examples of forms: a login form - almost all login forms have the same structure, username/email, password, a keep me logged in checkbox, and a login button; a LoginForm component doesn't need to be further customised in regards to its structure so it's suitable to be used as is a signup form - now depending on context you might give more or less fields to the user to complete when signing up, and in this case you use props.children
upvote count: 1
answers question: http://stackoverflow.com/q/29816073
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/29739914
has title: How do I render an array using javascript?
tagged with: arrays
has body: I am currently building a replication of Atari's breakout for university. I currently have a working ball, a paddle and (potentially) some bricks. At the minute, the bricks are rendering incorrectly as the canvas remains blank at run-time. Could anyone please tell me where I'm going wrong (either with the 'bricks' variable or with the bricks section of the render function). The code is below: var canvas = document.getElementById("breakout"); var ctx = canvas.getContext("2d"); var PADDLE_WIDTH_PX = canvas.width / 5; var PADDLE_HEIGHT_PX = 10; var PADDLE_SPEED = 450; var ball = { x: canvas.width / 2, //pixels y: canvas.height / 2, //pixels xSpeed: 500, //pixels per second ySpeed: 500, //pixels per second radius: 100 //pixels } var paddle = { //radius: 5, /*speed: 500, TopRight: ctx.moveTo(canvas.width / 1.35, canvas.height - (canvas.height / 12.5)), TopSide: ctx.lineTo(canvas.width / 2, canvas.height - (canvas.height / 12.5)), RightSide: ctx.lineTo(canvas.width / 1.35, canvas.height - (canvas.height / 27.5)), BottomLeft: ctx.moveTo(canvas.width / 2, canvas.height - (canvas.height / 27.5)), LeftSide: ctx.lineTo(canvas.width / 2, canvas.height - (canvas.height / 12.5)), BottomSide: ctx.lineTo(canvas.width / 1.35, canvas.height - (canvas.height / 27.5))*/ xSpeed: 450, x: (canvas.width - PADDLE_WIDTH_PX) / 2, y: canvas.height - PADDLE_HEIGHT_PX } var Brick = function() { canvas.width / 30 = x; canvas.height / 50 = y; var bricks(750); var location_X(750); var location_Y(750); for (int b = 0; b &lt;= 749; b++) { if (b == 0) { location_X[b] = 0; location_Y[b] = 0; } if (b != 0) { while (b &lt;= 29) { location_X[b] = (location_X[b - 1]) + Brick.x; } while (b &lt;= 49) { location_Y[b] = (location_Y[b - 1]) + Brick.y; } } switch (b % 10) { case 0: bricks[b] = firebrick; break; case 1: bricks[b] = gold; break; case 2: bricks[b] = yellow; break; case 3: bricks[b] = green; break; case 4: bricks[b] = fuschia; break; case 6: bricks[b] = palevioletred; break; case 7: bricks[b] = gold…
tagged with: javascript
upvote count: 3
has answer: http://stackoverflow.com/a/30039915
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47613477
score: 3
downvote count: 0
tagged with: rendering
type: Question
tagged with: canvas

http://stackoverflow.com/q/29695082
has answer: http://stackoverflow.com/a/29738763
score: 15
linked to: http://stackoverflow.com/q/7808110
type: Question
upvote count: 15
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: css-position
has title: Mobile web: -webkit-overflow-scrolling: touch conflicts with position:fixed
accepted answer: http://stackoverflow.com/a/29738763
linked to: http://stackoverflow.com/q/8110580
tagged with: scroll
linked to: http://stackoverflow.com/q/7357818
tagged with: css
has body: I use position: fixed to create a fixed top navigation menu on my mobile web application. After adding -webkit-overflow-scrolling: touch, the scrolling works smoothly. However, the top menu disappears during scrolling. It shows only after the scrolling stops. I have searched many solutions, such as CSS3 property webkit-overflow-scrolling:touch ERROR and iOS5 Images disappear when scrolling with webkit-overflow-scrolling: touch. However, the given solutions are not working for me. Please check out this example: http://jsbin.com/woxuwihuzu/12/ (visited from iPhone 5c Chrome/Firefox). Did I miss anything?
type: AnsweredQuestion

http://stackoverflow.com/comment/47682905
type: QuestionComment
comment on: http://stackoverflow.com/q/29776072
has text: @Fallenreaper Even if there was an overload of `indexOf` that worked like this, internally it would have to iterate over the second array. With regard to efficiency, in your case there are still 2 arrays that have to be looped over...
score: 0
type: Comment

http://stackoverflow.com/comment/47628079
type: AnswerComment
has text: Cannot comment on performance, I strongly doubt there would be any major difference, and it probably doesn't matter. Yes, it's more compact, obviously.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29747075

http://stackoverflow.com/comment/47782587
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29806521
type: Comment
has text: Yep, each time the filter changes, I do a new AJAX call, and recreate them all. But, this might not be the most optimized way to do, I'm open to anything ...

http://stackoverflow.com/q/29786097
type: Question
tagged with: font-size
has title: context.font = "...px Font Name"
score: 0
has body: Lets take: context.font = "80px Georgia"; What I want is a way replaces the 80px with (window.innerWidth-window.innerHeight) or something else so that the size of your font adjusts to the size of your window height/length... Is there a way to do something like this?
accepted answer: http://stackoverflow.com/a/29786156
answer count: 1
tagged with: javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29786156

http://stackoverflow.com/q/29817771
has body: I have a controller which initializes my value as such: $scope.showThing=true; I toggle the value with ng-click like ng-click="showThing=!showThing" which works ok but then if I try using the same value in a function inside the controller it behaves irrational, to say the least. Something as simple as alerting the value in an interval function only gets the right value the first time it iterates after changing the value, sometimes not even that. Since it's something so trivial I wouldn't want to create a factory for this alone, so I hope there's someone who can tell me what am I doing wrong here.
has comment: http://stackoverflow.com/comment/47763194
has comment: http://stackoverflow.com/comment/47768430
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29818066
has answer: http://stackoverflow.com/a/29821105
has title: Variable on scope doesn't keep the value changed in a function
type: Question
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47762809

http://stackoverflow.com/comment/47665076
score: 0
type: Comment
type: QuestionComment
has text: Recursion or loop for handling db operations are always a bad idea.
comment on: http://stackoverflow.com/q/29766415

http://stackoverflow.com/q/29734467
has comment: http://stackoverflow.com/comment/47610501
has answer: http://stackoverflow.com/a/29739649
accepted answer: http://stackoverflow.com/a/29739649
type: Question
has comment: http://stackoverflow.com/comment/47610382
tagged with: javascript
has body: I am modifying an interactive chart made by Matthew Weber (link here) and I keep running into the error that my data is not defined when I'm trying to create a unique key to bind the data to the graph. I keep getting the error TypeError: data is undefined I think the problem stems from the fact that I'm using numeric values (age) as the x axis as opposed to a parsed date from his example, but I can't figure out what to change in order to fix it. I have also declared the data variable in a couple of lines above it and d3 seems not to recognize it. My code is below. Code snippet: (the error occurs starting with "color.domain") var menu = d3.select("#menu select") .on("change", change); //suck in the data, store it in a value called formatted, run the redraw function // ***** d3.csv("data.csv", function(data) { formatted = data; redraw(); }); d3.select(window) .on("keydown", function() { altKey = d3.event.altKey; }) .on("keyup", function() { altKey = false; }); var altKey; // set terms of transition that will take place // when a new economic indicator is chosen function change() { d3.transition() .duration(altKey ? 7500 : 1500) .each(redraw); } // all the meat goes in the redraw function function redraw() { // create data nests based on economic indicator (series) // ***** var nested = d3.nest() .key(function(d) { return d.dma; }) .map(formatted) // get value from menu selection // the option values are set in HTML and correspond //to the [type] value we used to nest the data var series = menu.property("value"); // only retrieve data from the selected series, using the nest we just created var data = nested[series]; // for object constancy we will need to set "keys", one for each type of data (column name) exclude all others. // ***** color.domain(d3.keys(data[0]).filter(function(key) { return (key !== "age" &amp;&amp; key !== "dma"); })); // ***** var linedata = color.domain().map(function(name) { return {name: name, values: data.map(function(d) { return {name:name, …
has comment: http://stackoverflow.com/comment/47609899
has comment: http://stackoverflow.com/comment/47610935
has comment: http://stackoverflow.com/comment/47610189
upvote count: 1
has title: data not defined d3 for object type
has comment: http://stackoverflow.com/comment/47609715
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47610420
has comment: http://stackoverflow.com/comment/47610293
tagged with: d3.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47610213
has comment: http://stackoverflow.com/comment/47611848
downvote count: 0
score: 1

http://stackoverflow.com/a/29760585
has comment: http://stackoverflow.com/comment/47653451
answers question: http://stackoverflow.com/q/29760408
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47656722
has body: the ?:X pattern is a match but do not capture instruction in JavaScript, so we see the following pattern: (?:/)(.*?)(?:/)$ translating to: (?:/) match / (somewhere), but do not capture (.*?) match as many characters as the rest of the pattern allows (?:/)$ match / followed by end of string, but do not capture So, the first / is matched and prompty forgotten, then we match set (2) which tries a non-greedy match for "any character" that is followed by (?:/)$. Since the final part matches only the slash at the end of your input string, we find and ignore the first and last /, which leaves us with 1000/2000. If you wanted 1000 instead, then there isn't really a reason to bother with regexp at all: // get some input var s = "/1000/2000/"; // split on slashes var t = s.split('/'); // filter out empties t = t.filter(function(a) { return !!a ; }); // convert to ints, because why not. Note that even regexp will // yield strings, so you still have to do this if you do use regexp. t = t.mapfunction(a) { return parseInt(a,10); }); // results are.... console.log(t.join(", ")); // =&gt; "1000, 2000" If you're looking for "things between slashes", just look for things that are not slashes: "/1000/2000/".match(/([^\/]+)/g) // =&gt; Array [ "1000", "2000" ]
has comment: http://stackoverflow.com/comment/47653490
downvote count: 0

http://stackoverflow.com/q/29751340
has answer: http://stackoverflow.com/a/30289646
tagged with: printing
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47634950
has comment: http://stackoverflow.com/comment/47634723
score: -1
has comment: http://stackoverflow.com/comment/47635297
has comment: http://stackoverflow.com/comment/47634821
downvote count: 2
upvote count: 1
has title: How to print always 4 digits on Javascript?
type: Question
linked to: http://stackoverflow.com/q/610406
has body: I'm writing a javascript who is supposed to just print on a raw web-page and I'm finding some formatting problems. I would like to know if there's a way to do something like printf("%4d",num) in Javascript, because I always need to print a number considering it with 4 digits. It would be something like that: Year 1 Instead of: Year 1
tagged with: javascript

http://stackoverflow.com/comment/47651697
type: AnswerComment
comment on: http://stackoverflow.com/a/29759496
type: Comment
has text: yes, that is exactly how I want it! -- except blue-toggle has to be active by default on loading the page. I'm aware the example doesn't show buttons but I've modified it to use buttons, I just used the existing jfiddle as the example cos it was already there. apologies if that was confusing!
score: 0

http://stackoverflow.com/a/29703649
downvote count: 0
score: 3
type: Answer
upvote count: 3
has body: You can add the string to window.location.search instead, for a more general solution. if (location.origin + location.pathname === 'your url here') { location.search += 'additional data here'; } The advantage of this approach is that you can apply this code to multiple pages with less changes to the same code. Note that this will cause a page reload, which might not be optimal to user experience. Since you said you are doing this for tracking, you can instead ping the page by appending an image with the new url to DOM. Something like this: var pinger = new Image(0,0); // keep the size of the image 0 pinger.src = 'changed url here, with the new query param appended'; document.body.appendChild(pinger); // ping sent pinger.parentNode.removeChild(pinger); // remove the node when ping is sent Hope that helps :)
answers question: http://stackoverflow.com/q/29703078

http://stackoverflow.com/comment/47768499
has text: set datatype json for ajax call
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29820749
type: QuestionComment

http://stackoverflow.com/q/29816309
has comment: http://stackoverflow.com/comment/47759869
tagged with: javascript
has comment: http://stackoverflow.com/comment/47759890
has body: My string is: "@john @jerry @kerry hello world" My goal is to obtain an array: ["john","jerry","kerry", "hello world"]; Infact @ is the marker for username and the last array item is the rest of the string. Any idea ?
score: 0
has answer: http://stackoverflow.com/a/29816371
linked to: http://stackoverflow.com/q/9665279
type: UnansweredQuestion
has title: how to parse a JS usernames?
has comment: http://stackoverflow.com/comment/47759846
tagged with: regex
has answer: http://stackoverflow.com/a/29816549
type: Question
answer count: 2

http://stackoverflow.com/a/29766285
type: Answer
has body: Option 1: You would take the PHP variable and replace the asterisk (*) with a percentage sign (%): &lt;?php $name = $_POST['name']; // remember to sanitize it $name = str_replace('*', '%', $name); ?&gt; You would then create a MySQL query using your variable: $query = "SELECT * FROM table WHERE column LIKE '$name'"; Option 2: Use a MySQL date query: $query = "SELECT * FROM table WHERE YEAR(column) = '2008'"; Note that column should be a date or a datetime type. You should add contextual help for users or even dropdowns with possible options, so they don't search for '20081', for example.
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29765991
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29765991
has comment: http://stackoverflow.com/comment/47665671

http://stackoverflow.com/a/29817735
has body: You could do it like this: body { margin: 0; padding: 0; background-color: black;} #top { background-color: red; width: 100%; height: 100px; } #nav { background-color: blue; width: 100%; height: 50px; } #content { background-color: green; width: 400px; height: 500px; margin: 0 auto;} #footer { background-color: purple; width: 100%; height: 50px; } Or you could add position: absolute; to the img style="" and then play around with the margin/padding.
score: 0
answers question: http://stackoverflow.com/q/29817246
type: Answer

http://stackoverflow.com/q/29721585
tagged with: css
answer count: 0
upvote count: 1
linked to: http://stackoverflow.com/q/2427447
has body: I have a rotator that contains text and buttons. The buttons (anchor tags) do not work for mobile devices. I have read similar posts, and the solutions to their questions did not work for me. I made sure my html was valid, and without errors. I also inserted the following jQuery, but was unsuccessful. There is a hover effect on the button, and when tapped on a mobile device the hover effect occurs. I'm assuming there is some kind of conflict between the hover and click, but I'm not sure how to 'override' the hover?? $(function () { $('a').on('click touchend', function() { var link = $(this).attr('href'); window.open(link,'_blank'); // opens in new window as requested return false; // prevent anchor click }); }); This script is working correctly, but still does not work for mobile devices on my page. PS I am not using jQuery Mobile, and would like to avoid using it if possible.
type: Question
has comment: http://stackoverflow.com/comment/47585324
tagged with: javascript
has comment: http://stackoverflow.com/comment/47577979
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47580017
linked to: http://stackoverflow.com/q/8291517
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47579516
tagged with: http://stackoverflow.com/tag/html
has title: My anchor tag is not working on mobile devices with hover effect
has comment: http://stackoverflow.com/comment/47581189

http://stackoverflow.com/a/55648645
type: Answer
score: 19
upvote count: 19
answers question: http://stackoverflow.com/q/29770969
downvote count: 0
has comment: http://stackoverflow.com/comment/99974161
has comment: http://stackoverflow.com/comment/100007299
has comment: http://stackoverflow.com/comment/139469138
has body: Setup "slidesToScroll" property to a negative value (e.g slidesToScroll: -1,) is not a native solution. This produced images smooth flow problem. The right way is to add an attribute dir="ltr" to the slider's container (HTML element) OR add rtl: false property to slider settings: // add an attribute dir="ltr" to the slider's container //$('.slider').attr('dir', 'ltr'); // OR add `rtl: false` property to slider settings $('.slider').slick({ autoplay: true, slidesToShow: 3, slidesToScroll: 3, dots: true, infinite: true, cssEase: 'linear', rtl: false }); Note: This will reverse text direction also which can be changed by the CSS direction: ltr; JS Fiddle Example

http://stackoverflow.com/comment/47712518
type: Comment
has text: @TrueBlueAussie the problem with h3 is, there is no definition on which content has to be wrapped in h3
comment on: http://stackoverflow.com/a/29791684
score: 0
type: AnswerComment

http://stackoverflow.com/q/29719630
score: 4
has answer: http://stackoverflow.com/a/29719665
upvote count: 4
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: callback
tagged with: jquery-callback
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29719665
has body: I am trying to replicate a type-writer effect on a resume page of mine, and have if working except for one part: while (i &lt; tags.length) { type(tags[i], content[i], 0, 50); i++; } This is the function that writes out the lines, and it works correctly, except for the fact that it writes all of the lines at once. I would like for it to write a single line, then move on to the next, and so on and so forth. I know the solution lies in adding a callback function in but I can't seem to get it to work right. Any help/advice would be appreciated. Thanks! Also, here is the full jsfiddle.
favorite count: 0
type: Question
answer count: 1
has title: Adding callback to javascript while loop

http://stackoverflow.com/comment/47564370
comment on: http://stackoverflow.com/q/29702412
score: 0
type: Comment
type: QuestionComment
has text: @atmd I want to allow people to enter only strings matching specified regex.

http://stackoverflow.com/q/29787056
accepted answer: http://stackoverflow.com/a/29787135
type: AnsweredQuestion
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/29787135
tagged with: http://stackoverflow.com/tag/html
has title: how to set default button Html javascript
score: 2
upvote count: 2
has body: I have 2 buttons in one form: My JavaScript: $("#txtSearch").keyup(function (event) { if (event.keyCode == 13) { $("#btnSearch").click(); } }); $("#_searchKeyword").keyup(function (event) { if (event.keyCode == 13) { $("#btnSearchNoResult").click(); } }); if I type on _searchKeyword input text, and then press Enter button, I get the value of txtSearch input text. How can I get the value of _searchKeyword input text with enter press not value of txtSearch?

http://stackoverflow.com/comment/47708540
type: QuestionComment
has text: there is no such difference, it's upto you
comment on: http://stackoverflow.com/q/29789747
score: 0
type: Comment

http://stackoverflow.com/q/29696302
has answer: http://stackoverflow.com/a/29696781
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/47529140
possible better answer: http://stackoverflow.com/a/43592786
answer count: 3
accepted answer: http://stackoverflow.com/a/29696680
has answer: http://stackoverflow.com/a/43592786
has comment: http://stackoverflow.com/comment/47528930
has comment: http://stackoverflow.com/comment/47529357
tagged with: javascript
tagged with: jquery
tagged with: ajax
has title: sortable not working in after ajax append
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: hey everyone i have 2 view 1- index 2- Edit in index i have button and ajax i click the button pass id to controller its return a view so i append this view in a div. Edit view have sortable divs. after append a edit view sortable is not working.. i dont understand why. please help me.. here is my index view with ajax Configure TradeLane function getPage(page) { $('#loaderImg').modal('show') var hdnHeaderText = $('#hdnHeader').val(); $('#spnHeader').text(hdnHeaderText); if (hdnHeaderText == 'Codes') { $('#backBtnDiv').hide(); } else { $('#backBtnDiv').show(); } $.ajax({ type: "POST", url: page, xhrFields: { withCredentials: true }, success: function (html) { $('#CarrierList').empty(); $('#CarrierList').append($.parseHTML(html)); }, error: function () { var error = "Error occured during loading Carrier items..."; $('#errorMessage').empty(); $('#errorMessage').append(error); $('#errorModal').modal('show'); }, complete: function () { $('#loaderImg').modal('hide'); } }); } here is edit view with sortable + jquery functions @for (int i = 0; i < Model.items.Count; i++) { if (Model.items.ElementAt(i).legindex == null) { test } } @for (int i = 0; i < Model.items.Count; i++) { if (Model.items.ElementAt(i).legindex != null) { test } } edit view ajax $(function () { $("#sortable").sortable({ connectWith: ".connectedSortable", cursor: "move", stop: function (event, ui) { var ChildIdsArray, SpanIdsArray, ChildId, Divid, SpanID, SpanText; ChildIDsArray = $("#sortable > div").map(function () { return this.id }); for (var i = 0; i < ChildIDsArray.length; i++) { ChildId = ChildIDsArray[i]; SpanIdsArray = $("#" + ChildId + "> span").map(function () { return this.id }); } } }).disableSelection(); $("#sortable2").sortable({ connectWith: ".connectedSortable", handle: "span", cursor: "move", stop: function (event, ui) { } }).enableSelection(); });
has answer: http://stackoverflow.com/a/29696680
type: Question
has comment: http://stackoverflow.com/comment/47528712
score: 0

http://stackoverflow.com/comment/47761126
score: 0
has text: But @DelightedD0D I have to also increment the div id
type: Comment
comment on: http://stackoverflow.com/a/29816657
type: AnswerComment

http://stackoverflow.com/a/29750160
has comment: http://stackoverflow.com/comment/47635394
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47635052
has comment: http://stackoverflow.com/comment/47635433
has comment: http://stackoverflow.com/comment/47634960
has body: The problem with your fiddle is the margin-top:-30px in a.toolTipA span is moving the tooltip for the top link out of the viewport. You either need to start your items at least that far down the page, or remove that line from the css. According to this previous stackoverflow post, setting position:fixed will keep your elements in the viewport.
type: Answer
has comment: http://stackoverflow.com/comment/47635616
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47634636
accepted answer of: http://stackoverflow.com/q/29749963
has comment: http://stackoverflow.com/comment/47635228
upvote count: 2
answers question: http://stackoverflow.com/q/29749963

http://stackoverflow.com/a/29749512
has body: As can be read here angular.copy() performs a deep copy (cf. "clone") of the argument - essentially creating a new object - whereas using the assignment operator = just assigns reference's. Thus in the latter case, if you we're to change something in $scope.master you would also change context. Cheers,
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/52737704
upvote count: 49
score: 49
accepted answer of: http://stackoverflow.com/q/29749433
answers question: http://stackoverflow.com/q/29749433

http://stackoverflow.com/comment/47769334
type: QuestionComment
score: 2
has text: Well, I noticed you set the cookie `success` to the value `success`, use `.indexOf` on `document.cookie` and check if it's there (!== -1), based on that start the modal
comment on: http://stackoverflow.com/q/29821570
type: Comment

http://stackoverflow.com/comment/47744053
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29784648
type: Comment
has text: @McSheehy Firstly just to be clear, this is Goggle Sheets and Javascript I helped you with. Not excel and VBA. While some formulas translate from excel to google. I'm not sure VBA translates direct to Javascript. If you want to learn basic Javascript, try codeacademy.com

http://stackoverflow.com/a/29755086
answers question: http://stackoverflow.com/q/29753380
downvote count: 0
type: Answer
has body: points: &lt;%= getJson() %> This outputs whatever the return result type is, so for example: points: 8 // getJson() returns int points: test // getJson() returns a string if you had done: points = "[1,2,3,4,5,6,7,8],"; return points: the result would be: points = [1,2,3,4,5,6,7,8], However you have: var publicationTable = new List&lt;object&gt; { new { points = "[1,2,3,4,5,6,7,8]," } }; return (new JavaScriptSerializer()).Serialize(publicationTable); So to determine the output, step through each outer to inner method/object. Step 1: Serialization - Creates an empty string. "" Step 2: Serialize List&lt;Object&gt; (basically a JavaScript array) "[]" Step 3: Serialize first anonymous Object: "[{}]" Step 4: Serialize first property : "[{"points" : "[1,2,3,4,5,6,7,8],", }]" No more properties, no more objects, serialization finished. This is not the JSON you were looking for.
score: 1
upvote count: 1

http://stackoverflow.com/q/29765640
tagged with: angularjs
has answer: http://stackoverflow.com/a/29765791
type: UnansweredQuestion
has title: Using angular variables inside controller depending on path
has comment: http://stackoverflow.com/comment/47662655
answer count: 4
has answer: http://stackoverflow.com/a/29765759
tagged with: angularjs-scope
type: Question
has answer: http://stackoverflow.com/a/29765675
tagged with: javascript
has answer: http://stackoverflow.com/a/29765686
score: 0
has body: i want to use the same controller fo two different tables..only difference is one variable.. if($location.path() == '/type_user') { $scope.varName = 'User'; $scope.pathTo = '/users'; $scope.objName = 'users'; }else if($location.path() == '/type_user_params') { $scope.varName = 'Param'; $scope.pathTo = '/params'; $scope.objName = 'params'; } and then use it in a function like so: $scope.objName.splice($scope.objName .indexOf(xxx),1); or: $scope.objName.push($scope.inserted); but i am getting $scope.objName.push is not a function
has comment: http://stackoverflow.com/comment/47662675

http://stackoverflow.com/q/29842469
has body: I need to repeat through some list that is present in variable "tab.excelFields". I have been successfully able to do that, simple ng-repeat. The code is shown below: &lt;tr&gt; &lt;th ng-repeat="field in tab.excelFields" class="btn btn-danger" style="display:table-cell;" id="{{id}}"&gt;{{field}}&lt;/th&gt; &lt;/tr&gt; Notice {{id}} field. I need to put in unique values here...1,2,3 and so on Question: How do I add unique id to each of these fields that I am displaying? Something like "id in [1,2,3]" in conjunction with my code. Two problems:- How to give "id in [1,2,3]" with "field in tab.excelFields" in ng-repeat? Can it take two arguments? My fields are not restricted to any fixed number. It can be one or one thousand. How to dynamically create a counter and add to this for "id" field?
tagged with: javascript
has answer: http://stackoverflow.com/a/29842506
type: Question
has title: Unique Identifier For Elements of a List Parsed By ng-repeat in AngularJS
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29842506
tagged with: angularjs-ng-repeat
upvote count: 1
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/47746464
type: AnswerComment
has text: PHP will get saved to a database and may run when serving the page if not stripped out. Possible answer here? http://stackoverflow.com/questions/13023157/use-media-query-inline-style
type: Comment
comment on: http://stackoverflow.com/a/29809030
score: 1

http://stackoverflow.com/comment/47583317
comment on: http://stackoverflow.com/a/29724164
has text: No, I was wanting it to fire on page load. Ive got it working now as a form and setting my value as a hidden input element and submitting it with javascript on page load, but because it essentially reloads and then fires the onsubmit again its just looping constantly. Any way around that? I did document.forms['myForm'].submit()
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29793242
answers question: http://stackoverflow.com/q/29793026
has body: Take a look at this post: Decode &amp;amp; back to &amp; in JavaScript basically it says you have two options (before parsing your json): 1.) You want to replace the amp only: var decoded = data.replace(/&amp;amp;/g, '&amp;'); 2.) You want to decode HTML characters: var div = document.createElement('div'); div.innerHTML = data; var decoded = div.firstChild.nodeValue;
score: 0
type: Answer

http://stackoverflow.com/comment/47793100
comment on: http://stackoverflow.com/q/29832553
score: 0
type: QuestionComment
type: Comment
has text: Are you talking about tabs or accordions?

http://stackoverflow.com/q/29830497
downvote count: 0
tagged with: http://stackoverflow.com/tag/json
possible better answer: http://stackoverflow.com/a/29831270
has title: how to remove and edit the values in JSON Array using jquery
type: Question
has answer: http://stackoverflow.com/a/29831270
accepted answer: http://stackoverflow.com/a/29830848
tagged with: arrays
tagged with: javascript
score: 4
answer count: 2
has answer: http://stackoverflow.com/a/29830848
has comment: http://stackoverflow.com/comment/47788155
tagged with: jquery
favorite count: 0
upvote count: 4
has body: I have a json array this way, var simple = []; for (var i = 0; i &lt; 5; i++) { simple.push({ id: id, name: name, mobile: mobile }); } And the values from this json array is as below, [{id:1 name:"Test" mobile:100}, {id:2 name:"Test" mobile:200}, {id:3 name:"Temp" mobile:300}, {id:4 name:"Test" mobile:400}, {id:5 name:"Temp" mobile:500}] What i need to do is, I have to compare records in an json array based on "name" key. While comparing, if record1.name = record2.name then i have to remove entire record1 and append "mobile" value of record1 with record2 , this way. This is the final output expected. [{id:1 name:"Test" mobile:100,200,400}, {id:2 name:"Temp" mobile:300,500}] I tried removing this way. But not able to append the "mobile" key values with each other. var removeItem = name; alert('Array before removing the element = ' + simple); simple = jQuery.grep(simple, function(value) { return value != removeItem; }); alert('Array before removing the element = ' + simple); Can some one help me in this? Thanks Edit ====== I tried Answer#1=given by Ismail Kuruca given below, Its working fine with the existing keys I.E, If added new keys with the below input, var input = [{ id:1, name:"Test", ssn:1, mobile:100, address:"A" }, { id:2, name:"Test1", ssn:2, mobile:200, address:"B" }, { id:3, name:"Temp", ssn:3, mobile:300, address:"C" }, { id:4, name:"Test2", ssn:4, mobile:400, address:"D" }, { id:5, name:"Temp1", ssn:5, mobile:500, address:"E" }]; Its is giving same value of "name" to all the newly added keys , as below, here "ssn" should be equal to 1, but it is returning "name" value : "test" [{"id":1,"name":"Test","ssn":"Test","mobile":"100"},{"id":2,"name":"Test1","ssn":"Test1","mobile":"200"},{"id":3,"name":"Temp","ssn":"Temp","mobile":"300"},{"id":4,"name":"Test2","ssn":"Test2","mobile":"400"},{"id":5,"name":"Temp1","ssn":"Temp1","mobile":"500"}] I tried this way, //This part transforms your input to a map for each "name" attribute //Each key has a value of array o…
type: AnsweredQuestion

http://stackoverflow.com/comment/47579166
type: Comment
has text: In my case the correct answer is the secon situacion. There are any way to create DNS server directly in node.js?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29721875

http://stackoverflow.com/q/29690878
has answer: http://stackoverflow.com/a/29690912
type: Question
accepted answer: http://stackoverflow.com/a/29690912
tagged with: for-loop
tagged with: function
score: -2
tagged with: push
tagged with: javascript
has answer: http://stackoverflow.com/a/29690922
downvote count: 2
answer count: 3
favorite count: 0
has comment: http://stackoverflow.com/comment/47518274
possible better answer: http://stackoverflow.com/a/29690922
type: AnsweredQuestion
upvote count: 0
has body: I made a variable and added new values with the push attribute but when the for-loop calls it one-by-one it only prints the last value(name) that is "Pranav". Can you help me to know how to fix it and print all the values one-by-one. function tryme() { var names = new Array(); names.push("Bhavesh", "Ajay", "Rahul", "Vinod", "Bobby", "Pranav"); var tryit = document.getElementById("tryit"); for (i = 0; i &lt; names.length; i++) { tryit.innerHTML = "The values are " + names[i] + " . &lt;br&gt;" }; };
has title: my code only prints the last value of the array
has answer: http://stackoverflow.com/a/29690944

http://stackoverflow.com/comment/48293748
comment on: http://stackoverflow.com/q/29814583
score: 0
type: Comment
type: QuestionComment
has text: Thanks for both your replies Hamza Kubba & Wunth.

http://stackoverflow.com/q/29710966
type: Question
tagged with: transform
has body: I am looking for a workaround for a case where the width:auto CSS rule initially fails to apply, in Chrome, Safari and Opera. (There is no problem in the latest version of Firefox. Tested only on Mac so far.) First I will describe the symptoms, then I will describe the issue. The symptoms In a web page, I want an image to fill the window completely. When the visitor resizes the window, the image will maintain its proportions and expand or contract to fill either the full height or the full width. If you open this page in your browser, and then resize the window, you should see that the grey border of the image is always visible either at the sides of the window or at the top and bottom. The image has a width:height ratio of 2:1. The problem occurs if you load the page when your browser window has a width:height ratio of 2:1 or taller. To test, you can make the window square (1:1) and then reload the page. If you make the window taller, all works correctly, but if you make the window shorter, then the image becomes deformed: it turns into an oval. If you continue to make the window shorter, until its ration is 2:1 or wider, the problem disappears. Making the window wider than 2:1 before making it shorter does not solve the problem. The issue The basic principle is to use the CSS below, plus JavaScript that runs on window.onresize to toggle the class for the image depending on the ratio of the window's width and height compared to the image. html, body { height: 100%; margin: 0; } img.full-height { height:100%; width:auto; position: fixed; left: 50%; /* bring your own prefixes */ transform: translate(-50%, 0); } img.full-width { height:auto; width:100%; position: fixed; top: 50%; /* bring your own prefixes */ transform: translate(0, -50%); } This works fine in all browsers where I have tested it. However, in my case, I want to include a signature for the image in the bottom right corner of the window, and I also want to have this signature in the same parent `' as the…
has title: CSS selector height 100% and width:auto, first failing and then working correctly
answer count: 1
has answer: http://stackoverflow.com/a/29711066
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29711066
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/comment/80293955
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29786783
has text: I've started seeing this....however it is still possible to do the transaction. I think it should just be treated as a warning, rather than an error.

http://stackoverflow.com/a/29844983
type: AcceptedAnswer
upvote count: 5
answers question: http://stackoverflow.com/q/29844904
type: Answer
accepted answer of: http://stackoverflow.com/q/29844904
downvote count: 0
has body: This is due to Floating point arithmetic operations. You can round a float by using toFixed Update your code to window.onload = myFunction ; function myFunction(){ var i = 0 ; var counter = 1 ; while(i &lt; counter){ alert(counter); counter = (counter - 0.1).toFixed(1) ; } }
score: 5

http://stackoverflow.com/comment/47635185
type: Comment
type: QuestionComment
has text: A simple googling gives your answer. Did you check this? http://www.highcharts.com/plugin-registry/single/11/Grouped-Categories
score: 2
comment on: http://stackoverflow.com/q/29751372

http://stackoverflow.com/comment/47658217
has text: You realize all the LI's are ***display none***, and you can't see them but they are added just fine in your fiddle ?
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/29763281

http://stackoverflow.com/q/29788442
has comment: http://stackoverflow.com/comment/47706166
has title: Dynamically add text box in javascript
has answer: http://stackoverflow.com/a/29788562
tagged with: php
has body: I dynamically add a text box whenever a user clicks a button to add more, which works fine. However, in PHP when I get the submitted field values by $_POST['skills'] , I only receive the first text box value, not the dynamically added ones. I'm almost positive there is something wrong with the way I am adding the text boxes in javascript. I use the following method to add a text box field: function addTextBoxField() { var input = document.createElement('input'); input.type = "text"; input.name = "skills[]"; input.size = "30"; var container = document.getElementById("skillfield"); container.appendChild(input); } The HTML code I have for the text box is : ... + Add Here is the php code as well: if ($_SERVER["REQUEST_METHOD"] == "POST") { $allskills = $_POST['skills']; $size = count($_POST['skills']); print_r($allskills); } The output is the following, even though I inputted three values Array ( [0] => java )
has answer: http://stackoverflow.com/a/29788554
has answer: http://stackoverflow.com/a/29788581
has comment: http://stackoverflow.com/comment/47706204
has comment: http://stackoverflow.com/comment/47706243
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29788525
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29788574
answer count: 5
type: UnansweredQuestion

http://stackoverflow.com/a/29762942
answers question: http://stackoverflow.com/q/29762780
score: 2
downvote count: 0
has body: The library is treating / also as placeholders for the localization-specific separator. For de-DE, the common separator is . rather than /. If you would like to keep the slashes anyways, you can quote them to disable the substitution: console.log(Globalize.format(new Date(), "dd/MM/yyyy", "de-DE")); console.log(Globalize.format(new Date(), "dd'/'MM'/'yyyy", "de-DE"));
upvote count: 2
type: Answer

http://stackoverflow.com/comment/47783880
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29825126
has text: Execution failed: No item with the given ID could be found, or you do not have permission to access it. (line 164, file "utils") [1.622 seconds total runtime] I have emailed you all parts of the code buddy.

http://stackoverflow.com/comment/47767326
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29819473
type: AnswerComment
has text: I found a complete version.. I have now included both proj4js-combined.js and proj4js.js, now it sees everything apart the Proj4js.trasform function for which it says its not a function.. but that's another problem.. Thanks

http://stackoverflow.com/a/29763761
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/29763248
accepted answer of: http://stackoverflow.com/q/29763248
has body: i think this is what you wanted to do right ? $(document).ready(function () { var testimonialItem = $(".testimonial-wrapper .testimonial-item"); var lengthOfItem = testimonialItem.length; var counter = 0; testimonialItem.hide(); setTimeout(function(){ startIteration(counter); }, 1000); function startIteration(counter) { testimonialItem.eq(counter).fadeIn('slow', function() { if(counter<=lengthOfItem){ setTimeout(function(){ testimonialItem.fadeOut('slow',function(){ if (counter == lengthOfItem) { counter = 0; }else{ counter++;} setTimeout(function(){ startIteration(counter);}, 500); });}, 2000); } }); } }); Testimonials Shaf/ Seo Hi Testimonials Shaje/ As Lorem Ipsum Simply Dummy text Lorem Ipsum Simply Dummy text Lorem Ipsum Simply Dummy text Lorem Ipsum Simply Dummy text
score: 2
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/29733323
accepted answer of: http://stackoverflow.com/q/29717040
type: Answer
has body: That's a tricky one, because you wouldn't need the basic working directory relative to your gulpfile, but rather relative to all your Sass components. Am I right that './resources/assets/sass/main.scss'is your main Sass file which you use by yourself? If so, I'd suggest importing bootstrap there: @import '../../../vendor/bower_components/bootstrap-sass/assets/stylesheets/_bootstrap'; At let Sass deal with the files, Sass is usually a lot better in handling relative URLs. Than I'd split up Sass and CSS files, bundling them later using a stream queue: var queue = require('streamqueue'); gulp.task('_sass', function() { return queue( // our CSS files gulp.src([ './vendor/bower_components/bootstrap-rating/bootstrap-rating.css', './vendor/bower_components/select2/select2.css'] ), // our Sass file, compiled to CSS gulp.src('./resources/assets/sass/main.scss') .pipe(sass()) ) // all the rest .pipe(concat('all.css')) .on('error', notify.onError(function (error) { return "Error: " + error.message; })) .pipe(gulp.dest('./public/css/')) .pipe(reload({stream: true})); });
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29717040

http://stackoverflow.com/comment/47575025
type: QuestionComment
comment on: http://stackoverflow.com/q/29718887
has text: Shouldn't it be 'on' and not 'one' ?
score: 0
type: Comment

http://stackoverflow.com/q/29700486
tagged with: jquery
has title: Uncaught TypeError: Cannot read property -- JQUERY for Stripe API
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: stripe-payments
accepted answer: http://stackoverflow.com/a/29700635
has body: I am trying to integrate a payment gateway on a webpage using the stripe API. I am referring to this code snippet HERE. I am having trouble with loading JQUERY and kind of been struggling for some time to get it working. I am getting this error Uncaught TypeError: Cannot read property 'addMethod' of undefined I think the problem is because of not loading the jquery properly but not sure where its going wrong. code Payment Details CARD NUMBER EXPIRATION DATE CV CODE COUPON CODE Start Subscription
type: AnsweredQuestion
score: 0
type: Question
has answer: http://stackoverflow.com/a/29700635
tagged with: javascript

http://stackoverflow.com/comment/47781245
type: QuestionComment
score: 0
has text: adeneo that does not do what I asked for urgh.. -___- Samuel Edwin Ward it's clearly written in the title!.
comment on: http://stackoverflow.com/q/29827005
type: Comment

http://stackoverflow.com/q/29820095
upvote count: 2
type: UnansweredQuestion
tagged with: embed
score: 2
has answer: http://stackoverflow.com/a/30112559
type: Question
has title: Dynamically set height of embedded pdf
tagged with: javascript
tagged with: http://stackoverflow.com/tag/pdf
answer count: 1
downvote count: 0
tagged with: jquery
tagged with: height
has body: I managed to dynamically set the height of my embed element that contains a pdf. Using jQuery to set the new height. But I don't have the feeling I have used the best 'solution'. Old height = height set in the html New height = New calculated height set with jQuery I came across a problem: My embed element had an old height of 200px. When I tried to overwrite it with the new height the embed element did change to the new height but the PDF height stayed at 200px. But when I set the old height much higher, 5000px, the pdf reacted correctly to the new height. Short version: New embed height > old embed height = pdf height stays at old embed height New embed height < old embed height = pdf height is correct My current code looks like this: <embed id="embed_pdf" type='application/pdf' src="/files/<?=$var['filename']?>" data-width="<?=$var['image_width']?>" data-height="<?=$var['image_height']?>" style="max-width:<?=$var['image_width']?>px;" width="100%" height="<?=$var['image_height']?>"/> Error message And my 'script' code: $(document).ready(function() { var pdf_width = $("#embed_pdf").attr("data-width"); var pdf_height = $("#embed_pdf").attr("data-height"); var object_width = $("#embed_pdf").width(); var object_height = (object_width/pdf_width)*pdf_height; $("#embed_pdf").attr('height', object_height); }); At the moment it is working because the old height is always the same or higher than the new height. But is this a known or normal problem? Or am I doing something wrong? What might be a better solution?
favorite count: 0

http://stackoverflow.com/comment/47730403
comment on: http://stackoverflow.com/a/29731611
type: Comment
has text: yes I construct URL like using history.pushState. But still why this happens how to get rid of it. Thank you :)
score: 0
type: AnswerComment

http://stackoverflow.com/q/29739953
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/29741594
has comment: http://stackoverflow.com/comment/47616775
type: Question
has body: I am using this link in Facebook grap explorer and it works https://graph.facebook.com/v2.3/search?q=education?education&amp;type=page But I am trying to access the same data in the given below code without giving id because id gives an error of non existing feilds function Getpage() { FB.api("/search?q=education?education&amp;type=page", function (response) { }); } It does not work but same if I try accessing in that way it gives takes http/graph/facebook/ as id function Getpage() { FB.api(" /https://graph.facebook.com/v2.3/search?q=education?education&amp;type=page", function (response) { var i = 25; var g = response.data[i]; }); } It doesn't return the same data as in graph explorer the above link returns. I tried access token even but using javascript how should I get similar pages of same category? Like this the first link returns in graph explorer { "data": [ { "category": "Education", "name": "EducationUSA", "id": "72457958318" }, { "category": "Education", "category_list": [ { "id": "108051929285833", "name": "College &amp; University" }, { "id": "163917800330437", "name": "Admissions Training" }, { "id": "181053558607965", "name": "Youth Organization" } ], "name": "Education Diffusion", "id": "180364528818411" }, How to get their likes also?
tagged with: javascript
tagged with: facebook-like
score: -1
answer count: 1
downvote count: 1
tagged with: facebook-javascript-sdk
tagged with: facebook-graph-api
favorite count: 0
has title: Get similar pages by category and their likes using Facebook graph API
tagged with: facebook
accepted answer: http://stackoverflow.com/a/29741594

http://stackoverflow.com/comment/47658626
has text: i cant provide in url because i dont to do any operations here so only i cant provde anything in that. pls sreerejith give full code or fiddle example or give an instructions
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29763319
type: AnswerComment

http://stackoverflow.com/comment/47669702
type: AnswerComment
comment on: http://stackoverflow.com/a/29764394
score: 0
type: Comment
has text: can you share the link??

http://stackoverflow.com/comment/47760114
has text: I dont knw how to upload this file i am working on fire fox os.but i have seen this as a one solution so i am applying it.if you have any other solution then plzz suggest it.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29816343

http://stackoverflow.com/q/29696709
has comment: http://stackoverflow.com/comment/47529390
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47529466
score: 2
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47529468
has body: I already know that jQuery.data() is not the same that .attr(), and it doesn't update the actual HTML, but I'm using .data(key, value) and then I can't retrieve the updated changes with .data(key), which is weird because I've done that A LOT in the past. After a few hours with this, I am out of ideas. At first I was stringifying and parseing the object to JSON but then I read that Jquery automagically does that, so it was unnecessary and potentially damaging. HTML: &lt;div id="invitationsLooper" class="looper slide" data-looperdata="{}"&gt; (...stuff) &lt;div id="platform_selector"&gt; &lt;/div&gt; &lt;/div&gt; JS: &lt;script&gt; var $looper = jQuery("#invitationsLooper"); $looper.data("looperdata",{id:"invitationsLooper"}); console.log("Initializing looperdata: "+$looper.data("looperdata")); $looper.on("platform_reset", function (event) { //var $looper = jQuery("#invitationsLooper"); console.log("[Platform reset] event"); console.log($looper); console.log($looper.data("looperdata")); var looperdataobject = $looper.data("looperdata"); console.log(looperdataobject); looperdataobject.idplatform = null; $looper.data("looperdata", looperdataobject); console.log(looperdataobject); }); &lt;/script&gt; The event is launched on click by this line in another script: &lt;script&gt; jQuery("#platform_selector").trigger("platform_reset"); &lt;/script&gt; Firebug console output: Initializing looperdata: [object Object] -->platfom_reset event fired [Platform reset] event Object[div#invitationsLooper.looper.slide] null null TypeError: null has no properties looperdataobject.idplatform = null;
has comment: http://stackoverflow.com/comment/47530007
has comment: http://stackoverflow.com/comment/47529770
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/47529806
has comment: http://stackoverflow.com/comment/47529810
has answer: http://stackoverflow.com/a/29697681
has comment: http://stackoverflow.com/comment/47529446
has comment: http://stackoverflow.com/comment/47530249
type: Question
accepted answer: http://stackoverflow.com/a/29697681
has title: jQuery .data(key) not retrieving updated .data(key, value) data

http://stackoverflow.com/comment/47770182
score: 2
type: Comment
has text: Are you using any frameworks or just simple js + html?
type: QuestionComment
comment on: http://stackoverflow.com/q/29822033

http://stackoverflow.com/a/29840179
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/47806972
has body: Then add an hidden field like &lt;input class="form-control" name="uid" id="r_uid" value="111" type="hidden"&gt; then set the value of the hidden field before opening it $(function () { $("#Relation").dialog({ autoOpen: false }); $(".addRelation").on("click", function () { var uid = $(this).find('span').html(); $('#r_uid').val(uid) $("#Relation").dialog("open"); }); });
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29840093

http://stackoverflow.com/comment/47622327
score: 1
comment on: http://stackoverflow.com/q/29744638
has text: Hmm i'm not sure about this one. Maybe some combination of `$scope.$watch` and a timeout for calling the API could work.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47610366
comment on: http://stackoverflow.com/a/29738573
type: Comment
has text: You are correct, but then it adds the bottom again, so it will be 1091.
score: 0
type: AnswerComment

http://stackoverflow.com/q/29779492
favorite count: 0
tagged with: ajax
upvote count: 3
answer count: 3
has comment: http://stackoverflow.com/comment/47689041
tagged with: asynchronous
linked to: http://stackoverflow.com/q/14220321
possible better answer: http://stackoverflow.com/a/29779539
downvote count: 0
has body: The function below first performs a synchronous comparison test == 0, and if it passes, returns some content, and if it doesn't pass, performs an asynchronous request. My intent is for the later to return some other content such as "something from post callback", but know I am doing things way wrong. Without changing the Ajax request to synchronous, is it possible to do this? var value = function (test) { if (test == 0) { return 'value is zero '; } else { return $.post('/echo/html/', { html: 'false ', delay: .5 }, function (r1) { console.log('r1', r1); return 'something from post callback'; }) .done(function (r2) { console.log('r2', r2); return 'something from done callback'; }); } }(1); console.log(value); https://jsfiddle.net/o5kq8he6/2/
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29779541
has answer: http://stackoverflow.com/a/29779539
type: Question
has answer: http://stackoverflow.com/a/29779522
accepted answer: http://stackoverflow.com/a/29779522
has title: Return value from asynchronous OR synchronous JavaScript request
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/47540452
score: 0
has text: just to clarify a bit Ok allow me to clarify. this line $form.find('button').prop('disabled', false); disables the button after click, but it should only disable the button after a succesfully click, in other words after this function been executed function handleCall
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29700206

http://stackoverflow.com/comment/47737022
has text: I need the variables and the values of the constants, and I need them to be switchable. And they must be synced. These are my requirements. I'm looking for solutions to these specifically.
type: AnswerComment
comment on: http://stackoverflow.com/a/29804498
score: 0
type: Comment

keystroke
type: Tag
tags question: http://stackoverflow.com/q/29694815
tag name: keystroke

http://stackoverflow.com/comment/47684366
has text: `redraw()` needs to be called on `tweetMap`.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29776829
type: Comment

http://stackoverflow.com/comment/47743222
has text: This doesn't look right, `` why is there an `href` on a ``?
score: 1
type: Comment
comment on: http://stackoverflow.com/q/29807517
type: QuestionComment

http://stackoverflow.com/comment/47638820
score: 0
type: Comment
type: QuestionComment
has text: Changing it to img in the print.css still doesn't make any difference.
comment on: http://stackoverflow.com/q/29753151

http://stackoverflow.com/a/29774450
has body: Please see this fiddle: http://jsfiddle.net/8mdLz8tw/1/ Your index does not exist anymore, will grow to 3 and it will trow an error, also I have a made your code a bit different with an anonymous function. In the console you can see the switch and restart, since all the pictures are the same if you use lorempixel :) var slideimages = new Array() slideimages[0] = new Image() slideimages[0].src = "http://lorempixel.com/640/400/"//replaced pics for fiddle slideimages[1] = new Image() slideimages[1].src = "http://lorempixel.com/640/400/" slideimages[2] = new Image() slideimages[2].src = "http://lorempixel.com/640/400/" var step = 0; setInterval(function () { document.getElementById("Slide").src = slideimages[step].src; if (step &lt; 2) {//Here was your mistake, if you increase when it is exactly 2 your step will go to three and thus throw an error since you don't have an image indexed with three step++; console.log(step); console.log("switched"); } else { step = 0; console.log("restart"); } }, 2000);
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47680381
downvote count: 0
answers question: http://stackoverflow.com/q/29774030

http://stackoverflow.com/a/29701987
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29701921
downvote count: 1
has comment: http://stackoverflow.com/comment/47541539
has comment: http://stackoverflow.com/comment/47541116
score: 0
has body: {{categories}} 0"> some test text you could put the ng-if on the repeat but that seems unnecessary because it would go on all of them. To be clear, this answers your question. But is most likely not your problem. edit: try putting a $scope.$apply after your loop. for(var key in obj){ if(key!=="STATE/UT"&&key!=="DISTRICT"&&key!=="YEAR"){ $scope.categories.push(key); } } $scope.$apply();
has comment: http://stackoverflow.com/comment/47541494

http://stackoverflow.com/comment/47626423
score: 2
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29729644
has text: I think that, currently, it is not possible. It is just an image generated with text, so the font should be basically available on the reCaptcha server.

http://stackoverflow.com/comment/47685434
comment on: http://stackoverflow.com/q/29774838
has text: Don't forget to accept which ever answer you choose to be the best / most useful.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29796153
score: 2
has body: I need to a table to accomplish assign auth to users, so that I can check a cell to provide an auth to something to a user. the table should be like: when an user check the box, the color changes to indicator that he/she will have authorized to access that subject. The data now I use is like(The structure can be changed since I can control this): ["subject/user","user1","user2","user3","user4","user5"], ["subject1","X","X","√","√","√"], ["subject2","√","√","√","√","√"], ["subject3","√","√","√","√","√"], ["subject4","√","√","√","√","√"], ["subject5","√","√","√","√","√"] where the first array is the first row(title), and the rest represents they have the auth or not on a certain subject. I now accomplish this by dataTables with var titles = data.shift(); var columns = []; for(var i=0; i&lt;titles.length; i++){ columns.push({ "sTitle":titles[i], "class":"center" }); } ....// $("#authManageUserListTable").dataTable({ "aaData":data, "aaSorting": 0, "asc" , // disable default sort "aoColumns":columns, ....// "fnDrawCallback":function(oSettings){ $("#authManageUserListTable tbody td").each(function(){ if($(this).text() == "√"){ $(this).text(""); $(this).attr("isChecked",true); $(this).css("background-color","#2674A7"); }else if($(this).text() == "X"){ $(this).text(""); $(this).attr("isChecked",false); $(this).css("background-color","#aaaaaa"); } }); } ....// //and then $('#authManageUserListTable tbody').on( 'click', 'td', function () { if(isTrue($(this).attr("isChecked"))){ $(this).css("background-color","#aaaaaa"); $(this).attr("isChecked",false); } else if(isFalse($(this).attr("isChecked"))){ $(this).css("background-color","#2674A7"); $(this).attr("isChecked",true); } console.log(this); } ); But my concerns are : How can I get the new re-set data to represent the new auth after user manipulation. Something should be changed when I check/uncheck the cell? I need to add two button(span) to the the row besides all the user, representing "check all", "uncheck all" to i…
has comment: http://stackoverflow.com/comment/47721591
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/31720336
favorite count: 0
tagged with: datatables
has title: How to write a table with "checked" and "unchecked" cell easily?
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/a/29738176
answers question: http://stackoverflow.com/q/29738023
downvote count: 0
has comment: http://stackoverflow.com/comment/47609927
type: AcceptedAnswer
has body: It's not the timeout that's tripping you up, it's the infinite while loop. You're effectively creating thousands of timeouts every second. Moving the timeout outside of the infinite loop should solve your problem. function timedAction() { // your timed actions to be invoked every 5 seconds setTimeout(timedAction, 5000); // start the next timeout } setTimeout(timedAction, 5000); // start the first timeout while() { // your continuously executing actions } There is no need to clear a timeout after it expires. Alternatively you could also use setInterval, simplifying your code as follows: function timedAction() { // your timed actions to be invoked every 5 seconds } setInterval(timedAction, 5000); // start the interval while() { // your continuously executing actions }
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29738023

http://stackoverflow.com/comment/47666425
has text: Delegated events do not work for SVG?
comment on: http://stackoverflow.com/q/29767524
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47661315
type: Comment
comment on: http://stackoverflow.com/a/29759481
score: 0
type: AnswerComment
has text: @user3562812 — Yes. If you use dot notation to access a property then the property name has to be an identifier. Identifiers cannot start with a number. Bracket notation allows access to a much wider range of property names.

http://stackoverflow.com/comment/47635115
score: 1
comment on: http://stackoverflow.com/a/29751078
type: AnswerComment
type: Comment
has text: I don't think the term is defined at all. It's just used :-) But usually, *evaluate* refers to execution of already parsed code. See the [static semantic rules](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-static-semantic-rules): "*A conforming implementation must, prior to the first evaluation of a Script, validate all of the early error rules of the productions used to parse that Script. If any of the early error rules are violated the Script is invalid and cannot be evaluated.*".

http://stackoverflow.com/comment/47538484
type: QuestionComment
has text: Oh...the HTML is outputed twice because (1) you send it to the browser when you GET the page and then add it again with `status.innerHTML` after you make the AJAX call and POST to the same URL.
comment on: http://stackoverflow.com/q/29701216
score: 0
type: Comment

http://stackoverflow.com/comment/47537799
type: QuestionComment
score: 0
has text: True...I use it as a way of accessing my site. Then how do I allow other users to login.
comment on: http://stackoverflow.com/q/29700641
type: Comment

http://stackoverflow.com/a/29754821
has body: If you're able to get a handle on the cells index, then you can gets its value by using .val(), not .text().
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29754409

http://stackoverflow.com/a/29790757
upvote count: 5
has comment: http://stackoverflow.com/comment/47711116
accepted answer of: http://stackoverflow.com/q/29790604
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29790604
type: Answer
has comment: http://stackoverflow.com/comment/47710677
score: 5
has body: You can use HTML5 data method from where you can access the variable. suppose, your JS function is calling from a button. thus, you can define that button as: &lt;button class="btn" data-session="&lt;%= session[:note]%&gt;" onclick="seesionCheck()"&gt;Hello&lt;/button&gt; now, in your JS function you can access the variable as: $(".btn").data('session');

http://stackoverflow.com/a/29796344
answers question: http://stackoverflow.com/q/29796162
has body: test this code for(var i = 0; i &lt;= rows; i++) { row_data[i] = {}; row_data[i]['bold'] = jQuery('#bold' + i + '_val').val(); row_data[i]['italic'] = jQuery('#italic' + i + '_val').val(); row_data[i]['underline'] = jQuery('#underline' + i + '_val').val(); row_data[i]['align'] = jQuery('#align' + i + '_val').val(); row_data[i]['capitalize'] = jQuery('#capitalize' + i + '_val').val(); row_data[i]['curved'] = jQuery('#curved' + i + '_val').val(); row_data[i]['font'] = jQuery('#font' + i + '_val').val(); row_data[i]['font_size'] = jQuery('#fontsize' + i + '_val').val(); row_data[i]['abstand'] = jQuery('#abstand' + i + '_val').val(); row_data[i]['text'] = jQuery('#zeile' + i).val(); if (row_data.length &lt;1) alert("array is empty"); }
type: Answer
score: 0

http://stackoverflow.com/comment/84774198
score: 0
type: AnswerComment
type: Comment
has text: Agreed, `export ThingA from './ThingA'` is not valid syntax I think.
comment on: http://stackoverflow.com/a/31402500

http://stackoverflow.com/q/29772649
upvote count: 1
type: Question
has title: NaN comparison returns true?
has comment: http://stackoverflow.com/comment/47675814
tagged with: javascript
has answer: http://stackoverflow.com/a/29772933
has comment: http://stackoverflow.com/comment/47675857
answer count: 3
possible better answer: http://stackoverflow.com/a/29772702
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29772696
has answer: http://stackoverflow.com/a/29772702
tagged with: nan
has body: The last days I read how NaN always compares false even with itself and how to compare stuff when NaN may occur, and now I made a JS that compares two NaN true. WTF? Or did I compare 'NaN' strings? http://www.bksys.at/bernhard/JS-NaN-compare-true.html radioactivity calculator a: b: x:
favorite count: 0
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29772696

http://stackoverflow.com/comment/47608691
type: Comment
score: 1
has text: @jfriend00: Yeah, that's probably a better idea. I initially feared that `fs` methods might not work on a foreign `this` object, but that's unlikely. Edited my answer.
comment on: http://stackoverflow.com/a/29736070
type: AnswerComment

http://stackoverflow.com/comment/47601806
score: 0
type: QuestionComment
has text: It's just `window.innerWidth*window.innerHeight`.
comment on: http://stackoverflow.com/q/29734290
type: Comment

http://stackoverflow.com/comment/47566537
has text: That sounds like an idea! I wonder if there is really no way to set html content without it going through unwanted change though : /
type: AnswerComment
comment on: http://stackoverflow.com/a/29715744
score: 0
type: Comment

http://stackoverflow.com/a/29802858
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/29801893
type: AcceptedAnswer
downvote count: 0
has body: Thanks to skobaljic I was able to determine where the problem came from. In my config.js I had this block: CKEDITOR.stylesSet.add('default', [ // Block Styles { name: 'Subtitle', element: 'h3', styles: { 'color': '#aaa', 'font-style': 'italic' } }, // Object Styles { name: 'Small', element: 'font', attributes: { size: 3 } } ]); commenting that block out the editors all work as expected. I think in order to add those styles into each editor instance I'll have to use separate config files or something, but that goes out of scope for this question.
type: Answer
answers question: http://stackoverflow.com/q/29801893

http://stackoverflow.com/comment/48689032
has text: There is no direct way, as far as I know, But you can, using indirect methods. Wait.. I'll compose the script and update the answer.
type: Comment
comment on: http://stackoverflow.com/a/29793774
score: 0
type: AnswerComment

http://stackoverflow.com/q/29822330
has comment: http://stackoverflow.com/comment/47770965
downvote count: 0
tagged with: jquery
has body: have been struggling a bit with this. How can I determine whether my jquery accordion tab is opened or closed? Assignment Initiation Form content Flag potential candidates content was thinking along the lines of $(document).on("opened", #accordion3, function(){ var id = $(this).find("id"); $(id).removeClass("plus").addClass("minus"); }); I want to swop a class from 'plus' to 'minus' on opening of accordion and vice versa. help appreciated
favorite count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/29822536
type: Question
has answer: http://stackoverflow.com/a/29822504
tagged with: jquery-ui-accordion
has title: determing which tab has been opened and closed jquery accordion
tagged with: javascript
answer count: 2

http://stackoverflow.com/comment/47781400
comment on: http://stackoverflow.com/a/29825011
type: AnswerComment
has text: @kannanrbk Same reason you are? Cargo-cult programming? They don't care about readability? They hate the programmers that have to maintain their code? Don't know--you'd need to ask them.
type: Comment
score: 0

http://stackoverflow.com/comment/47549885
has text: I think it may be a difference in what they consider the default behavior of clicking on a radio button.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29707011

http://stackoverflow.com/q/29829003
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47784360
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47785304
tagged with: http://stackoverflow.com/tag/html
tagged with: node.js
answer count: 0
has body: I have several href links in my jade and each link is generated using a variable passed in by some variables. The code in jade is like this: each rows in meters li: a#myLink(href= "/meters/" + rows.meterID)= rows.metername So in my JavaScript part, I added a event listener to each link so that want to generate different pages according to the variables. So that I can add an event listener and emit that variable using socket like this: document.getElementById("myLink").addEventListener("click", function(){ document.getElementById("visualization").innerHTML = ""; socket.emit('building', window.location.pathname); }); Any help would be appreciated!
type: Question
has title: How to use variable in href and pass to click event function to javascript
has comment: http://stackoverflow.com/comment/47784416

http://stackoverflow.com/a/29844562
answers question: http://stackoverflow.com/q/29844179
type: Answer
score: 0
has body: The code can be written as : \uffff is directly interpreted as the desired string, and the whole sequence is realized as a single character var participant0 = { name : "", nickname : "", number: "99999" } ; var participant1 = { name : "bbb", nickname : "" } ; var participant2 = { name : "", nickname : "aaa" } ; var participant3 = { name : "ccc", nickname : "" } ; var array = [participant0, participant3, participant1, participant2]; console.log(array.sort(function(x,y) { var val1 = x.name || x.nickname || "\uffff"+x.number; var val2 = y.name || y.nickname || "\uffff"+y.number; return xname.localeCompare(val2); })) &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;

http://stackoverflow.com/comment/47547535
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29705717
type: QuestionComment
has text: I was going to say, if indeed it is only one at a time, then you can just populate that modal over and over again with your data. But OK, great. Hope it works out.

http://stackoverflow.com/comment/47665155
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29767004
has text: Usually it makes with `overflow: hidden` container, and variable `width` color block inside... Percent width becomes a progress value...
type: Comment

http://stackoverflow.com/a/29808913
has comment: http://stackoverflow.com/comment/47845999
score: 0
upvote count: 1
downvote count: 1
has body: In your manifest.json, you'll need to specify a custom Content Security Policy. In particular, for your example, you'll need to specify: "content_security_policy": "... script-src: http://connect.soundcloud.com/ ..." This will add connect.soundcloud.com to the whitelist of locations that your app is allowed to load scripts from. This is to help prevent Cross Site Scripting (XSS) attacks against your app. For more information about how CSP is applied to Chrome Apps, see https://developer.chrome.com/extensions/contentSecurityPolicy. For a more general overview of the very cool Content Security Policy technology, see http://www.html5rocks.com/en/tutorials/security/content-security-policy/.
has comment: http://stackoverflow.com/comment/53641801
answers question: http://stackoverflow.com/q/29733784
type: Answer

http://stackoverflow.com/a/69590637
answers question: http://stackoverflow.com/q/29816872
type: Answer
upvote count: 4
has body: Converts milliseconds to a string in the format hh:mm:ss. Here's my version: function HHMMSSFromMilliseconds(ms) { // 1- Convert to seconds: var seconds = ms / 1000; // 2- Extract hours: var hours = parseInt(seconds / 3600); // 3600 seconds in 1 hour seconds = parseInt(seconds % 3600); // extract the remaining seconds after extracting hours // 3- Extract minutes: var minutes = parseInt(seconds / 60); // 60 seconds in 1 minute // 4- Keep only seconds not extracted to minutes: seconds = parseInt(seconds % 60); // 5 - Format so it shows a leading zero if needed let hoursStr = ("00" + hours).slice(-2); let minutesStr = ("00" + minutes).slice(-2); let secondsStr = ("00" + seconds).slice(-2); return hoursStr + ":" + minutesStr + ":" + secondsStr } let timespan = 23570 * 1000; let formattedTime = HHMMSSFromMilliseconds(timespan); console.log(formattedTime);
downvote count: 0
score: 4

http://stackoverflow.com/comment/47805766
has text: Please add your code
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29839777
type: Comment

http://stackoverflow.com/comment/47792008
type: AnswerComment
comment on: http://stackoverflow.com/a/29832581
has text: You have to put it to `Application_BeginRequest` (for example). I've updated my code example above...
type: Comment
score: 0

http://stackoverflow.com/q/29766274
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47678850
favorite count: 0
tagged with: angularjs
linked to: http://stackoverflow.com/q/4709076
downvote count: 0
type: UnansweredQuestion
has title: How could I compress the HTML using angularjs while loading the template
has answer: http://stackoverflow.com/a/29766303
tagged with: php
type: Question
score: 1
answer count: 2
has answer: http://stackoverflow.com/a/29766321
has body: I want to optimize the page loading, using PHP and scripting language. Is there any way to compress the HTML which is being loaded from the template URL, so that based on that scenario I can achieve the goal?
upvote count: 1

http://stackoverflow.com/comment/47559778
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29712116
score: 0
has text: i would highly recommend providing the right `this` binding and additional arguments to the callbacks, they are very useful and without them, you can't do many of the things the "real" [].map() can do. you should also skip through sparse arrays like [].map() does.

http://stackoverflow.com/comment/47716825
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29793970
has text: I didn't make it "not useful" and for the sake of asking, I just tried it, but It didn't work. I also commented that line and still the same.

http://stackoverflow.com/comment/62222060
has text: Used this technique to send empty dates to the bottom of the list when sorting dates in ascending order. Brilliant solution, thank you kindly!
type: AnswerComment
comment on: http://stackoverflow.com/a/29829370
type: Comment
score: 3

http://stackoverflow.com/q/29780057
favorite count: 0
tagged with: angularjs
has body: I am using ui-select to create a complex page with multuple views. For those that don't know each view is loaded via ajax when a user selects a tab (or in my case a dropdown). Views traditionally have their own controller and html templet. Views inherrit the scope of the parent page they are on, but have their own child scope. In my case some of our views have no controller at all. They are so simple that we only have html pages for them. The problem is that I would like them to be able to toggle a boolean on a configuration object on the parent page's scope, to turn off on on some control fields on the parent page. Everything already exists, multiple pages use these views, I simply want to expand them to toggle something on the parent. I could do this in three ways. I could in my ui-router use the resolve method to explicitly toggle the field I want when the view is loaded, but then I have to do this in each ui-router for each page explicitly; no cool code-reuse. I could have my ui-router load a controller, where currently I have no controller, and the controller could do this. However, this means manually adding a controller that is mostly unneeded everywhere I use the view, and again doesn't feel like code reuse. Or I could use ng-init to have my view's explicitly set the value I want at load time. To me this feels cleanest and easiest, since I don't already have a controller. However, ng-init is frowned on, and should only be used for aliasing supposedly. Is there a cleaner approach then using the ng-init? is it really bad to have a view without a controller (to be more exact they have the parent controller still, but that isn't reloaded when a new view is opened).
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29784136
possible better answer: http://stackoverflow.com/a/29780225
upvote count: 1
has answer: http://stackoverflow.com/a/29780225
type: Question
score: 1
tagged with: ui-select
answer count: 2
has title: Is ng-init truely a bad way set variable in view without controller
downvote count: 0
has answer: http://stackoverflow.com/a/29784136
tagged with: javascript

http://stackoverflow.com/q/29833195
tagged with: google-analytics
tagged with: javascript
tagged with: privacy
answer count: 2
downvote count: 0
favorite count: 0
has body: I used Ghostery to find out what sites are sending info to Google Analytics using the ga.js script. I'm browsing in Firefox, and I wondered if there's a way of telling if they are turning on the anonymizeIp function or not.
has answer: http://stackoverflow.com/a/29839525
has answer: http://stackoverflow.com/a/50374418
has title: Is it possible to tell if a site is using anonymizeIp in ga.js script?
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/a/29805007
has body: Your angular.module('CBPWidget', []) block code is redefining angular app, which was flushing apiManufacturers service associated with it, &amp; it is defining controller in it. You should never do that, you should use existing module which was already defined. Code angular .module('CBPWidget') //don't overide app here use existing .controller('stepOneController', stepOneController);
type: Answer
answers question: http://stackoverflow.com/q/29804931
score: 0

http://stackoverflow.com/a/29845134
type: Answer
score: 2
upvote count: 2
has body: According to an answer on experts-exchange.com: in the window that opens the grandchild try: window.opener.w = window.open("newpage.htm"); now you can close the grandchild from the main window using w.close() So, the first child window assigns the variable to it's parent so the parent has reference to the grandchild.
downvote count: 0
answers question: http://stackoverflow.com/q/29844247

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/29706249
type: Tag
tags question: http://stackoverflow.com/q/29725608
tags question: http://stackoverflow.com/q/29794851

http://stackoverflow.com/comment/47526358
type: Comment
type: QuestionComment
score: 1
has text: create a fiddle for this
comment on: http://stackoverflow.com/q/29695073

http://stackoverflow.com/q/29818935
has comment: http://stackoverflow.com/comment/47764747
has title: How to make Google+ JavaScript tag pass W3C validiation
has answer: http://stackoverflow.com/a/29819277
tagged with: google-plus
tagged with: javascript
tagged with: w3c-validation
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I've got Google+ button on my site. It works fine, but W3C validator shows error: The text content of element script was not in the required format: Expected space, tab, newline, or slash but found < instead. Here is the code: How can I fix this?
accepted answer: http://stackoverflow.com/a/29819277
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47765086

http://stackoverflow.com/comment/47606665
has text: It's ok to include some additional code, it's just that you haven't explained anywhere *why* it's commented out, or how that's relevant. At any rate, it would be helpful to have a Stack Snippet c.q. enough code to actually reproduce your scenario. As you can see from my fiddle I do *not* have the error you get with code posted.
comment on: http://stackoverflow.com/q/29736521
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47821074
score: 0
type: Comment
has text: Im not sure what you're asking here, do you want no text at all to be displayed if one of the boxes are unchecked?
type: AnswerComment
comment on: http://stackoverflow.com/a/29844592

http://stackoverflow.com/q/29728631
upvote count: 1
type: Question
tagged with: canvas
tagged with: javascript
has title: Animating opacity in HTML5 Canvas
has body: I'm trying to recreate this effect, but I want this to be in canvas, basically drawing squares with fadein effect using a loop. The loop part is ok, what I cannot figure out is the fade in effect. I'm using requestAnimationFrame, with each repaint the globalAlpha is incremented, the old sqaure is deleted and a new one drawn. This is the function: function renderSquare(x, y) { requestID = requestAnimationFrame(renderSquare); alpha = requestID/100; ctx.clearRect(x,y,size,size); ctx.globalAlpha = alpha; var colour = "rgb(58,150,270)"; ctx.fillStyle = colour; ctx.fillRect(x, y, size, size); console.log("ID: " + requestID); console.log("Alpha: " + alpha); if(alpha == 1) { cancelAnimationFrame(requestID); } }; function drawSquare(x,y) { requestAnimationFrame(function render(){ renderSquare(x,y); }); } But I just can't get it to work. Here is a codepen with the whole thing. http://codepen.io/easynowbaby/pen/GJKOej?editors=001 Ultimately, I want to be able to use the function in the loopSquares function. Any help is very appreciated. Cheers! EDIT: I should have made myself clearer. I don't want to recreate the gallery with images, I'm only interested in the cascading fade in effect of squares. I want to achieve this effect in canvas where I'm gonna fade in little squares using fillRect function.
accepted answer: http://stackoverflow.com/a/29732392
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/29728703
favorite count: 0
possible better answer: http://stackoverflow.com/a/29728703
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29732392
score: 1

http://stackoverflow.com/comment/48179194
comment on: http://stackoverflow.com/a/29799691
score: 0
type: Comment
has text: Anytime!! Happy coding.. :) and yea That works too!!
type: AnswerComment

http://stackoverflow.com/comment/47641119
type: Comment
comment on: http://stackoverflow.com/a/29754102
type: AnswerComment
score: 0
has text: Web Workers do not have access to the localstorage or sessionstorage, so you'd still have to do all that on the main thread which kind of defeats the point of using a web worker, that seems like WAY more processing time than just loading it.

http://stackoverflow.com/q/29768254
upvote count: 0
score: -2
tagged with: javascript
has title: visual studio web project edit
tagged with: visual-studio-2010
answer count: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29769372
tagged with: http://stackoverflow.com/tag/html
tagged with: iis-express
has body: This feels ridiculous, but here goes: I have a web application project (started by colleague, down from tfs) that I trying to open in Visual Studio 2010. When I open my project I get the following error message: The Web Site 'http://localhost:60173' is configured to use IIS Express as the web server. To open this Web Site, you must download and install IIS Express. Would you like to download it now using Web Platform Installer? I dont' want to run anything. All I want to do is look at code and edit it. Why can't I? All questions/answers on the web on this error message is from people who actually have IIS Express installed, and can't make it work. This is not my issue. I just want to edit code, so WT*
downvote count: 2
type: Question

http://stackoverflow.com/comment/47600219
score: 0
type: Comment
type: QuestionComment
has text: Yes, it's better to avoid `new Array` and use `[]`.
comment on: http://stackoverflow.com/q/29733442

http://stackoverflow.com/q/29828098
has title: How to shorten switch case block converting a number to a month name?
upvote count: 120
has comment: http://stackoverflow.com/comment/47806173
has answer: http://stackoverflow.com/a/29887942
possible better answer: http://stackoverflow.com/a/29828363
has comment: http://stackoverflow.com/comment/47806718
has answer: http://stackoverflow.com/a/29936327
has answer: http://stackoverflow.com/a/29828181
favorite count: 0
has answer: http://stackoverflow.com/a/34979271
score: 111
has comment: http://stackoverflow.com/comment/48399395
has comment: http://stackoverflow.com/comment/47827161
tagged with: date-format
accepted answer: http://stackoverflow.com/a/29828190
has comment: http://stackoverflow.com/comment/48417862
has answer: http://stackoverflow.com/a/29828180
has answer: http://stackoverflow.com/a/29877434
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48417767
has body: Is there a way to write this on fewer lines, but still easily readable? var month = ''; switch(mm) { case '1': month = 'January'; break; case '2': month = 'February'; break; case '3': month = 'March'; break; case '4': month = 'April'; break; case '5': month = 'May'; break; case '6': month = 'June'; break; case '7': month = 'July'; break; case '8': month = 'August'; break; case '9': month = 'September'; break; case '10': month = 'October'; break; case '11': month = 'November'; break; case '12': month = 'December'; break; }
has comment: http://stackoverflow.com/comment/47812159
linked to: http://stackoverflow.com/q/1643320
has answer: http://stackoverflow.com/a/29828248
tagged with: switch-statement
has comment: http://stackoverflow.com/comment/47822440
has comment: http://stackoverflow.com/comment/48416628
type: Question
has comment: http://stackoverflow.com/comment/47795672
linked to: http://stackoverflow.com/q/287903
has answer: http://stackoverflow.com/a/29858711
downvote count: 9
tagged with: javascript
tagged with: date
has answer: http://stackoverflow.com/a/29828363
answer count: 13
has answer: http://stackoverflow.com/a/29828190
has answer: http://stackoverflow.com/a/29945201
has answer: http://stackoverflow.com/a/29844172
has answer: http://stackoverflow.com/a/29830464

http://stackoverflow.com/q/29694604
favorite count: 0
has comment: http://stackoverflow.com/comment/47526197
type: Question
has answer: http://stackoverflow.com/a/29695356
has answer: http://stackoverflow.com/a/78940223
score: 10
linked to: http://stackoverflow.com/q/8813674
has title: How to open a alert box within anchor tag <a href>?
has answer: http://stackoverflow.com/a/29694935
has answer: http://stackoverflow.com/a/29694605
possible better answer: http://stackoverflow.com/a/29695047
upvote count: 10
has answer: http://stackoverflow.com/a/29695047
answer count: 5
tagged with: javascript
has comment: http://stackoverflow.com/comment/47525591
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29694935
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has body: I want to open a alert box when a certain link is clicked. How to do that ?

webbrowser-control
type: Tag
tags question: http://stackoverflow.com/q/29763137
tags question: http://stackoverflow.com/q/29741900
tag name: webbrowser-control
tags question: http://stackoverflow.com/q/29752190

http://stackoverflow.com/q/29746028
accepted answer: http://stackoverflow.com/a/29746133
has comment: http://stackoverflow.com/comment/47624319
downvote count: 1
type: Question
upvote count: 0
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47624310
has title: append data to a JS "JSON array"
linked to: http://stackoverflow.com/q/736590
answer count: 1
has answer: http://stackoverflow.com/a/29746133
has body: In JS (it is node/js but actually is a general JS question) I have a data object which is a result of JSON coming from the server. I want to manipulate the data before passing it to the view. How can I do that? (I can make additional objects that contain the rest of the data but it feels wrong and un-natural) var response = JSON.parse(moment_respose_content ); if (response.success) { var data = response.data[0]; //add additional fields to data }
favorite count: 0
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/comment/47722420
has text: then do it on document ready or after `if(searchval != "") {` then you know it is after user typed something and before ajax call
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29796999

http://stackoverflow.com/comment/47679910
score: 0
comment on: http://stackoverflow.com/q/29773166
type: Comment
type: QuestionComment
has text: Okay: I have no more time for this, but here is a starting point for you and others: http://jsfiddle.net/TrueBlueAussie/kcGZJ/86/ I used `.header` LI elements to contain the text for the parent LI. I can't get the z-index to work, so they continue to move under the siblings.

http://stackoverflow.com/comment/47781115
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29827169
has text: @NathanJones If you think that was a wrong question, maybe just close it or delete i
score: 0

http://stackoverflow.com/comment/47854033
type: Comment
comment on: http://stackoverflow.com/a/29765366
has text: Seems you need to upgrade to at least FireFox 6. Why are you bothering with such an old version of the browser?
score: 0
type: AnswerComment

http://stackoverflow.com/a/29802648
has comment: http://stackoverflow.com/comment/77207571
upvote count: 13
accepted answer of: http://stackoverflow.com/q/29802562
answers question: http://stackoverflow.com/q/29802562
type: AcceptedAnswer
downvote count: 0
has body: The easiest way is to split on \n and then to rejoin on : split: Split takes a string and breaks it apart by another string, so for example if we have the string 1,2,3,4 and split on ,, we will end up with a javascript array like [1, 2, 3, 4]. rejoin: Join takes a javascript array, and glues it back together into a string using another string as the glue. For example, if we take that array we have [1, 2, 3, 4] and join on #, we will end up with a string like 1#2#3#4. So following these steps but swapping out , for \n and # for we are able to make a string like 1 2 3 4. This is almost right, notice that we don't have the starting or the ending so we just throw those on the beginning and end of the string: var paragraphs = ' ' + article.content.split("\n").join(' ') + ' '; Check out this jsbin example. The top box is the input, the bottom is the output.
score: 13
type: Answer

http://stackoverflow.com/a/29877947
type: Answer
has body: Loading an existing angular module should be done using ngload. Add ngload to your main.js: requirejs.config({ paths: { 'ngload': ['../lib/angularAMD/ngload'], ... }, shim: { 'ngload': ['angularAMD'], ...} }); Then, use it to load the ng-table: define(['app', 'ngload!ng-table'], function (app) { app.controller('resultsController', function ($scope, $http) { $scope.users = [ {name: "Moroni", age: 50}, {name: "Tiancum", age: 43}, {name: "Jacob", age: 27}, {name: "Nephi", age: 29}, {name: "Enos", age: 34} ]; }); }); Please see 3rd Party AngularJS Modules for more details.
has comment: http://stackoverflow.com/comment/59354604
answers question: http://stackoverflow.com/q/29830659
has comment: http://stackoverflow.com/comment/47887835
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29830659

http://stackoverflow.com/comment/47671917
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29770568
has text: It's hosted on godaddy.com. Not a local file. The URL is [oursolarsystem.co/mobile/solar_system.html](http://www.oursolarsystem.co/mobile/solar_system.html)
type: Comment

http://stackoverflow.com/comment/47754083
type: AnswerComment
has text: My application is basically an angularjs application. When the application is loaded in the browser then i store the details of the associated pages into the browser via a manifest file. And when the user clicks on a 'SYNC' button then I communicate with the server and fetches all the pdfs associated with the user. If I have to persist these pdfs using the manifest then how can I do it ?.....the manifest is already stored
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29790295

http://stackoverflow.com/comment/47539431
type: QuestionComment
has text: Scroll it to where? It's unclear what you are trying to do.
score: 1
comment on: http://stackoverflow.com/q/29701803
type: Comment

http://stackoverflow.com/q/29718948
score: 1
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/47574546
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I have a form that's embedded within an iframe in our website that I can't access. It's on a different server and there's nothing I can do to change it. It is a login form, and when submitted (using POST), goes to another website in the same window as my website. I want it to open in another tab/window. So far I've determined that I can't manipulate the form inside the iframe with javascript, so as to add a new target to it, because of cross-browser security issues. That leaves me with possibly trying to intercept the event of the page on my website closing, using the beforeunload event on a listener, like so: window.addEventListener("beforeunload", function (e) { var confirmationMessage = "really?"; (e || window.event).returnValue = confirmationMessage; // Gecko and Trident return confirmationMessage; // Gecko and WebKit }); This seems to at least intercept the action of leaving, but how do I then continue with leaving the page (data in post object intact), only in a new window this time?
answer count: 0
has title: Intercept leaving site, force destination into a new window
type: UnansweredQuestion
tagged with: iframe
upvote count: 1
has comment: http://stackoverflow.com/comment/47783508

http://stackoverflow.com/comment/47811162
type: QuestionComment
has text: There is not `for` loop so the style function does nothing. If you are using two datasets the canonical d3 style is to use two _select-data(mydata2)-enter_ and only update elements in the second one.
comment on: http://stackoverflow.com/q/29840281
score: 0
type: Comment

http://stackoverflow.com/comment/47650792
comment on: http://stackoverflow.com/q/29759239
score: 0
type: Comment
type: QuestionComment
has text: What do you mean by _deforming_, or _hiding_, for that matter? Do you just want it to be hidden, or to not be in the HTML source at all until the page is loaded?

http://stackoverflow.com/comment/47666658
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29767079
has text: @dystroy The time is reduced to ~1 second. I want to further reduce it. Can you please provide a sample of scoping the evaler inside a function?

http://stackoverflow.com/comment/54897826
score: 1
comment on: http://stackoverflow.com/q/29726340
type: Comment
type: QuestionComment
has text: I have found this : https://www.apifier.com/

http://stackoverflow.com/comment/50426447
comment on: http://stackoverflow.com/q/29791414
score: 0
type: QuestionComment
type: Comment
has text: Just added the solution I found below.

http://stackoverflow.com/comment/47777389
type: Comment
type: QuestionComment
has text: Check this out http://stackoverflow.com/questions/10237031/how-to-open-a-native-ios-app-from-a-web-app
comment on: http://stackoverflow.com/q/29824724
score: 0

http://stackoverflow.com/comment/69468362
has text: But this seems to be the best, working answer. Having to individually create the kendo window objects and using e.preventDefault() was the only way I was able to get that edit function to stop initiliazing the windows twice.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29823650
type: Comment

http://stackoverflow.com/q/29736968
has answer: http://stackoverflow.com/a/29737030
type: Question
has body: I'm trying to send an ajax POST request and I've set the content type to be application/json etc. But in the backend I keep getting 400 (BAD REQUEST). What's wrong with the code? var data = {key0: 'val0', key1: 'val1'}; $.ajax({ type: "POST", url: 'http://localhost:8000/api/users', data: data, success: function(data) { console.log(data); }, contentType: 'application/json', dataType: 'json' }); Flask: @usersapi.route('/api/users', methods=['POST']) def create_user(): #raise Exception(request.headers.get('Content-Type')) d = dict(request.get_json())
tagged with: javascript
tagged with: flask
has title: Trying to send a POST request and get json data but getting 400
score: 0
accepted answer: http://stackoverflow.com/a/29737030
answer count: 1
type: AnsweredQuestion

object-literal
tag name: object-literal
tags question: http://stackoverflow.com/q/29811745
tags question: http://stackoverflow.com/q/29749745
type: Tag

http://stackoverflow.com/comment/47567111
score: 0
comment on: http://stackoverflow.com/q/29716009
type: QuestionComment
type: Comment
has text: sorry, I first add data from database into a table where for one column I have two radio buttons. Upon clicking the radio button the javascript function runs. The problem is I only want to retrieve the set cookie only once and after the javascript function has been performed with AJAX I would require a creating new file, if I could do it this way it be much quicker

http://stackoverflow.com/a/29743458
answers question: http://stackoverflow.com/q/29730593
upvote count: 2
type: Answer
downvote count: 0
score: 2
has body: Contrary to solutions given in comments to your question, I suggest that you do not mix DOM-handling and ViewModel functionality in the viewmodel methods. Generally, I suggest avoiding doing anything which makes the viewmodel depending on the DOM. When it comes to animations for the foreach-binding I would first recommend creating a custom bindingHandler which would actually use the foreach-binding and add the animations you want. This way, you can keep the DOM-related code in the view or the bindingHandlers, where they are supposed to be. In some scenarios you might not want to create a custom binding for it, but just want the animation methods available to your foreach binding. In these cases, putting these methods on a viewmodel could be a more pragmatic approach. However, if you do this, I would recommend avoiding having your viewmodel functionality depending on these methods at all, just keep them only for doing the DOM animation logic. Given such an approach, your viewmodel could then look similar to (copying the one in your fiddle and then adding the animation methods): function ViewModel() { var self = this; self.selectedCategory = ko.observable(""); self.setCategory = function (newCat) { self.selectedCategory(newCat); }; self.allCharities = ko.observableArray([ new Charity(0, "Amnesty International", "$2,466", "HUMANITARIAN"), new Charity(1, "Richard Dawkins Foundation", "$0", "EDUCATION"), new Charity(2, "Khaaaan Academy", "13,859", "EDUCATION"), new Charity(4, "Wikipedia", "$7,239", "EDUCATION") ]); self.filteredCharities = ko.computed(function () { // If no category is selected, return all charities if (!self.selectedCategory()) return self.allCharities(); // Return charities in the selected category return ko.utils.arrayFilter(self.allCharities(), function (c) { return (c.Category() == self.selectedCategory()); }); }, this); var fadeAnimationDuration = 500; self.animationAfterAddingCharityElementsToDom = function(element){ //Since this method will be de…

http://stackoverflow.com/q/29817111
score: 15
tagged with: ajax
has comment: http://stackoverflow.com/comment/47761380
has comment: http://stackoverflow.com/comment/47761707
answer count: 7
has answer: http://stackoverflow.com/a/29817543
accepted answer: http://stackoverflow.com/a/29817543
favorite count: 0
has answer: http://stackoverflow.com/a/34515149
possible better answer: http://stackoverflow.com/a/29817157
has body: I guess the title is pretty much clear what I am asking. I have created this fiddle : http://jsfiddle.net/Sourabh_/HB7LU/13142/ In the fiddle I have tried to replicate an async scenario. This is just an example but in an AJAX call if I don't use $scope.$apply() the list does not get updated. I want to know if it is safe to use $scope.$apply() every time I make an AJAX call to update a list or is there some other mechanism I can make use of? Code I have written to replicate the scenario(same as in fiddle): HTML {{item.name}} Change JS var myApp = angular.module('myApp',[]); function MyCtrl($scope) { $scope.items = [{name : "abc"},{name : "xyz"},{name : "cde"}]; $scope.change = function(){ test(function(testItem){ $scope.items = testItem; //$scope.$apply(); }) } function test(callback){ var testItem = [ {name : "mno"}, {name : "pqr"}, {name : "ste"} ]; setTimeout(function(){callback(testItem)},2000); } }
has comment: http://stackoverflow.com/comment/52470521
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47761449
has answer: http://stackoverflow.com/a/29817339
has comment: http://stackoverflow.com/comment/47761561
linked to: http://stackoverflow.com/q/22346990
upvote count: 15
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/29817217
has title: When is it safe to use $scope.$apply()?
has answer: http://stackoverflow.com/a/56900922
linked to: http://stackoverflow.com/q/20263118
type: Question
has answer: http://stackoverflow.com/a/29817157
has comment: http://stackoverflow.com/comment/47761841
has answer: http://stackoverflow.com/a/29817275
tagged with: javascript

http://stackoverflow.com/q/29832429
has title: Twitter Bootstrap 3: Spyscroll always select last and working in JSFIDDLE not local with same code
has answer: http://stackoverflow.com/a/29834695
type: AnsweredQuestion
score: 2
tagged with: twitter-bootstrap-3
upvote count: 2
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29834695
answer count: 1
downvote count: 0
tagged with: jquery
has body: This is a little funny that same code doesn't produce the same behavior. http://jsfiddle.net/5n3ygvhe/ This is the jsfiddle code. It is a good demo of spyscroll. So I copy the codes into my local html file. Here is my local html file. I am holding the file with appengine. I have checked that jquery, bootstrap.min.css and bootstrap.min.js is loaded correctly. And the version of jquery is 2.1.3 and bootstrap is 3.0.0. I have tried other jsfiddle for spyscroll, exact same thing happens. Not working on local but working in jsfiddle. When I scroll the page, the nav li doesn't reflect that and always stick to the last item. Bootstrap 3.0 Skeleton Home About Contact Group A Sub-Group 1 Sub-Group 2 Group B Sub-Group 1 Sub-Group 2 Group C Sub-Group 1 Sub-Group 2 Group A Group A Sub 1 Group A Sub 2 Group B Group B Sub 1 Group B Sub 2 Group C Group C Sub 1 Group C Sub 2
favorite count: 0
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29714495
downvote count: 0
has comment: http://stackoverflow.com/comment/47564498
answers question: http://stackoverflow.com/q/29714416
accepted answer of: http://stackoverflow.com/q/29714416
score: 5
type: AcceptedAnswer
has body: While it's not exactly what you're asking about, may be $pristine is what you want? It's a flag on the form indicating whether the form has ever been edited. If someone typed and then cleared out a field, $pristine would still be false, however. &lt;form name="myform" ng-submit="doSubmit()" ng-controller="FormController"&gt; &lt;input ng-model="firstName" name="firstName" /&gt; &lt;/form&gt; Then in your controller .controller('FormController', function($scope){ $scope.doSubmit = function(){ if($scope.myform.$pristine){} } }) Alternatively, you can set all your fields to required="true" and use the $valid flag on the form in the same way as described above.
has comment: http://stackoverflow.com/comment/47564592
type: Answer
upvote count: 5

http://stackoverflow.com/a/29782656
accepted answer of: http://stackoverflow.com/q/29781858
answers question: http://stackoverflow.com/q/29781858
has body: It looks like most of your problems are in handling setInterval. setInterval will be called repeatedly, so you don't need to call it again. Because of that, we also don't need your loop at the end. To test it press 'Run code snippet' at the bottom of the post. I also took the liberty of cleaning it up. Some things that you should consider: Put the semicolon inside the style attribute, like so: , otherwise it's invalid HTML. var i = 0 I suggest putting semicolons after all statements. See this post for why. var yellow1 = document.getElementById("yellow1"); var green2 = document.getElementById("green2"); var blue3 = document.getElementById("blue3"); var white4 = document.getElementById("white4"); var orange5 = document.getElementById("orange5"); var i = 1; // Call setInterval once. It will run itself repeatedly. var t = setInterval(doSequence, 1500); function doSequence() { if (i == 1) { yellow1.style.backgroundColor = "rgb(255,255,0)"; } else { yellow1.style.backgroundColor = "#404040"; } if (i == 2) { green2.style.backgroundColor = "rgb(0,255,0)"; } else { green2.style.backgroundColor = "#404040"; } if (i == 3) { blue3.style.backgroundColor = "rgb(0,0,255)"; } else { blue3.style.backgroundColor = "#404040"; } if (i == 4) { white4.style.backgroundColor = "#FFFFFF"; } else { white4.style.backgroundColor = "#404040"; } if (i == 5) { orange5.style.backgroundColor = "#FFA500"; } else { orange5.style.backgroundColor = "#404040"; } // We don't need the loop because setInterval is already being called repeatedly. i++; if (i == 6) { i = 1; } } .tg { border-collapse: collapse; border-spacing: 0; } .tg td { font-family: Arial, sans-serif; font-size: 14px; padding: 10px 5px; border-style: solid; border-width: 1px; overflow: hidden; word-break: normal; } .tg th { font-family: Arial, sans-serif; font-size: 14px; font-weight: normal; padding: 10px 5px; border-style: solid; border-width: 1px; overflow: hidden; word-break: normal; }
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/29738930
type: Question
accepted answer: http://stackoverflow.com/a/29739298
tagged with: javascript
tagged with: jquery
has body: I have a script that generates a map with colors on it. I am trying to have an event happen when I click on one of the states - this is using jvectormap. However, for some reason it doesn't work. I try it on other elements, and the click event works fine. How do I get a click event to work with a path element? $(function() { var generateColors = function() { var colors = {}, key; for (key in map.regions) { values.green.forEach(function(item, i) { colors[item] = "#2eb02e"; }); values.red.forEach(function(item, i) { colors[item] = "#ba0707"; }); values.yellow.forEach(function(item, i) { colors[item] = "#d2d207"; }); } return colors; }, map = new jvm.Map({ map: 'us_lcc_en', container: $('#map'), series: { regions: [{ attribute: 'fill' }] } }); map.series.regions[0].setValues(generateColors()); }); AND: $("path").click(function() { console.log("blah blah blah"); }); Preferably the solution would be using jQuery.
has comment: http://stackoverflow.com/comment/47611289
has title: Can't do a click event on an SVG path element
answer count: 1
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/47611551
upvote count: 2
has answer: http://stackoverflow.com/a/29739298
has comment: http://stackoverflow.com/comment/47611371
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47611566
has comment: http://stackoverflow.com/comment/47611569

http://stackoverflow.com/q/29800287
tagged with: javascript
has title: PHP - Submit a form inside a page included into another page
has comment: http://stackoverflow.com/comment/47728785
has comment: http://stackoverflow.com/comment/47728793
has body: I'm developing a web application with PHP. Currently, the structure of my project folder is this (quite simplified): /myproject index.php head.php body.php footer.php css/ js/ src/ common/ security/ sessions.php ..some others.. main/ login.php signup.php ..some others.. conf/ ..some conf files.. utils/ ..some utils files.. app/ ...the app itself here.. accounts/ settings.php changepasswd.php ..some others files The web view is developed following the all-in-one-page pattern, using FullPage.js as section explorer. So, the index.php file serves the head the body and the footer (including the proper .php script). The login and the signup form are served (obviously) by login.php and signup.php respectively, using the AjaxForm plugin. When the user logs in, the index.php render the head.php, the body.php and and the footer.php; each ones is coded to serve differents tabs/sections depending on whether $_SESSION['user_name'] exists or not. Well..going straight to the problem: when the user is logged in, the Settings section appears. Inside of it, i put these lines: require '../src/security/sessions.php'; SE_session_start(); // my personal function to start safe sessions ....some other code where i query the DB to know currents settings... ...some others with others forms and informations... // i wrapped all into a form to avoid confution but i will not use it Change password Process As you can understand: the first is there just for design purposes. When the user click on it, a javascript function makes the "Change Password" to be visible. The problem: when i try to submit the form (still using ajaxForm, and that's not the problem because i got the same issue submitting as usual), no $_POST data is sent to the form-action script. In "passwdchange.php" (which actually manages the password change), if i try to access to $_POST['oldpasswd'] or any of the other inputs, i get (from xdebug): PHP Notice: Undefined index: oldpasswd What i've already tried: submit the form as usual…
has comment: http://stackoverflow.com/comment/47729944
answer count: 1
has comment: http://stackoverflow.com/comment/47729445
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/47730379
has comment: http://stackoverflow.com/comment/47729474
favorite count: 0
has comment: http://stackoverflow.com/comment/47729828
upvote count: 2
has comment: http://stackoverflow.com/comment/47729046
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47729456
tagged with: php
has comment: http://stackoverflow.com/comment/47729974
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29801593
accepted answer: http://stackoverflow.com/a/29801593
has comment: http://stackoverflow.com/comment/47728701
tagged with: forms
has comment: http://stackoverflow.com/comment/47731059
type: Question
has comment: http://stackoverflow.com/comment/47731310

http://stackoverflow.com/comment/47727870
type: QuestionComment
score: 0
has text: What is your question?
comment on: http://stackoverflow.com/q/29799718
type: Comment

http://stackoverflow.com/comment/47756910
comment on: http://stackoverflow.com/a/29814473
score: 0
has text: Are you working with any libraries (jQuery, angular, ...)? If yes, use promises of those. If not: google promises...................
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47731166
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29756395
has text: That fixed it!! I also changed the code in the function to be a:first to display the first item in the list as the default instead of the last. Thank you very much,

http://stackoverflow.com/q/29763175
possible better answer: http://stackoverflow.com/a/29763417
has comment: http://stackoverflow.com/comment/47658075
has answer: http://stackoverflow.com/a/29763335
accepted answer: http://stackoverflow.com/a/29763335
type: AnsweredQuestion
downvote count: 0
type: Question
linked to: http://stackoverflow.com/q/28910971
has comment: http://stackoverflow.com/comment/47658121
tagged with: algorithm
score: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29763417
answer count: 2
upvote count: 1
favorite count: 0
has body: I am having a hard time reasoning around this problem. Given a set of numbers ([1, 2, 3, 4, 5, 6, 7,8, 9, 10, 11, 12]) I want to find every possible combination that adds up to be 12. So, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] is equal as is [1, 2, 9] as is [12]. Ideally the return value is something along the lines of... [ [1,1,1,1,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,2], … ] I don't necessarily need the programing solved, just the algo or direction in the algo. This is what I have so far: var subsets = function (arr, total, answers, itteration) { var answers = answers || [[0]], itteration = itteration || 0, thisTest = answers[itteration], testTotal = sum(thisTest, total); if (testTotal === total) { if (arr.length === itteration) { return answers; } return subsets(arr, total, answers, itteration++); } for (var i=0, i&lt;arr.length; i++) { thisTest.push(arr[i]); if (sum(thisTest, total) === total) { } } } var sum = (array, total) { var tempTotal = 0; return array.forEach(function (el) { return tempTotal += el; }); } console.log(subsets([1,2,3,4,5,6,7,8,9,10,11,12], 12));
linked to: http://stackoverflow.com/q/28437488
has title: Algorithm: Every set of numbers that add up to a certain nuber

http://stackoverflow.com/q/29802833
has comment: http://stackoverflow.com/comment/47763211
favorite count: 0
tagged with: application-cache
tagged with: offline
upvote count: 3
linked to: http://stackoverflow.com/q/26241217
has comment: http://stackoverflow.com/comment/47760612
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47763691
has comment: http://stackoverflow.com/comment/66780930
has title: Is there any way other than caching to avoid the second request of the app manifest?
has comment: http://stackoverflow.com/comment/47754547
answer count: 0
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47763549
score: 3
has comment: http://stackoverflow.com/comment/66781624
has comment: http://stackoverflow.com/comment/47763050
has body: When taking a page offline, the browser will (glossing over the details) download the page, its manifest, and its resources, and then when done it will re-request the manifest (Step 24 here), and if what it gets back doesn't match the first one it got, caching fails. According to the spec, the browser should then schedule another attempt after a "short delay" (Step 25). Sadly, as far as I can tell, neither Chrome nor Firefox does that last part; instead, they just fail to cache (or update) the page and don't retry it. So in order for pages to be reliably cached/updated, we need to make sure the second copy of the manifest is a byte-for-byte copy of the first one from just a few moments before. If the data for the page already has some kind of built-in version you can use in the manifest, great, but if not it seems your options are: Generate some kind of synthetic version and remember it on the server so that you can return the same version for the two requests. Allow the browser to cache the manifest for a short time (say, up to two minutes) in its normal cache; that way, the second request for it is satisfied by the browser's normal cache, and thus is always byte-for-byte. Of course, that means you can't update the page within those two minutes. I'm not seeing anything in the spec, but is there any way to avoid that second manifest load entirely, so as to avoid either option? To tell the browser that the point-in-time of the first manifest is fine, we don't want it to recheck after? (In our case, we know for sure the world won't change half-way through downloading the resources, so the reason for the second check doesn't apply to us.)
type: Question
tagged with: javascript

http://stackoverflow.com/comment/47776429
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29823712
has text: This would be more impressive if I could verify it worked with the previous sample HTML: http://jsfiddle.net/TrueBlueAussie/z3hdzp9b/ Can you correct this JSFiddle? Your own JSFiddle does not seem to work either.
type: AnswerComment

http://stackoverflow.com/comment/47524373
has text: Images are stored in database, they retrieve it using fs collection package
comment on: http://stackoverflow.com/q/29693785
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47746263
has text: @WalkerBoh what is an IDE? I apologize I am only in introductory programming and the professor is terrible at teaching anything to us so it is very touch and go.
type: QuestionComment
comment on: http://stackoverflow.com/q/29808511
score: 0
type: Comment

http://stackoverflow.com/comment/47705022
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29787745
type: Comment
has text: Apparently I did not put this wright, I have centered mine image, whit bootstrap class, but the text I want to display in that image is the problem, it is hovering above mine centered image, I want it in the image, thanks for the answer.

http://stackoverflow.com/comment/47690936
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29780355
score: 1
has text: setting a cookie would be an easy way to go.

http://stackoverflow.com/comment/47721571
type: QuestionComment
comment on: http://stackoverflow.com/q/29796496
score: 0
has text: yes i am using jquery datatable
type: Comment

http://stackoverflow.com/comment/47742869
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29807416
score: 0
has text: Make sure your angular is the latest version. The ternary operator is a fairly new addition.

http://stackoverflow.com/comment/47788612
type: QuestionComment
comment on: http://stackoverflow.com/q/29830951
score: 0
type: Comment
has text: Screenshot added to show running IE11

http://stackoverflow.com/comment/47855033
comment on: http://stackoverflow.com/a/29774716
type: Comment
has text: I don't believe LinkView is deprecated, merely using global lookup. For example `{{view "select" }}` instead of `Ember.Select`. The question of how to use (extended) `LinkView` correctly using the view helper?
score: 0
type: AnswerComment

http://stackoverflow.com/a/29840012
score: -1
has comment: http://stackoverflow.com/comment/47808236
has comment: http://stackoverflow.com/comment/47808280
downvote count: 2
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29839793
has body: hope the following code will help function getPort(){ var port==location.port; if(port=="") { if(location.protocol=="http:") return "80"; else return "443"; return port; }
has comment: http://stackoverflow.com/comment/47807493

http://stackoverflow.com/comment/49321810
type: AnswerComment
comment on: http://stackoverflow.com/a/30604881
type: Comment
has text: I just learned that "pong" event was a custom event you send from server: at line 135 we have `var decoded = JSON.parse(message.data); me.$$fireEvent(decoded.event, decoded.data);` So you can set the event property in your server response and then catch that from your controller `ws.$on('customEvent', function (response) { console.log("DATA FROM SERVER", response);` Since it triggers two events, I decided to use the "$message" event and delete the custom one from ng-socket.js
score: 0

http://stackoverflow.com/comment/47579304
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29721835
type: QuestionComment
has text: I'm afraid that I am unable to help. Even a quick google search only comes back with problems using websockets with SSL or using websockets with ELB. Which both cases don't apply in your situation.

http://stackoverflow.com/comment/47703684
comment on: http://stackoverflow.com/q/29786904
type: QuestionComment
type: Comment
score: 1
has text: @DenisAli is probably right, your code works fine in jQuery 2.1.3 https://jsfiddle.net/s9hnhkfc/

http://stackoverflow.com/q/29771495
score: 4
accepted answer: http://stackoverflow.com/a/29772357
upvote count: 4
tagged with: highcharts
has answer: http://stackoverflow.com/a/29771772
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
possible better answer: http://stackoverflow.com/a/29771772
has title: Highcharts display series.name on X Axis
has body: I'm trying to display each series name on X-Axis http://jsfiddle.net/Jr79Y/9/ series: [{ name: 'Test', data: [20] }, { name: 'Test', data: [20] }, { name: 'Test', data: [40] }] Does somebody knows how to do this?
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29772357
has answer: http://stackoverflow.com/a/29772091
type: Question
tagged with: charts
has answer: http://stackoverflow.com/a/29772083
tagged with: javascript

http://stackoverflow.com/comment/47667506
score: 1
comment on: http://stackoverflow.com/q/29766365
has text: when you create a form in bootstrap you can use a class named form-group which handels this problem .http://getbootstrap.com/components/
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47569745
has text: I always used to terminate and concatenate strings, f me right?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29717645
type: AnswerComment

http://stackoverflow.com/q/29810939
tagged with: unit-testing
has comment: http://stackoverflow.com/comment/47749937
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/34076725
accepted answer: http://stackoverflow.com/a/29818094
type: Question
possible better answer: http://stackoverflow.com/a/34076725
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: mocha.js
has answer: http://stackoverflow.com/a/29818094
has title: Mocha - Testing Promise, `done` never gets called in Promise
favorite count: 0
has body: I'm trying to test a spy that would be called in the .then block of a promise, but the done in the then block doesn't seem to be executed at all. I'm getting timeout of 2000ms exceeded. Here's what I'm testing (async): /** * Passed down to the LoginForm component to * handle form submission. */ _submitHandler(data) { return function(evt) { evt.preventDefault &amp;&amp; evt.preventDefault(); evt.stopPropagation &amp;&amp; evt.stopPropagation(); return request('post', 'auth', data) .then((res) =&gt; { AuthActions.login(); return res; }) } } Here's my test: describe('when it succeeds', () =&gt; { it('should login', (done) =&gt; { sinon.spy(AuthActions, 'login'); Instance._submitHandler({})({}) .then((res) =&gt; { console.log('Called!!!'); expect(AuthActions.login.called).to.equal(true); AuthActions.login.restore(); done(); }, done); }); }); I'm using Karma to run my tests; Chai and Sinon.
tagged with: promise
upvote count: 2

http://stackoverflow.com/comment/47734180
type: QuestionComment
comment on: http://stackoverflow.com/q/29794915
has text: No, B loaded success. I can use class A in browserify. But i want use class A outside browserify. if i call "A" as "new A" outside browserify, then have a error.
score: 0
type: Comment

http://stackoverflow.com/comment/47590147
comment on: http://stackoverflow.com/q/29728056
type: Comment
type: QuestionComment
has text: Here is nothing about the Rails.
score: 0

http://stackoverflow.com/a/31433502
answers question: http://stackoverflow.com/q/29772013
has comment: http://stackoverflow.com/comment/55988325
has body: Iron Mike's solution was nearly correct. When a track event comes through you have to set its mode property to hidden otherwise the cuechange events won't fire. Here's a full example: $(videoElement)[0].textTracks.addEventListener('addtrack', function(addTrackEvent) { var track = addTrackEvent.track; track.mode = 'hidden'; track.addEventListener('cuechange', function(cueChangeEvent) { // do what you want with the cueChangeEvent }); });
score: 6
upvote count: 6
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29772013
has comment: http://stackoverflow.com/comment/55952846

http://stackoverflow.com/q/29705395
tagged with: youtube
answer count: 0
downvote count: 0
score: 1
tagged with: wordpress
has title: Wordpress Injected youtube videos, play on modal open, pause on modal close
type: Question
tagged with: javascript
tagged with: jquery
has body: I have youtube videos being injected dynamically with wordpress into multiple modals. &lt;div class="modal-overlay features-modal" id="modal-&lt;?php echo $do; ?&gt;"&gt; &lt;div class="modal-bg"&gt; &lt;div class="modal-close"&gt;&lt;/div&gt; &lt;div class="modal"&gt; &lt;div class="videoWrapper"&gt; &lt;iframe class="youtube-video" src="&lt;?php the_sub_field('youtube_video') ?&gt;?rel=0&amp;amp;controls=0&amp;amp;showinfo=0" frameborder="0" allowfullscreen allowscriptaccess="always"&gt;&lt;/iframe&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; What I am trying to accomplish is to get each individual youtube video to play on modal open and pause on modal close. Right now I can get the video to pause on close, but when I try to implement play on open with autoplay=1, it plays again on close (this code does not reflect the play on click). function modalFadeOut() { $('.open-modal').fadeOut("fast").removeClass("open-modal"); $('html').css('overflow',''); }; // features scroll video modal $(".video-button").click(function() { var Modal = $(this).data("modal-type"); $("#"+Modal).fadeIn("fast").addClass("open-modal"); }); $('.modal-bg').click(function() { modalFadeOut(); var vid = $(this).find('iframe[src*="youtube"]'); if ( vid.length &gt; 0 ) { var src = vid.attr('src'); vid.attr('src', ''); vid.attr('src', src); } });
upvote count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/29739964
tagged with: google-maps-api-3
has body: I am trying to create a circle on Google map but the problem is: I want the circle to fit view-port (map area) either height or width wise (whichever is smaller). Actually, I want to implement radius search so I find this a better way. Please let me know if I am doing it wrong or any other better way to do it. I am using Google maps API v3. Thanks
answer count: 1
has answer: http://stackoverflow.com/a/29744759
accepted answer: http://stackoverflow.com/a/29744759
favorite count: 0
has title: How to create a circle that fits Google maps view-port?
has comment: http://stackoverflow.com/comment/47621435
has comment: http://stackoverflow.com/comment/47620486
type: AnsweredQuestion
downvote count: 1
type: Question
tagged with: google-maps
upvote count: 0
tagged with: javascript
score: -1

http://stackoverflow.com/q/29708067
type: Question
has answer: http://stackoverflow.com/a/29708116
score: 0
answer count: 2
has title: Fire jQuery event on tag generated by innerHTML
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47551924
has answer: http://stackoverflow.com/a/29708112
has comment: http://stackoverflow.com/comment/47551858
has body: I'm using a javascript loop to create HTML code for a list, Example: if (thisList.length > 0) { var myList = ""; for (var i = 0; i < thisList.length; i++) { myList += ' Item ' + i + ' '; } var myListBox = document.getElementById('my-list').innerHTML = myList; } I am then inserting the HTML code using: So the rendered HTML would be similar to: Item 0 Item 1 My Problem: I cannot fire a jQuery event on the tags inside ul#my-list. For example, the following jQuery code has no affect on the li tags. $(document).ready(function(){ $('li').click(function() { $(this).hide(); }); How can I fire a jQuery event on those tags? Thanks in advance.

http://stackoverflow.com/comment/121605353
type: QuestionComment
has text: @JoshHorowitz did you solve it?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29829628

http://stackoverflow.com/comment/47690982
comment on: http://stackoverflow.com/q/29708487
score: 0
type: Comment
type: QuestionComment
has text: This causes all the points to be sitting right on the y axis. Seemingly it does set the max x axis value to 'Infinity' (or some very large number).

http://stackoverflow.com/comment/47801138
comment on: http://stackoverflow.com/a/29837181
type: AnswerComment
has text: Sorry, I don't control the site :/
type: Comment
score: 1

http://stackoverflow.com/comment/47696795
type: Comment
comment on: http://stackoverflow.com/a/29783253
has text: Yes I know. I have to re-bind. But I don't know which all bootstrap javascript controls going to come after ajax load. So how to re-bind everything in Bootstrap? like dropdown, tabs, etc.,
score: 1
type: AnswerComment

http://stackoverflow.com/comment/47804996
type: Comment
comment on: http://stackoverflow.com/q/29839226
has text: @Hanky, the last car I modified was a 1968 Holden HR, bored out the pistons to make them lighter than added a cap on top of each for more compression. Got it up to 90mph (from about 70) but the engine fused shortly after that. Modern cars are no fun at all, having to plug in an expensive and not-very-available computer to do anything with :-)
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47665749
has text: There is no need to explicitly add any specific request headers to use CORS. The browser will do that automatically.
type: AnswerComment
comment on: http://stackoverflow.com/a/29767407
type: Comment
score: 1

http://stackoverflow.com/comment/48612260
type: QuestionComment
comment on: http://stackoverflow.com/q/29816392
has text: Hi Nicolas, sorry was away and only got your reply now, thank you for that, but that doesn't solve my initial problem.
score: 0
type: Comment

http://stackoverflow.com/a/29824399
has body: First of all be careful in components namings inside your JS function (pnlrptPckgInclusions != rptPckgInclusions) After this change you OnClick handler to this OnClick='&lt;%# "javascript:EnableDisablePkgInclusionDropDown(" + Container.ItemIndex + ")" %&gt;' It should help. Have a nice day !
has comment: http://stackoverflow.com/comment/48565907
accepted answer of: http://stackoverflow.com/q/29824014
has comment: http://stackoverflow.com/comment/47775374
has comment: http://stackoverflow.com/comment/49388743
has comment: http://stackoverflow.com/comment/47778947
has comment: http://stackoverflow.com/comment/47780078
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29824014
has comment: http://stackoverflow.com/comment/47775869
has comment: http://stackoverflow.com/comment/47780371
type: Answer

http://stackoverflow.com/q/29774574
score: -2
tagged with: url-rewriting
downvote count: 2
tagged with: http-redirect
answer count: 1
has answer: http://stackoverflow.com/a/29774647
has body: How to Redirect each link on the webpage through another link using JavaScript or any html? I have a website - www.example.com I have few links on each page like - www.link1.com www.link2.com www.link3.com I want the javascript that can be added to each webpage and will give the below results - whenever someone clicks on the links - it should show a link like this - www.example.com/redirect?=www.link1.com Now this redirect script should calculate the redirect path based on links like and whenever some user clicks on them it should go like below- link1 should be redirected as below - www.affiliate1.com/r/www.link1.com and link2 should be like below - www.affiliate2.com/r/www.link2.com Please advise on ow to achieve this. I am not a code expert but I have few websites where they are doing it.
tagged with: hyperlink
type: UnansweredQuestion
has title: How to Redirect each link on the webpage through another link using Javascript or any html?
upvote count: 0
tagged with: javascript
favorite count: 0
type: Question

http://stackoverflow.com/comment/47748437
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29805998
has text: I changed it the IDs to match, and I'm still able to type 'PO Box' into the field without getting an alert. You can see here it's still not working, but I'm probably not integrating the event listener correctly. http://jsfiddle.net/ZQQS9/5/
type: Comment

http://stackoverflow.com/comment/47532323
has text: wrap the code in a document ready statement
score: 0
comment on: http://stackoverflow.com/q/29698064
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29715471
score: 0
has title: Calling a Polymer Function in Meteor
answer count: 2
tagged with: javascript
tagged with: meteor
type: AnsweredQuestion
type: Question
tagged with: polymer
has body: I am a noob in JavaScript so excuse my stupid question if I have missed something. We all would agree that an example page should be clear for even a baby to understand it, right? I know I could copy their demo.html into my app and I get what I want but I am doing it wrong. I want to implement core-overlay but something is left out. A noob like me would just copy and paste this in my app's page and expect to see the toggle button: Dialog I agree with this wholeheartedly. OK All I see is a blank page but I know there must be some function to be added. Why is that most of their examples are not clear? How to get the toggle button? Another website stated below but that only works with the paper-toast function:
possible better answer: http://stackoverflow.com/a/29715632
has answer: http://stackoverflow.com/a/29715632
has answer: http://stackoverflow.com/a/29718433
accepted answer: http://stackoverflow.com/a/29718433

http://stackoverflow.com/comment/47725431
type: AnswerComment
type: Comment
has text: mmm, i have got it setting the value now using - sheet.getRange(i+1,18).setValue('Yes'); - but with the current data i would expect it to populate it in row 2 and 5 in column 18. it is puttting them in column 18 but in rows 1 and 31??
score: 0
comment on: http://stackoverflow.com/a/29796445

http://stackoverflow.com/q/29715463
tagged with: wacom
has title: Error in displaying base64 encoded string as image in browser?
answer count: 1
linked to: http://stackoverflow.com/q/475074
type: UnansweredQuestion
tagged with: php
score: 0
has answer: http://stackoverflow.com/a/29715608
has body: I am working on a website for a friend which takes in a signature from a wacom STU-300 signature tablet, to then be placed in the database. (as any data type as long it is readable, I tried BLOB and varchar). After checking the documentation I found out that there is a method where you can retrieve the data as a base64 encoded string after taking the signature. This is an example I printed from a signature after extracting the base64 encoded string: "[binary]" Edit: Thanks vjdhama for removing the spaces now it does come up as a valid base64 string however I am still not able to convert this back into an image file. When I tried decoding this back into an image using the base64 decoder at WUtils, it comes up as FS�BECT$ 8" '���3�i�|I�3�\��nϠ�T�{��wE��CWHO " p��2��z�zg�X��Lj�i3��9��J�bT4$ instead of an image. I need to display the base64 encoded string in image form in the browser with php .
type: Question
tagged with: encoding
tagged with: javascript

http://stackoverflow.com/q/29800506
score: -1
has comment: http://stackoverflow.com/comment/47729280
answer count: 2
favorite count: 0
has comment: http://stackoverflow.com/comment/47729628
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47729026
tagged with: http://stackoverflow.com/tag/html
has body: how do you highlight radio button after submit? Example code: QUESTIONS Question No. 1.)What is your favorite food? A. Hi B. Hello C. Ahh D. Kitkat Question No. 2.)What is your favorite color? A. Hi B. Hello C. Ahh D. Kitkat Question No. 2.)What is your favorite color? A. Hi B. Hello C. Ahh D. Kitkat Question No. 2.)What is your favorite color? A. Hi B. Hello C. Ahh D. Kitkat after, submitting, radio button with value yes should be highlighted.how do i do that in javascipt?
has comment: http://stackoverflow.com/comment/47729062
downvote count: 2
has title: Highlighting radio buttons after submit
has answer: http://stackoverflow.com/a/29801208
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29801104
tagged with: javascript

http://stackoverflow.com/a/29812025
has body: @MrCode had two great solutions to this. The data-id method is a bit more elegant and what I went with. Note, the $post-&gt;ID is a number which just won't work as an id= - https://css-tricks.com/ids-cannot-start-with-a-number/ - and was causing the issue where things just wouldn't work. The answer; follow @MrCode's method of using a data attribute. It's elegant and works great w/ the loop.
score: 0
answers question: http://stackoverflow.com/q/29800099
type: Answer

http://stackoverflow.com/comment/47652480
has text: There is only one way to dynamically remove a rule... `.rules('remove')`. If you've found a bug with the plugin or if it functions in way that is unexpected, there is not much we can do for you here. Please make a bug report on the developer's GitHub page.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29758485
type: Comment

http://stackoverflow.com/a/29728787
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/47591470
has comment: http://stackoverflow.com/comment/47591436
has body: Have you tried with this one ? - /\:\w+\:/g Tried in firebug console - var re = /\:\w+\:/g console.log(":tetest: xdsds :sdsd:".match(re)) an output is - [":tetest:", ":sdsd:"]
has comment: http://stackoverflow.com/comment/47591509
has comment: http://stackoverflow.com/comment/47592293
downvote count: 0
answers question: http://stackoverflow.com/q/29728757

http://stackoverflow.com/comment/47644219
has text: @Ciprian Also, using will-change did not help, unfortunately.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29752721
score: 0

http://stackoverflow.com/comment/47594196
comment on: http://stackoverflow.com/a/29730179
score: 0
type: AnswerComment
has text: @RaghavGarg: That completely depends on your code and data. `if (userId is not allowed to access)`
type: Comment

http://stackoverflow.com/comment/47731663
comment on: http://stackoverflow.com/q/29794898
score: 0
has text: _“how would i go about fixing this bug”_ – by finding its cause first, which is called _debugging_. So what have you done so far in this regard?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47529428
type: QuestionComment
comment on: http://stackoverflow.com/q/29696716
score: 0
has text: Better keep single class name if you want to refer them with one go!!
type: Comment

http://stackoverflow.com/comment/47718850
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29794890
has text: I'm guessing that you are calling resize_widget function too early! Try to call this.resize_widget after this.save method ends, like callback! or just try to move that line lower..
type: Comment

http://stackoverflow.com/comment/47579646
has text: Also, I had no clue about ES6 promise support in Node. That's crazy/awesome.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29722640
type: AnswerComment

http://stackoverflow.com/q/29769673
tagged with: google-closure-compiler
has body: I am using this solution: (from: Remove element by id) 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]); } } } I am getting the following warning in closure compiler: externs.zip//w3c_dom2.js:793: WARNING - mismatch of the remove property type and the type of the property it overrides from superclass Element original: function (this:Element): undefined override: function (this:HTMLSelectElement, number): undefined HTMLSelectElement.prototype.remove = function(index) {}; How can I clear this warning? Or should I use another approach for element.remove?
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29774898
favorite count: 0
linked to: http://stackoverflow.com/q/3387427
has comment: http://stackoverflow.com/comment/47669975
score: 2
type: AnsweredQuestion
upvote count: 2
type: Question
has title: Element.prototype.remove - Closure Compiler warning
has answer: http://stackoverflow.com/a/29774898

http://stackoverflow.com/q/29771959
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47676229
upvote count: 2
has comment: http://stackoverflow.com/comment/47675035
type: Question
tagged with: javascript
tagged with: google-maps-api-3
has answer: http://stackoverflow.com/a/29773445
tagged with: google-maps
downvote count: 0
answer count: 1
favorite count: 0
has title: Adding images to multiple google map infowindows
has body: So, as part of an assignment we have to design a map using the Google Maps API which needs to use multiple infowindows and custom markers. I have managed the first two, but I seem to be struggling with the images? Could I simply add the images into the array, and if so, how do I format this properly? Here is my current code //Beginning of Function function initialise() { //Get mapArea in HTML, create map based around latlong var map = new google.maps.Map(document.getElementById('mapArea'), { zoom: 16, center: new google.maps.LatLng(53.470639, -2.238996), mapTypeId: google.maps.MapTypeId.ROADMAP }); //add array of locations and markers var locations = [ ['Geoffrey Manton Building', 53.469272, -2.237179,'http://labs.google.com/ridefinder/images/mm_20_purple.png'], ['All Saints Building', 53.471086, -2.238541,'http://labs.google.com/ridefinder/images/mm_20_red.png'], ['Business and Law Schools', 53.470575, -2.239673,'http://labs.google.com/ridefinder/images/mm_20_green.png'], ['John Dalton', 53.471964, -2.240392,'http://labs.google.com/ridefinder/images/mm_20_blue.png'], ]; //declare variable marker as i var marker, i; //Declare new infowindow for locations var infowindow = new google.maps.InfoWindow(); //add marker to each location for (i = 0; i &lt; locations.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, icon: locations[i][3] }); //Create marker functionality, allow infowindow opening google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent(locations[i][0]); infowindow.open(map, marker); } })(marker, i)); } } google.maps.event.addDomListener(window, 'load', initialise);
accepted answer: http://stackoverflow.com/a/29773445
score: 2

http://stackoverflow.com/comment/47731348
type: Comment
type: QuestionComment
has text: @hollie3406 Then please provide minimalistic sample to replicate issue
score: 0
comment on: http://stackoverflow.com/q/29801573

http://stackoverflow.com/q/29734636
has comment: http://stackoverflow.com/comment/47602544
has comment: http://stackoverflow.com/comment/47602677
has body: I'm a total beginner with coding just in general. This is also my first time trying to do something with js; I want to animate a bunch of squares to move towards a certain point on the page. I googled a bunch of things, and I wrote this, but it doesn't work; can anybody tell me why this isn't working? var canvas = document.getElementById('canvas'); var context = canvas.getContext('2d'); var enemies =[]; for (var i = 0; i &lt; 10; i++){ var randomX = Math.abs(Math.random()); var randomY = Math.abs(Math.random()); if (randomX &gt; 100 &amp;&amp; randomX &lt; 1200){ if (randomX%2 == 0){ randomX = 140; } else { randomX = 1281; } } if (randomY &gt; 100 &amp;&amp; randomY &lt; 75){ if (randomY%2 == 0){ randomY = 15; } else{ randomY = 560; } } var enemy = new Enemy(randomX,randomY,0,0); enemies.push(enemy); } var Enemy = function(x,y,velx,vely){ this.x = x; this.y = y; this.velx = 0; this.vely = 0; } Enemy.prototype.update = function (){ var tx = 650 - this.x; var ty = 250 - this.y; var dist = Math.sqrt(tx*tx + ty*ty); this.velx = (tx/dist); this.vely = (ty/dist); if (dist &gt; 0){ this.x += this.velx; this.y += this.vely; } }; Enemy.prototype.render = function(){ context.fillStyle = #000000; context.rect(this.x,this.y,25,25); context.fill(); }; function render(){ context.clearRect(0,0,canvas.width,canvas.height); for (var i = 0; i &lt; enemies.length; i++){ var one = enemies[i]; context.clearRect(one.x,one.y,25,25); one.update(); one.render(); } requestAnimationFrame(render); } render();
type: Question
tagged with: canvas
answer count: 1
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47602581
has title: Javascript Basic Animation
has comment: http://stackoverflow.com/comment/47602511
has answer: http://stackoverflow.com/a/29734740
linked to: http://stackoverflow.com/q/9743027
tagged with: animation
accepted answer: http://stackoverflow.com/a/29734740
type: AnsweredQuestion

http://stackoverflow.com/q/29748732
score: 0
has comment: http://stackoverflow.com/comment/47658876
has title: File upload validation using javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47630558
answer count: 0
has body: I have a form filed as follows &lt;span&gt; Upload CV :&lt;/span&gt;&lt;input type="file" id="flu" name="filename" /&gt; And am calling Validation function as follows &lt;form name="frm" action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;" onsubmit = "return validateForm()" enctype="multipart/form-data"&gt; Validitaion function is as follows else if (document.forms["frm"].filename.value == null || document.forms["frm"].filename.value== "") { document.getElementById("fullnameerr").innerHTML=""; document.getElementById("subspecerr").innerHTML=""; document.getElementById("emailerr").innerHTML=""; document.getElementById("mobileerr").innerHTML=""; document.getElementById("pperr").innerHTML=""; document.getElementById("dateerr").innerHTML=""; document.getElementById("currentworkerr").innerHTML=""; document.getElementById("filenameerr").innerHTML="Please upload your CV"; document.forms["frm"].filename.focus(); return false; } else if (document.forms["frm"].captcha.value == null || document.forms["frm"].captcha.value== "") { document.getElementById("fullnameerr").innerHTML=""; document.getElementById("subspecerr").innerHTML=""; document.getElementById("emailerr").innerHTML=""; document.getElementById("mobileerr").innerHTML=""; document.getElementById("pperr").innerHTML=""; document.getElementById("dateerr").innerHTML=""; document.getElementById("currentworkerr").innerHTML=""; document.getElementById("filenameerr").innerHTML=""; document.getElementById("captchatxterr").innerHTML="Please enter image text"; document.forms["frm"].captcha.focus(); return false; } else { return true; } How can I validate file upload to check file size for 1 MB and it should submit .doc and .pdf documents any help may greatly appreciated.
type: Question
has comment: http://stackoverflow.com/comment/47660569
tagged with: javascript

http://stackoverflow.com/a/29701615
answers question: http://stackoverflow.com/q/29701400
has body: One approach would be to store all your markers and info windows in an array or object. that way you can loop through and open/close them all (or certain ones based on some conditions) when you need to. An example maybe: var myPopups = []; // create an array var infowindow = new google.maps.InfoWindow({ content: "Loading..." }); myPopups.push(infowindow);// add your infowindow to your array // once you've added all your info windows to your array you // can loop through them to open all info windows. for (var i = 0; i &lt; myPopups.length; i++) { myPopups[i].open(map, marker); } Remember that the open method takes the marker associated with the infowindow as the second parameter, so you'd need to store your markers too.
type: Answer
score: 0

http://stackoverflow.com/q/29771011
has title: AngularJS: $watch with debounce
has comment: http://stackoverflow.com/comment/47672633
tagged with: javascript
score: 4
linked to: http://stackoverflow.com/q/13320015
upvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/29771331
downvote count: 0
has body: I have the following html which represents a search field: &lt;input ng-model-options="{ debounce: 500 }" type="text" ng-model="name"&gt; And the following js: $scope.$watch('name', function(newVal, oldVal) { if(newVal != oldVal) { $scope.pageChanged($scope.sort, $scope.name, $scope.sortDirection); } }); Now, my pageChanged function makes a REST call to my server and returns a list of entites based on the sort and search information (the "name"). Say that my user wants to search for a "Tom". I would like to avoid my application making three rest calls (name="T", name="To", name="Tom"). I tried doing this with debounce, but it seems that watch doesn't work with debounce so I was wondering what would be the best way to implement this with minimal code?
has comment: http://stackoverflow.com/comment/47673031
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/39726751
tagged with: watch
has comment: http://stackoverflow.com/comment/47672607
has comment: http://stackoverflow.com/comment/47677578
type: Question

http://stackoverflow.com/comment/47957213
score: 0
type: AnswerComment
type: Comment
has text: Just curious about how it is achievable if we are using select2 plugin? Any idea?
comment on: http://stackoverflow.com/a/29844954

http://stackoverflow.com/comment/47644921
type: Comment
has text: Only one of your anchors have a `href`, what is supposed to happen when you click the others ?
score: 1
comment on: http://stackoverflow.com/q/29756287
type: QuestionComment

http://stackoverflow.com/q/29784294
type: Question
score: 5
tagged with: javascript
has title: d3.js zooming mouse coordinates
answer count: 1
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
upvote count: 5
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47700416
has answer: http://stackoverflow.com/a/37840841
has body: Im using d3.js zoom function to zoom in on an image inside an svg. Im using a mask to reveal an underlying image beneath. If i dont zoom the mask and mouse cursor coordinates match up perfectly. However, when i start to zoom the mouse coordinates are not translating to the zoom level, thus the map reveal is not lining up with the cursor anymore. here is what im using so far...Im assuming there needs to be some sort of coordinate translation when zooming? var lightMap = d3.select("#lightMap").call(d3.behavior.zoom().scaleExtent([1, 3]).on("zoom", zoom)); var darkMap = d3.select("#darkMap").call(d3.behavior.zoom().scaleExtent([1, 3]).on("zoom", zoom)); function zoom() { lightMap.attr("transform", "translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")"); darkMap.attr("transform", "translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")"); } var svg = d3.select("svg"); svg.on('mousemove', function () { var coordinates = [0, 0]; coordinates = d3.mouse(this); var x = coordinates[0]; var y = coordinates[1]; primaryCircle.setAttribute("cy", y + 'px'); primaryCircle.setAttribute("cx", x + 'px'); });

http://stackoverflow.com/comment/47694543
has text: Thank you. I have updated my post. I will also post a link to the page. I believe the problem is the decoding, as you mentioned earlier.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29733625

http://stackoverflow.com/a/29822638
type: Answer
has comment: http://stackoverflow.com/comment/47771523
score: 41
has comment: http://stackoverflow.com/comment/47771573
has comment: http://stackoverflow.com/comment/47771424
has comment: http://stackoverflow.com/comment/47807484
upvote count: 41
has comment: http://stackoverflow.com/comment/47771688
has comment: http://stackoverflow.com/comment/47773601
has comment: http://stackoverflow.com/comment/47803285
accepted answer of: http://stackoverflow.com/q/29822607
has comment: http://stackoverflow.com/comment/47771805
answers question: http://stackoverflow.com/q/29822607
has comment: http://stackoverflow.com/comment/47807189
has comment: http://stackoverflow.com/comment/47771472
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47771863
has body: Recaptcha has a onload callback that will run once recaptcha is loaded. Place your code inside that callback function. https://developers.google.com/recaptcha/docs/display

http://stackoverflow.com/comment/49678999
type: AnswerComment
comment on: http://stackoverflow.com/a/29700893
type: Comment
score: 0
has text: @NoBugs As long as you have a reference, you can still add it to the DOM again, so any observer *shouldn't* be disconnected. I created [a fiddle](http://jsfiddle.net/xL81b6w5/3/) to test this, and Chrome, FF, Safari and Opera all don't disconnect. However, if you have *no* reference to the node and the observer anymore, the garbage collector should eventually kick in and silently phase both out of existence (except for IE maybe, because IE is broken). You could probably test this by adding a bazillion observers to a node, removing it from the DOM and watch the browser's memory usage.

http://stackoverflow.com/comment/47805048
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29839105
has text: The GET topic is found by searching.. But the search bar isn't connected to these two codes in any other way besides redirecting you to the correct URL

http://stackoverflow.com/comment/47533657
type: QuestionComment
comment on: http://stackoverflow.com/q/29698774
has text: consult the console for errors
score: 0
type: Comment

http://stackoverflow.com/comment/47696175
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29783103
type: Comment
has text: This is the correct answer. Do not use objects as keys into other objects.

http://stackoverflow.com/comment/47761504
has text: yeah actually i already tried this function(doc) { if(doc.doc_type==="messages") emit(doc.from, doc); if(doc.doc_type==="messages") emit(doc.to, doc); }
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29805546
type: Comment

http://stackoverflow.com/comment/47637066
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29745637
has text: @star let me have a look at it i will get back to you

http://stackoverflow.com/comment/47720589
has text: [{'v1':'abcde', 'pv_45': 13018, 'geolocation': '17.340291,76.842807'}]
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29795381

http://stackoverflow.com/q/29783945
accepted answer: http://stackoverflow.com/a/29802634
score: 0
answer count: 1
tagged with: jquery
has body: I have a table, and each row is added through JavaScript. I create these rows so that when they're clicked another cell will be created beneath them where I can display additional information. Now I want to be able to destroy the row I just created when the user clicks a button etc. So essentially, I need to be able to have the row I created have an onclick attribute, but it doesn't seem to work... I've tried everything I can think of so any help would be awesome! var table = document.getElementById("main_table"); var row = table.insertRow(1); row.id = count; row.onclick = function () { var id = this.id; var target = document.getElementById(id); var newElement = document.createElement('tr'); newElement.style.height = "500px"; newElement.id = id + "" + id; //newElement.innerHTML = text; target.parentNode.insertBefore(newElement, target.nextSibling ); //var newRow = document.createElement("tr"); //var list = document.getElementById(id); //list.insertAfter(newRow,list); var newRow = table.insertRow(newID); }
has title: Create Element with onclick
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29802634
tagged with: onclick
type: Question
tagged with: javascript

http://stackoverflow.com/a/29771295
type: Answer
has comment: http://stackoverflow.com/comment/47674640
has comment: http://stackoverflow.com/comment/47722283
has comment: http://stackoverflow.com/comment/47675724
accepted answer of: http://stackoverflow.com/q/29770878
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29770878
has body: Try this out .. $(function(){ map = new jvm.Map({ container: $('#map'), map: 'world_mill_en',//map file backgroundColor: ['#1E90FF'],//map background color regionsSelectable:true,//this needs to be true to be able to select a region onRegionClick: function(event, code){ var map = $('#map').vectorMap('get', 'mapObject'); var regionName = map.getRegionName(code); $.getJSON('../countries.json', function(data) { for (var i in data.country) { if (data.country[i].name === regionName){ var answer = prompt(data.country[i].question, "Type your answer here."); if(data.country[i].answer === answer){ map.setSelectedRegions(code);; }else{ map.clearSelectedRegions(); } } } }); }, }); });

http://stackoverflow.com/comment/47758202
comment on: http://stackoverflow.com/q/29790977
score: 0
type: Comment
type: QuestionComment
has text: yes event fired, but it again display both like in above.

http://stackoverflow.com/q/29763696
upvote count: 1
answer count: 4
accepted answer: http://stackoverflow.com/a/29764590
type: AnsweredQuestion
score: 1
has title: How to pass array from service function to scope in controller (AngularJs)?
possible better answer: http://stackoverflow.com/a/29763793
type: Question
has answer: http://stackoverflow.com/a/29763793
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29763852
has answer: http://stackoverflow.com/a/29763772
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29764590
has body: I have an angular service shown below : .service('shareDataService', function() { var myXi = []; var myYi = []; var addXi = function(newObj) { myXi = newObj; } var addYi = function(newObj) { myYi = newObj; } var getPlot = function() { var a = []; for (var i = 0; i &lt; myXi.length; i++) { a.push([myXi[i], myYi[i]]); } return a; } return { addXi: addXi, addYi: addYi, getPlot: getPlot }; }); And i have angular controller : .controller('plotController', function($scope, shareDataService) { $scope.getYo = function() { return shareDataService.getPlot(); }; $scope.lineChartData = [ $scope.getYo() ]; }); I need to send a value from $scope.getYo to $scope.lineChartData (it will be and array). How can I do that? I've tried like that, but if I call $scope.lineChartData in HTML, I get nothing. The data that I need is [ [ [2,0], [3,1], [5,4] ] ]; UPDATE : See my complete explanation in http://laravel.io/bin/6LVej . Thanks

http://stackoverflow.com/q/29805234
upvote count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29805829
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29805603
has body: Say I have a textfield where the dimensions of the table are given. like 2 3 now I need to write a function that creates a table out of div-tags with those dimensions. The table has to be inserted in the &lt;div id="output"&gt; -element I was thinking of making a string with osme for-loops that looks like this &lt;div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div&gt; ... (more columns) &lt;/div&gt; So that looks like a sequence of div-tags and afterwards I would convert this to html and insert it. But isn't there a more efficient way?
downvote count: 1
type: Question
has title: Jquery & HTML - dynamically create div-table
tagged with: javascript
tagged with: jquery
score: -1
answer count: 2

http://stackoverflow.com/comment/47774029
score: 0
type: Comment
has text: I gave this a shot but am still experiencing the same behavior. If you want to see the website in action go to: http://disconnect.cloudviewhost.com I'm logging the json in the console. Thank you!
type: AnswerComment
comment on: http://stackoverflow.com/a/29814308

http://stackoverflow.com/comment/47689518
score: 1
has text: Imagine anyone being able to select any file to upload off your computer.It can't be done.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29779700

http://stackoverflow.com/a/29798982
accepted answer of: http://stackoverflow.com/q/29798946
answers question: http://stackoverflow.com/q/29798946
upvote count: 4
has body: You are not injecting your service (dataService) into your controller: app.controller('ReCtrl', ['$scope', 'dataService', function($scope, dataService){ dataService.getdata(function(dataResponse) { $scope.fields = dataResponse; }); .... Note the extra string 'dataService' after '$scope' while defining the controller ReCtrl.
type: AcceptedAnswer
score: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/47726225
type: Answer

http://stackoverflow.com/q/29744784
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47622257
accepted answer: http://stackoverflow.com/a/29744902
tagged with: google-chrome
type: Question
tagged with: javascript
score: 0
has body: I'm going to be looking at adding some minor Jquery onto a specific page on my site to alter some layouts. Id like a way to preview my script before i publish it. Was wondering if any chrome extensions exist that would allow me to load some new script into the browser so i can preview how the page looks straight away? (without doing any publishes etc) I use one called MagiCSS for previewing on the fly changes to CSS, was hoping something similar existed for javascript. So been trying the console as suggested I seem to need to refresh the page before the code is actually executed (possibly because i am using the jQuery document.ready function) Once page is refreshed however i lose my code from the console (even though this executes). Am i doing this right? It seems like it will need a lot of back and forth to get this right
has comment: http://stackoverflow.com/comment/47622174
has comment: http://stackoverflow.com/comment/47622453
answer count: 1
tagged with: jquery
has title: Chrome extension to add javascript onto a live page
has answer: http://stackoverflow.com/a/29744902

http://stackoverflow.com/a/29758496
has comment: http://stackoverflow.com/comment/47649485
has comment: http://stackoverflow.com/comment/47649287
score: 2
type: AcceptedAnswer
downvote count: 0
has body: IF all these pages are on the same site, I would use sessions. On each page, set a session to something you can test against later. On one page: //Start session first session_start(); //Then choose a keyword to put in the single quotes &amp; have it equal a unique number $_SESSION['page'] = 1; On another page: session_start(); $_SESSION['page'] = 2; On another page: session_start(); $_SESSION['page'] = 3; Then on the page where you want to display a phone number, do a test: session_start(); switch ($_SESSION['page']) { case 0: $phone="555-555-5555"; break; case 1: $phone="555-555-5556"; break; case 2: $phone="555-555-5557"; break; default: $phone="555-555-5558"; } Then, echo $phone Quick note, some shared hosting providers have issues using sessions out of the box, not sure why but I have run into it.
has comment: http://stackoverflow.com/comment/47649422
type: Answer
has comment: http://stackoverflow.com/comment/47649474
upvote count: 2
has comment: http://stackoverflow.com/comment/47649378
has comment: http://stackoverflow.com/comment/47649445
answers question: http://stackoverflow.com/q/29758369
accepted answer of: http://stackoverflow.com/q/29758369
has comment: http://stackoverflow.com/comment/47649296
has comment: http://stackoverflow.com/comment/47649360

http://stackoverflow.com/a/29713760
type: Answer
has comment: http://stackoverflow.com/comment/47562974
downvote count: 0
has comment: http://stackoverflow.com/comment/47562986
has comment: http://stackoverflow.com/comment/47563063
has body: Demo You need to update your swapIf implementation so that it swaps the model, not options from the view: function swapIf(sel,i1,i2) { if ( ! select[i1].selected &amp;&amp; select[i2].selected) { var obj1 = $scope.peoples[i1]; var obj2 = $scope.peoples[i2]; $scope.peoples[i2] = obj1; $scope.peoples[i1] = obj2; select[i1].selected = true; select[i2].selected = false; } } Also, remove the orderBy in the view, and initialize the ordering in the controller using the $filter service. The reason you need to do this is because the list is re-ordered whenever the user clicks the up/down button.
score: 5
has comment: http://stackoverflow.com/comment/47562657
has comment: http://stackoverflow.com/comment/47563035
has comment: http://stackoverflow.com/comment/47564652
answers question: http://stackoverflow.com/q/29713274
has comment: http://stackoverflow.com/comment/47562903
upvote count: 5

http://stackoverflow.com/q/29752099
upvote count: 1
possible better answer: http://stackoverflow.com/a/29752185
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29752207
score: 1
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29752207
has title: jQuery change time of setInterval using range input
has body: I am trying to access the time value of setInterval, however I am new in jQuery and JavaScript and I am not sure how can I achieve this. Here is what I have for now: 1000 And the code would be: $(function randomName() { setInterval(function(){ //alert("some text"); }, 10000); }); Here is a fiddle of what I have for now https://jsfiddle.net/mLk3wb50/ Is there a way to change the value of time, link it to the range input? Basically, I would like to execute the alert or whatever action at intervals set by the range input. Is this possible? Thanks!
has comment: http://stackoverflow.com/comment/47636371
tagged with: setinterval
favorite count: 0
has answer: http://stackoverflow.com/a/29752185

http://stackoverflow.com/comment/47934019
type: QuestionComment
has text: Sorry, bit brain dead today. You meant the console on my browser, didn't you? I do, in fact, have that, and have found the call causing the 404. So this has been quite helpful.
score: 0
comment on: http://stackoverflow.com/q/29760397
type: Comment

http://stackoverflow.com/q/29828626
tagged with: fade
has comment: http://stackoverflow.com/comment/47784859
type: Question
has comment: http://stackoverflow.com/comment/47783988
tagged with: javascript
tagged with: swiper.js
downvote count: 0
tagged with: jquery
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 2
has title: links doesn't work with swiper fade on
has body: I'm trying to make a site with the plugin swiper and the "fade" effect. The problem is that when I enable "fade", it makes all my links and text not clickable, like if it was an image (and I can't select text either) here is my script: var mySwiper = new Swiper('.swiper-container', { direction: 'vertical', effect: 'fade', fade: { crossFade: true }, SimulateTouch: false, mousewheelControl: true }); But when I delete 'effect: fade', it works (except no fade, but scroll instead) Sorry if I'm not clear, thank's for your answers.
answer count: 0

http://stackoverflow.com/q/29698080
tagged with: google-maps
tagged with: javascript
linked to: http://stackoverflow.com/q/29705792
has comment: http://stackoverflow.com/comment/47532430
tagged with: google-maps-api-3
score: 0
accepted answer: http://stackoverflow.com/a/29698231
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has title: how to fetch draggable marker latlng information
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has body: im making a solution that does the geocoding , i can get coords from adresse , and put a marker over this adresse , im trying to make this marker draggabele and everytime i change the marker position with the mouse , i must get the new cooords , can someone help me ? edit : Solution with event.addlistner this is my code (js + html ) Geocoding service
has answer: http://stackoverflow.com/a/29698231
linked to: http://stackoverflow.com/q/11030730
type: Question

http://stackoverflow.com/q/29718038
has answer: http://stackoverflow.com/a/29718671
accepted answer: http://stackoverflow.com/a/29718671
type: AnsweredQuestion
downvote count: 0
type: Question
score: 3
tagged with: javascript
has body: I am trying to use the email package but I keep getting the error: Exception while invoking method 'sendEmail' Error: connect ETIMEDOUT I20150418-09:24:22.233(-4)? at Object.Future.wait (/Users/tinzors/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:398:15) I20150418-09:24:22.233(-4)? at smtpSend (packages/email/email.js:76:1) I20150418-09:24:22.234(-4)? at Object.Email.send (packages/email/email.js:153:1) I20150418-09:24:22.234(-4)? at [object Object].Meteor.methods.sendEmail (app/server/methods/email.js:10:11) I20150418-09:24:22.234(-4)? at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1617:1) I20150418-09:24:22.234(-4)? at packages/ddp/livedata_server.js:648:1 I20150418-09:24:22.234(-4)? at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1) I20150418-09:24:22.234(-4)? at packages/ddp/livedata_server.js:647:1 I20150418-09:24:22.234(-4)? at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1) I20150418-09:24:22.234(-4)? at [object Object]._.extend.protocol_handlers.method (packages/ddp/livedata_server.js:646:1) I20150418-09:24:22.234(-4)? - - - - - I20150418-09:24:22.234(-4)? at errnoException (net.js:905:11) I20150418-09:24:22.234(-4)? at Object.afterConnect [as oncomplete] (net.js:896:19) Here is my click event that calls the email method: click .saveUserDetails': function(e, tmpl) { e.preventDefault(); 'click .saveUserDetails': function(e, tmpl) { e.preventDefault(); Meteor.call('sendEmail', 'demoemail@gmail.com', 'demoemail@gmail.com', 'Hello from Meteor!', 'user confirmed!'); } Here is my email environment setup: Meteor.startup(function() { process.env.MAIL_URL = 'smtp://demoemail@gmail.com:stackoverflowpw@smtp.gmail.com:25/'; }); And here is my email method: Meteor.methods({ sendEmail: function (to, from, subject, text) { check([to, from, subject, text], [String]); this.unblock(); Email.send({ to…
upvote count: 3
answer count: 1
tagged with: email
has title: Meteor email ETIMEOUT error
tagged with: meteor
favorite count: 0

http://stackoverflow.com/comment/47515064
type: Comment
comment on: http://stackoverflow.com/q/29688907
has text: I'll write up an answer.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47723160
type: QuestionComment
has text: @KhorneHoly I pass the value of the selected index over to a PHP page, which I also need on another page.
comment on: http://stackoverflow.com/q/29797367
score: 0
type: Comment

http://stackoverflow.com/a/29849705
accepted answer of: http://stackoverflow.com/q/29821171
answers question: http://stackoverflow.com/q/29821171
score: 5
upvote count: 5
has body: When using an ID as selector (in jstree functions), do not supply a leading #, use the ID only. As for the question - unfortunately that will not work, since jstree only keeps visible nodes in the DOM, meaning that if your LI node is not revealed (for example if its parent is closed) you will not be able to find it in the DOM. I am not sure that having a name attribute on a LI node is valid, but anyway - if you insist on finding the node this way, you will have to traverse the internal jstree model. Here is how you do it: http://jsfiddle.net/DGAF4/450/
type: AcceptedAnswer
downvote count: 0
type: Answer

typeahead
type: Tag
tag name: typeahead
tags question: http://stackoverflow.com/q/29789542

http://stackoverflow.com/comment/48099543
type: Comment
has text: @PedroLobito Thank you. I'll lay the blame with the biological interface.
type: AnswerComment
comment on: http://stackoverflow.com/a/29802862
score: 0

http://stackoverflow.com/comment/47521440
type: QuestionComment
type: Comment
has text: That's the problem actually. I'm not using main() so where do I write that script?
comment on: http://stackoverflow.com/q/29691166
score: 0

http://stackoverflow.com/q/29752591
type: AnsweredQuestion
has body: Have looked at the documentation and it should be possible to access the parent index using the following... {{#each columns}} {{#each rules}} {{@../index}} {{/each}} {{/each}} But I end up with this error message: Uncaught Error: Scoped data references are not supported: undefined Is there something wrong with the syntax?
tagged with: handlebars.js
has answer: http://stackoverflow.com/a/29753403
type: Question
has title: Handlebarjs - Access parent index - Uncaught Error: Scoped data references are not supported: undefined
score: 0
accepted answer: http://stackoverflow.com/a/29753403
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/29788813
tagged with: partial-application
possible better answer: http://stackoverflow.com/a/29789808
has answer: http://stackoverflow.com/a/29812556
answer count: 3
linked to: http://stackoverflow.com/q/9817809
tagged with: functional-programming
upvote count: 1
tagged with: higher-order-functions
favorite count: 0
has body: I'm trying to write a function utilizing callback that will mimic this behavior: var fullName = function (firstName, lastName) { return firstName + ' ' + lastName; }; var michaelName = partial(fullName, 'Michael'); michaelName('Moore'); // 'Michael Moore' michaelName('Jackson'); // 'Michael Jackson' I was stuck for a while trying to write a function named partial that will call back the function fullName but finally got it to work but am not sure if it's a) correct and b) exactly what is happening. var partial = function(callback, firstName) { var innerFunction = function(lastName) { //I declared an inner function in order to create a closure of the variable lastName return callback(firstName, lastName); //The closure is completed (or is it only then created?) by returning the function argument named callback taking firstName and lastName as arguments }; return innerFunction; //the function partial will finally return the closure, function innerFunction } var michaelName = partial(fullName, 'Michael'); console.log(michaelName('Moore')); //Michael Moore Is what I've written in defining the function partial the general pattern for writing a callback? If not, can someone show/point me to where I can study this pattern? Is there any other way to refactor this callback so that it's cleaner? I wasn't sure if I needed to create a new innerFunction but when I did I finally got the behavior to work as intended. Is my reasoning in the comments to the code accurate? Would somebody mind stepping through my code and further explaining what is happening, why callback is returned from innerFunction and why partial returns innerFunction instead of callback? Much obliged.
has answer: http://stackoverflow.com/a/29789808
linked to: http://stackoverflow.com/q/9596276
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29812565
downvote count: 0
score: 1
has title: Can somebody help me write and understand the partial application pattern?
type: Question
has answer: http://stackoverflow.com/a/29812565
tagged with: function
tagged with: javascript

http://stackoverflow.com/a/29834262
has body: There is an issue with the way you're using splice(). You are using it and expecting user.friends to be the resulting array. However, splice() actually changes the context array and returns the deleted items. So essentially, user.friends now holds the deleted items rather than the modified items. To fix this, just remove the assignment when you perform splice(): user.friends.splice(index, 1); instead of how you have it currently: user.friends = user.friends.splice(index, 1);
accepted answer of: http://stackoverflow.com/q/29834151
answers question: http://stackoverflow.com/q/29834151
type: Answer
downvote count: 0
score: 7
upvote count: 7
type: AcceptedAnswer

http://stackoverflow.com/q/29811075
tagged with: javascript
has comment: http://stackoverflow.com/comment/47784395
has comment: http://stackoverflow.com/comment/50441126
answer count: 1
has body: I'm developing a winform application and I want to use the google api v3 to calculate the barycenter of a polygon. and I have the lng and lat in my database. I want to call a java script function in c# I'm new but I found that using HtmlElement can help me do that here is the code I tried it doesn't give any result. WebBrowser webBrowser1 = new WebBrowser(); string url = ("C:\\Users/guenafai/Desktop/TOPApplication/TOPApplication/BaryScripts.htm"); Console.WriteLine("je suis laaaaaaaaaaaa"); webBrowser1.Navigate(url); HtmlElement head = webBrowser1.Document.CreateElement("head"); HtmlElement scriptEl = webBrowser1.Document.CreateElement("script"); scriptEl.SetAttribute("src","https://maps.googleapis.com/maps/api/js?key=AIzaSyAXBy6YDvNZOu0TK2RkrDmbNEbN3gn1sVk"); IHTMLScriptElement element = (IHTMLScriptElement)scriptEl.DomElement; string script = @" function BaryC(){ var boundss = new google.maps.LatLngBounds(); var i; var polygonCoords = ["; foreach (CONTRACT c in Clus) { script = script + @" new google.maps.LatLng(" + 45.501689 + "," + -73.567256 + @")," } script = script + @"new google.maps.LatLng(" + 45.501689 + "," + -73.567256 + @")]; for (i = 0; i &lt; polygonCoords.length; i++) { boundss.extend(polygonCoords[i]); } var lat = boundss.getCenter().lat() ; var lng = boundss.getCenter().lng(); return boundss.getCenter().toString() ; }"; Console.WriteLine(script); element.text = script; head.AppendChild(scriptEl); string onclickstring = (string)webBrowser1.Document.InvokeScript("BaryC"); Console.WriteLine(onclickstring);
downvote count: 0
favorite count: 0
tagged with: winforms
has answer: http://stackoverflow.com/a/31512755
tagged with: htmlelements
accepted answer: http://stackoverflow.com/a/31512755
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/50987017
type: Question
has comment: http://stackoverflow.com/comment/47831415
tagged with: c#
score: 3
has title: Create a java script function in c#
linked to: http://stackoverflow.com/q/5731224

http://stackoverflow.com/q/29742788
type: Question
has title: JavaScript: check if a css rule is applied to an element
score: 5
has comment: http://stackoverflow.com/comment/47619205
tagged with: javascript
has body: Is there any way to find out if a css rule (a string) is applied to a particular element on the page? For example: HTML: List item I want to check this element CSS: .list > li { color: red; } JS: var item = document.getElementById('item'); var rule = '.list > li'; isRuleApplied(rule, item); function isRuleApplied(rule, item) { // ??? // returns true if rule matches the item, false otherwise } [Edit] There used be a special function in WebKit/Blink that returned all the matched rules for the element - window.getMatchedCSSRules(node) - but it was deprecated and no longer works. Is there any better way than looping through all the selectors and checking if they match the element? Also, this way still doesn't allow you to check for :hover state easily, etc.
has comment: http://stackoverflow.com/comment/47618806
answer count: 3
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29742854
tagged with: css
favorite count: 0
has answer: http://stackoverflow.com/a/29742895
has comment: http://stackoverflow.com/comment/47618580
upvote count: 5
has answer: http://stackoverflow.com/a/29742854
accepted answer: http://stackoverflow.com/a/29742868
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/47618733
has comment: http://stackoverflow.com/comment/47619116
has answer: http://stackoverflow.com/a/29742868

http://stackoverflow.com/comment/47814345
type: Comment
type: QuestionComment
has text: @pres and why do you think that `window.delay` exists?
comment on: http://stackoverflow.com/q/29844090
score: 0

http://stackoverflow.com/comment/47662761
score: 0
comment on: http://stackoverflow.com/a/29765322
type: Comment
type: AnswerComment
has text: Same way call the data in anchor tag of just in any lable instead of title.

datetimepicker
type: Tag
tags question: http://stackoverflow.com/q/29739002
tag name: datetimepicker
tags question: http://stackoverflow.com/q/29801353
tags question: http://stackoverflow.com/q/29784236

http://stackoverflow.com/q/29831897
accepted answer: http://stackoverflow.com/a/29832068
has body: The array is this: [{name:'name1',id:'id1',val:'001}, ... {name:'name10',id:'id10',val:'010}] We want to store in the database as a long text string: name1,id1,001;...;name10,id10,010 values separated by semicolon and comma. Is there any convenient join or something else to achieve it? (I guess there must be something better than for loop.)
has comment: http://stackoverflow.com/comment/47790671
type: Question
has answer: http://stackoverflow.com/a/29832126
tagged with: javascript
has title: How to convert a object array into string in JavaScript?
possible better answer: http://stackoverflow.com/a/29832137
score: 0
has answer: http://stackoverflow.com/a/29832137
answer count: 3
has answer: http://stackoverflow.com/a/29832068
has comment: http://stackoverflow.com/comment/47790508
linked to: http://stackoverflow.com/q/5525795
type: AnsweredQuestion

http://stackoverflow.com/comment/47673053
type: Comment
comment on: http://stackoverflow.com/q/29771195
score: 0
has text: Please post your complete HTML code.
type: QuestionComment

http://stackoverflow.com/q/29696189
tagged with: javascript
answer count: 3
upvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/30506296
has answer: http://stackoverflow.com/a/29697631
accepted answer: http://stackoverflow.com/a/29697868
type: AnsweredQuestion
downvote count: 0
has body: I have problems with running multiple browser windows in Protractor. The sample code tested is written out below: I fork the browser to get a new window and to some tests. When i write input into the original browser, the forked one shouldn't have that input. Everything works fine except that afterwards the forked browser never shuts down and some kind of error message is written to the output. My test suite: 'use strict'; describe('testing', function () { it('should work', function () { browser.get('http://angularjs.org'); var browser2 = browser.forkNewDriverInstance(true); element(by.name('as_q')).sendKeys('search'); expect(browser2.element(by.name('as_q')).getText()).toBe(''); }); }); And this is my config: exports.config = { framework: 'jasmine2', capabilities: { 'browserName': 'chrome' }, baseUrl: 'http://localhost:4000', specs: 'test.spec.js', jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 30000 } }; And this is what is written out to stdout when running protractor in the terminal: Starting selenium standalone server... [launcher] Running 1 instances of WebDriver Selenium standalone server started at http://&lt;my-ip-adress&gt;:54721/wd/hub Started . 1 spec, 0 failures Finished in 8.755 seconds Shutting down selenium standalone server. /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:145 callback(new Error(message)); ^ Error: ECONNREFUSED connect ECONNREFUSED at ClientRequest.&lt;anonymous&gt; (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:145:16) at ClientRequest.emit (events.js:95:17) at Socket.socketErrorListener (http.js:1552:9) at Socket.emit (events.js:95:17) at net.js:441:14 at process._tickCallback (node.js:442:13) From: Task: WebDriver.quit() at [object Object].webdriver.WebDriver.schedule (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:360:15) at [object Object].webdriver.WebDriver.quit (/usr/local/lib/node_modul…
score: 1
has title: Forked driver instance never quits
tagged with: selenium
tagged with: webdriver
type: Question
has answer: http://stackoverflow.com/a/29697868
possible better answer: http://stackoverflow.com/a/29697631
tagged with: protractor

http://stackoverflow.com/comment/47804361
score: 0
has text: Then add a check for it.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29838908

http://stackoverflow.com/q/29698796
tagged with: http://stackoverflow.com/tag/json
type: Question
linked to: http://stackoverflow.com/q/18234448
answer count: 8
has comment: http://stackoverflow.com/comment/47562181
linked to: http://stackoverflow.com/q/18467418
has title: How to convert html table to excel with multiple sheet?
has answer: http://stackoverflow.com/a/40475276
has comment: http://stackoverflow.com/comment/47569032
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47569595
has answer: http://stackoverflow.com/a/59836753
linked to: http://stackoverflow.com/q/26301811
has answer: http://stackoverflow.com/a/46981214
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
score: 30
has answer: http://stackoverflow.com/a/62954138
has answer: http://stackoverflow.com/a/56037196
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/24636956
has body: How can I convert multiple html tables to an excel sheet with multiple worksheets? Could you please help into this. My example https://jsfiddle.net/kdkd/5p22gdag/ function tablesToExcel() { { var tab_text = "&lt;table border='2px'&gt;&lt;tr bgcolor='#87AFC6'&gt;"; var textRange; var j = 0; tab = document.getElementById('tbl2'); // id of table for (j = 0 ; j &lt; tab.rows.length ; j++) { tab_text = tab_text + tab.rows[j].innerHTML + "&lt;/tr&gt;"; //tab_text=tab_text+"&lt;/tr&gt;"; } tab_text = tab_text + "&lt;/table&gt;"; var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie &gt; 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer { txtArea1.document.open("txt/html", "replace"); txtArea1.document.write(tab_text); txtArea1.document.close(); txtArea1.focus(); sa = txtArea1.document.execCommand("SaveAs", true, "Say Thanks to Sumit.xls"); } else //other browser not tested on IE 11 sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text)); return (sa); } }
has answer: http://stackoverflow.com/a/60793095
downvote count: 1
has answer: http://stackoverflow.com/a/34655810
has comment: http://stackoverflow.com/comment/47673062
has comment: http://stackoverflow.com/comment/47535636
has answer: http://stackoverflow.com/a/29717451
upvote count: 31

http://stackoverflow.com/comment/47589041
comment on: http://stackoverflow.com/a/29727219
type: Comment
has text: What I'm saying is that clicking the forms in fiddle works every time. When you click in fiddle is what is happening there happening on your site as well? Do you have the same jquery plugins from the fiddle referenced on your site?
type: AnswerComment
score: 0

http://stackoverflow.com/q/29773381
tagged with: phantomjs
type: AnsweredQuestion
score: 2
tagged with: http://stackoverflow.com/tag/json
type: Question
has title: Highcharts server side image generation, how to set up legend labelFormatter in callback argument
has answer: http://stackoverflow.com/a/29793220
tagged with: highcharts
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47680467
answer count: 1
accepted answer: http://stackoverflow.com/a/29793220
favorite count: 0
upvote count: 2
has body: I'am working on a PDF file generator that user Highcharts server side image generation to populate graph information in the document. http://www.highcharts.com/docs/export-module/render-charts-serverside Everything work great and i would customize my highchart legend to get one legend per line at the bottom of the graph. Because the server side generation use JSON format, i could not set the "legend.labelFormatter" callback to force break line after each legend. There is a simple exemple in the readme of source code, but I can not fit my needs. (https://github.com/highslide-software/highcharts.com/tree/master/exporting-server/phantomjs) The readme exemple : function(chart) { chart.renderer.arc(200, 150, 100, 50, -Math.PI, 0).attr({ fill : '#FCFFC5', stroke : 'black', 'stroke-width' : 1 }).add(); } My own callback function(chart){ console.log('COOL!'); chart.legend.labelFormatter = function () { console.log('COOL 2!'); return this.name + "\n"; }; chart.redraw(); }

http://stackoverflow.com/q/29843129
type: Question
tagged with: javascript
tagged with: google-api-js-client
upvote count: 3
downvote count: 0
favorite count: 0
has body: I am trying to use the google analytics api (javascript) to display some charts (combined to charts.js). I followed instructions here : tuto gapi I created an application and I replaced my clientId in the code but I have the error : gapi.analytics.ext is undefined Here is my code : Does anyone know how to configure my app? Did I do someting wrong? Thanks for help !
type: UnansweredQuestion
has title: Gapi analytics ext undefined (js)
tagged with: google-analytics-api
score: 3
answer count: 0

http://stackoverflow.com/comment/47656643
comment on: http://stackoverflow.com/a/29740945
has text: @MörreNoseshine `undefined` is actually _non-writable_ and _non-configurable_ in the _Global Namespace_, `undefined=42; undefined; // undefined` which makes it safer to use than something like `Array`, `RegExp`, `console`, `atob`, `btoa`, etc. This means the only way your code can end up with a wrong _undefined_ is if it's interpreted under a closure which has re-defined it, shadowing the global namespace (although you could still go via `window.undefined`).
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47678326
score: 0
type: Comment
type: QuestionComment
has text: What do you consider a "key" in this data?
comment on: http://stackoverflow.com/q/29773962

http://stackoverflow.com/a/31252724
answers question: http://stackoverflow.com/q/29774583
score: 1
upvote count: 1
downvote count: 0
has body: The best way is to pass the row as a parameter to your modal function. &lt;tr ng-click="open(row)" ng-repeat="row in rows track by $index"&gt; ... &lt;/tr&gt; And in your funcition, recive the row: $scope.openModal = function (row) { var modalInstance = $modal.open({ templateUrl: '/partials/submission_mod.html', controller: 'ModalCtrl', resolve: { cat: function () { return row; } } }); }; And then pass to your controller: .controller('ModalCtrl', function ($scope, $modalInstance, cat) { $scope.cat = cat; });
type: Answer

http://stackoverflow.com/comment/47788023
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29830634
has text: Does this work with any `XMLHttpRequest`, or only with `$.ajax` requests?
type: AnswerComment

http://stackoverflow.com/comment/47553205
has text: @BenBlack that is what I've done,,your is also too good answer. :)
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29708024
type: Comment

http://stackoverflow.com/comment/47694664
score: 1
comment on: http://stackoverflow.com/a/29781892
type: AnswerComment
has text: When will those be different?
type: Comment

http://stackoverflow.com/a/29781977
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/29781833
type: Answer
has body: https://dom.spec.whatwg.org/#interface-domtokenlist : If force is not given, "toggles" token, removing it if it’s present and adding it if it’s not. If force is true, adds token (same as add()). If force is false, removes token (same as remove()). Returns true if token is now present, and false otherwise. I think the spec is clear enough.
score: 2

http://stackoverflow.com/q/29824906
has title: ajax call in IE is extremely slow
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/715882
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/47776464
has answer: http://stackoverflow.com/a/29825160
has comment: http://stackoverflow.com/comment/47776385
type: Question
score: 0
has answer: http://stackoverflow.com/a/29825072
has comment: http://stackoverflow.com/comment/47776224
has body: I have the following Ajax code in my web page. It basically makes an Ajax call to the database and returns a bunch of records. This code runs fast / well in Firefox but very slow in IE. I'm just wondering if there are any ways to optimize this code for IE. Code var fill_test_table = function(data){ var tr; for (var i=0; i &lt; data.length; i++) { tr=$('&lt;tr/&gt;'); tr.append("&lt;td&gt;" + widget[i].name + "&lt;/td&gt;"); tr.append("&lt;td&gt;" + widget[i].age + "&lt;/td&gt;"); tr.append("&lt;td&gt;" + widget[i].status + "&lt;/td&gt;"); tr.append("&lt;a href='widget.html?id=" + widget[i].id + "&amp;age=" + widget[i].age + "&amp;status=" + widget[i].status + "&amp;name=" + widget[i].name.replace("'","%27") + "'&lt;/a&gt;&lt;button&gt;Edit&lt;/button&gt;&amp;nbsp;&lt;/td&gt;"); $("#widget_table").append(tr); } $("#widget_table").append("&lt;/tbody&gt;"); }; $(document).ready ( function() { $.ajax({ url: "/cgi-bin/getwdigets", dataType: "json", success: function(data) { fill_test_table(data); } }); }) I found the following post jQuery Ajax call very slow in IE, but instant in Firefox and have tried to implement some of the suggestions made. But if there are any obvious items that should be fixed, I'd like to know.
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47776575
has answer: http://stackoverflow.com/a/29825202
has comment: http://stackoverflow.com/comment/47776203
tagged with: ajax
has answer: http://stackoverflow.com/a/29825212
possible better answer: http://stackoverflow.com/a/29825202
has comment: http://stackoverflow.com/comment/47776358
answer count: 4
accepted answer: http://stackoverflow.com/a/29825212
has comment: http://stackoverflow.com/comment/47776727
has comment: http://stackoverflow.com/comment/47777204
has comment: http://stackoverflow.com/comment/47776938

http://stackoverflow.com/a/29719443
downvote count: 0
has body: One way to approach this would be with the use of regular expressions. Assuming whatever input, you can do something like var expression = /(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/gi; var matches = input.match(expression); Then, you can iterate through the matches to discover there starting and ending points with the use of indexOf for(match in matches) { var result = {}; result['link'] = matches[match]; result['startsAt'] = input.indexOf(matches[match]); result['endsAt'] = input.indexOf(matches[match]) + matches[match].length; } Of course, you may have to tinker with the regular expression itself to suit your specific needs. You can see the results logged by console in this fiddle
type: Answer
accepted answer of: http://stackoverflow.com/q/29718962
upvote count: 14
answers question: http://stackoverflow.com/q/29718962
has comment: http://stackoverflow.com/comment/47574318
score: 14
type: AcceptedAnswer

http://stackoverflow.com/comment/48726199
type: AnswerComment
comment on: http://stackoverflow.com/a/29929013
type: Comment
has text: I want to disable it because I'm using this system on a kiosk. There are quite a few features I'd like to have available, such as: disable auto-login timeout (so the popup will auto close if there is no activity within a time frame). -With the ability to also call a response function on the parent. That way it would be able to tell the parent that the system timed out, not just cancelled. temporary-cookies only (I think this is already happening). customizable dynamic logo.
score: 0

http://stackoverflow.com/q/29810692
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29810775
has answer: http://stackoverflow.com/a/29810758
has comment: http://stackoverflow.com/comment/47749392
type: Question
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47795318
score: 0
tagged with: http://stackoverflow.com/tag/json
has body: I am working on creating a page using html and javascript. I have json file that proves inputs to some of the contents i need. What Im trying to do is to have address variable setup so that google map API can be displayed on my page. Google Maps JavaScript API v3 Example: Geocoding Simple above is part of the code. the address variable has to look like var address= "google Company, Austin, TX" for google to recognize it properly. if i know for fact that json returns exactly what im asking, what could be the problem here? how could i go about fixing it? updated to ease some confusions. when i view the source code on my website, i see that returned values are strings... Google Maps JavaScript API v3 Example: Geocoding Simple
has title: adding strings in javascript
tagged with: google-maps
has comment: http://stackoverflow.com/comment/47749759

http://stackoverflow.com/q/29760761
upvote count: 8
has answer: http://stackoverflow.com/a/29766052
has body: I'm trying to encrypt and decrypt data on the server side and the client using the same type of operation, which is AES-256. On the server I use PHP and client I use CryptoJS so far I could only encrypt and decrypt the client on the server, see the code: JS &lt;script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"&gt;&lt;/script&gt; &lt;script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/pbkdf2.js"&gt;&lt;/script&gt; &lt;script&gt; var salt = CryptoJS.lib.WordArray.random(128/8); var key256Bits500Iterations = CryptoJS.PBKDF2("Secret Passphrase", salt, { keySize: 256/32, iterations: 500 }); var iv = CryptoJS.enc.Hex.parse('101112131415161718191a1b1c1d1e1f'); var encrypted = CryptoJS.AES.encrypt("Message", key256Bits500Iterations, { iv: iv }); var data_base64 = encrypted.ciphertext.toString(CryptoJS.enc.Base64); var iv_base64 = encrypted.iv.toString(CryptoJS.enc.Base64); var key_base64 = encrypted.key.toString(CryptoJS.enc.Base64); &lt;/script&gt; PHP &lt;?php $encrypted = base64_decode("data_base64"); // data_base64 from JS $iv = base64_decode("iv_base64"); // iv_base64 from JS $key = base64_decode("key_base64"); // key_base64 from JS $plaintext = rtrim( mcrypt_decrypt( MCRYPT_RIJNDAEL_128, $key, $encrypted, MCRYPT_MODE_CBC, $iv ), "\t\0 " ); How can I encrypt and decrypt data on both sides (client and server) so that communicate in the same language using PHP and CryptoJS?
tagged with: encryption
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47682513
type: Question
accepted answer: http://stackoverflow.com/a/29766052
has title: AES 256 on the client side (JS) and in the server (PHP)
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/7314901
has comment: http://stackoverflow.com/comment/47683771
has comment: http://stackoverflow.com/comment/47680382
has comment: http://stackoverflow.com/comment/47683232
has comment: http://stackoverflow.com/comment/47681801
answer count: 1
tagged with: cryptography
tagged with: cryptojs
favorite count: 0
score: 8

http://stackoverflow.com/a/29818807
score: 3
downvote count: 0
type: Answer
has body: The solution is to call the .refreshQueries() method of the component when the new object is successfully created in Parse as described here. My updated example: ParseReact.Mutation.Create('Place', { name: 'New Place', user: Parse.User.current() }) .dispatch() .then(function() { this.refreshQueries(); }.bind(this)); Thanks very much to Joshua Sierles over on the ParseReact github repo for pointing me to the solution. If you are on SO Joshua I'll give you the credit if you post your answer here :D
upvote count: 3
answers question: http://stackoverflow.com/q/29800798

http://stackoverflow.com/a/29818067
downvote count: 0
has comment: http://stackoverflow.com/comment/47762980
has comment: http://stackoverflow.com/comment/47763047
has comment: http://stackoverflow.com/comment/47763106
type: Answer
score: 3
upvote count: 3
has body: if (document.referrer.indexOf('facebook.com') &gt; -1) { // do something for visitors from facebook here }
answers question: http://stackoverflow.com/q/29817936
has comment: http://stackoverflow.com/comment/47763409
has comment: http://stackoverflow.com/comment/47763206

http://stackoverflow.com/q/29834365
score: 1
has answer: http://stackoverflow.com/a/29834459
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
tagged with: http
has answer: http://stackoverflow.com/a/29834525
has body: In the controller i would like to put the http request of a json file into a function. Only when its outside of a function it works. Why? I would like to display the contents in the view. Controller: $http.get('components/json/list.json').success(function (data) { main.listNoFunction = data; }); main.listFunction = function () { var result = null; $http.get('components/json/list.json').success(function (data) { result = data; }); return result; } View: // This works: {{ main.listNoFunction }} // This works NOT: {{ main.listFunction }} Thanks for your help! Vin
type: Question
has title: Angularjs - $http request does not work from inside a function
has comment: http://stackoverflow.com/comment/47795643
tagged with: javascript
answer count: 2
tagged with: function
downvote count: 0

http://stackoverflow.com/a/29996365
score: 2
has body: Spent all day wrestling with this issue and it ended up being due to console.warn calls from React.PropTypes validation failures. Once we fixed these PropType issues, IE9 started working again. (our issues were from data having undefined values instead of strings, and a suggestion to use the key attribute on some JSX) HTML Boilerplate has a solution for this, which everybody should use: https://github.com/h5bp/html5-boilerplate/blob/master/src/js/plugins.js#L2-L22 // Avoid `console` errors in browsers that lack a console. (function() { var method; var noop = function () {}; var methods = [ 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn' ]; var length = methods.length; var console = (window.console = window.console || {}); while (length--) { method = methods[length]; // Only stub undefined methods. if (!console[method]) { console[method] = noop; } } }()); Same issue as this: Why does JavaScript only work after opening developer tools in IE once?
answers question: http://stackoverflow.com/q/29786154
has comment: http://stackoverflow.com/comment/48114825
has comment: http://stackoverflow.com/comment/48114752
downvote count: 0
has comment: http://stackoverflow.com/comment/48112467
upvote count: 2
has comment: http://stackoverflow.com/comment/48117720
type: Answer

http://stackoverflow.com/q/29834259
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
linked to: http://stackoverflow.com/q/7311913
answer count: 1
has title: Javascript scope/hoisting OR promises/deferreds?
favorite count: 0
accepted answer: http://stackoverflow.com/a/29834333
has body: I am trying to make an external AJAX call to an API within a Jquery each loop. Here is the code I have so far. getStylesInfo(tmpMake, tmpModel, tmpModelYear, tmpSubmodel).done(function(data){ var holder = []; $.each(styles, function(index, value) { var tempValue = value; var temp = getNavigationInfo(value.id); $.when(temp).done(function(){ if(arguments[0].equipmentCount == 1){ holder.push(tempValue); console.log(holder); } }); }); }); console.log(holder); function getStylesInfo(make, model, year, submodel){ return $.ajax({ type: "GET", url: apiUrlBase + make + '/' + model + '/' + year + '/' + 'styles? fmt=json&amp;' + 'submodel=' + submodel + '&amp;api_key=' + edmundsApiKey + '&amp;view=full', dataType: "jsonp" }); function getNavigationInfo(styleId){ return $.ajax({ type: "GET", url: apiUrlBase + 'styles/' + styleId + '/equipment?availability=standard&amp;name=NAVIGATION_SYSTEM&amp;fmt=json&amp;api_key=' + edmundsApiKey, dataType: "jsonp" }); The getStylesInfo() returns something similar to this. An array of objects with info about a car model. var sampleReturnedData = [{'drivenWheels': 'front wheel drive', 'id': 234321}, {'drivenWheels': 'front wheel drive', 'id': 994301}, {'drivenWheels': 'rear wheel drive', 'id': 032021}, {'drivenWheels': 'all wheel drive', 'id': 184555}]; I am trying to loop through the sampleReturnedData and use each id as a parameter in a different AJAX call with the getNavigationInfo() function. I want to loop through the results and make a check. If it is true then I want to push the entire object to the holder array. The problem is the console.log(holder) outside the function returns an empty array. The console.log(holder) within the if statement works properly. I am not sure if this is a scope/hoisting issue or a problem with the way I am using deferreds? I have read this question and many like it. They suggest to use either async:false Or to rewrite the code better. I have tried and used console debugger numerous times. I don't want to s…
tagged with: hoisting
linked to: http://stackoverflow.com/q/23667086
upvote count: 1
type: AnsweredQuestion
score: 1
type: Question
has answer: http://stackoverflow.com/a/29834333
tagged with: jquery-deferred

http://stackoverflow.com/q/29796115
type: Question
has answer: http://stackoverflow.com/a/29804495
has comment: http://stackoverflow.com/comment/47720850
tagged with: jquery-blockui
has body: I'm trying to use blockUI but although it passes over with no errors, it doesn't work the code below is all within the $(document).ready() function $("#btnSaveJob").click(function () { if ($("#frmJobDetails").valid()) { $("#frmJobDetails").submit(); } }); $("#frmJobDetails").submit(function (e) { $('#jobDetails').block({ message: 'Saving, please wait...', centerX: true, centerY: true, css: { width: '600px', height: '300px', border: '3px solid #FF9900', backgroundColor: '#000', color: '#fff', padding: '25px' } }); submitNew('job'); e.preventDefault(); $('#jobDetails').unblock(); }); edit to add in the submitNew function function submitNew(submitType) { // various variables set here if (submitType == 'job') { PageMethods.SubmitJobForm(propID, dateReceived, targetResponse, targetComplete, chargeable, jobTypeID, jobTypeText, contractID, contractText, csJobTypeID, csJobTypeText, priorityID, priorityText, status, notes, fnsuccesscallbackJob, fnerrorcallback); } else if (submitType == 'instruction') { PageMethods.SubmitInstruction(fnsuccesscallbackInstruction, fnerrorcallback); } else { } } have to add this bit in as editor complaining I've added too much code....
has comment: http://stackoverflow.com/comment/47720345
has comment: http://stackoverflow.com/comment/47720680
upvote count: 2
has comment: http://stackoverflow.com/comment/47720524
has comment: http://stackoverflow.com/comment/47720596
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47720418
possible better answer: http://stackoverflow.com/a/29796354
has comment: http://stackoverflow.com/comment/47720950
has answer: http://stackoverflow.com/a/29796354
has comment: http://stackoverflow.com/comment/47720658
favorite count: 0
score: 2
type: AnsweredQuestion
has title: jQuery blockUI not working
downvote count: 0
has answer: http://stackoverflow.com/a/41806098
accepted answer: http://stackoverflow.com/a/29804495
answer count: 5
has answer: http://stackoverflow.com/a/61243477
has answer: http://stackoverflow.com/a/47901543
has comment: http://stackoverflow.com/comment/47720688

http://stackoverflow.com/q/29802787
tagged with: javascript
linked to: http://stackoverflow.com/q/15722433
score: 0
has comment: http://stackoverflow.com/comment/47733557
has title: How do I reverse an array in JavaScript while preserving the original value of the original array?
has answer: http://stackoverflow.com/a/29802851
has comment: http://stackoverflow.com/comment/47733520
answer count: 1
tagged with: arrays
linked to: http://stackoverflow.com/q/23666679
tagged with: reverse
linked to: http://stackoverflow.com/q/3978492
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47733607
duplicate of: http://stackoverflow.com/q/3978492
type: Question
has body: I'm trying to reverse the order of an array using the .reverse() method in JavaScript, but also trying to preserve the original order of elements in the original array. When I save the values into a variable, I end up transposing the elements in the original array as well as creating a new one with the same format. What is the most eloquent way to perform this task? var arrayOne = [1,2,3,4,5]; var arrayTwo = arrayOne.reverse(); //arrayTwo = [5, 4, 3, 2, 1] //arrayOne = [5, 4, 3, 2, 1]
has comment: http://stackoverflow.com/comment/47733854

http://stackoverflow.com/comment/47679610
comment on: http://stackoverflow.com/a/29774330
has text: Aha! I added some code to the script that checks for success, then refreshes the page and everything is working now. Thanks!
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47717775
comment on: http://stackoverflow.com/q/29794765
score: 0
has text: maybe use for result parseInt(result) if expect 1 or 0 and compare with integer not string
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29774366
type: Answer
has body: When you're trying to "protect" characters, you have to keep in mind what you're protecting them from. In this case, there are two interpreters you have to worry about: You're building HTML, so you have to worry about the HTML parser; You're building a URL, so you have to worry about how the browser and the server will parse the URL. To deal with the first problem, you can replace the quotes with the HTML entity equivalent (&amp;#39;). To deal with the second, you can use encodeURIComponent(). I think you'd want to do the encodeURIComponent() call first, to avoid having the HTML entity notation get messed up. The entity notation will be gone after the HTML parser is finished with the string anyway: function qEncode(str) { return encodeURIComponent(str).replace(/'/g, "&amp;#39;"); } To use that: tr.append("&lt;a href='add_widget.html?id=" + qEncode(data[i].id) + "&amp;pg=" + qEncode(data[i].page_number) + "&amp;dest=" + qEncode(data[i].dest) + "&amp;name=" + qEncode(data[i].name) + "'&lt;/a&gt;&lt;button class='btn btn-xs btn-primary'&gt;Edit&lt;/button&gt;&amp;nbsp;&lt;/td&gt;" ); Note that you could also encode double-quote characters too. A totally different way of working around this problem would be to build the DOM content with DOM APIs. By doing that, you'd completely avoid the HTML parser, and you'd just need encodeURIComponent().
has comment: http://stackoverflow.com/comment/47679664
has comment: http://stackoverflow.com/comment/47679170
answers question: http://stackoverflow.com/q/29774021
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47679348
upvote count: 1

http://stackoverflow.com/comment/47780551
comment on: http://stackoverflow.com/a/29814457
type: AnswerComment
has text: Thanks, this works! Also do you know why if I change the `.setView` to another coordinates such as `41.9, -431.5`, why hexagon shapes will not show up?
type: Comment
score: 0

http://stackoverflow.com/comment/47737581
type: Comment
has text: @tags pre-wrap doesn't seem to help much http://plnkr.co/edit/P6L0wGv5fMz7ZkgdnG7w?p=preview
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29803998

http://stackoverflow.com/a/29839022
has body: Basically, when you deploy the web app to heroku. It tries to minimize and precompile all files and store them in assets folder(or different folder name) with different names. I do not know what kind of framework you are using for your website. If you are using Ruby On Rails framework, I recommend that you create images folder in public and store all your images here (this is the easiest way).
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29838064

http://stackoverflow.com/a/29812561
downvote count: 0
score: 6
type: Answer
upvote count: 6
accepted answer of: http://stackoverflow.com/q/29812511
answers question: http://stackoverflow.com/q/29812511
has body: On every iteration you add i days to your initial date - so it keeps accumulating (+1, +2, +3 etc). You need to add not i but simply 1 to fortnightStart. var fortnightStart = moment("15 04 2015", "DD MM YYYY"); for (var i = 1; i &lt;= 15; i++) { // 1, not i dates.push(fortnightStart.add(1, "days").format("D MMM")); } console.log(dates);
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47753163
has comment: http://stackoverflow.com/comment/47753194

http://stackoverflow.com/comment/47605681
score: 0
type: Comment
type: QuestionComment
has text: What code would you like me to include? I don't actually know what is causing it because its a safari thing. But i can't really add the entirety of the code for the site?
comment on: http://stackoverflow.com/q/29736212

http://stackoverflow.com/q/29767853
has title: Access Java object in JSP
has comment: http://stackoverflow.com/comment/47667454
has comment: http://stackoverflow.com/comment/47667215
has comment: http://stackoverflow.com/comment/47666578
has comment: http://stackoverflow.com/comment/47667003
has comment: http://stackoverflow.com/comment/47667760
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47667521
score: 1
has body: I have some JSP code I'm trying to modify. I have a user object that holds and generates a CSRF values. Currently, this value is set at the start of the application and remains constant throughout the application. I have to change this such that it resets each time a new page is accessed. The code currently is &lt;script type='text/javascript'&gt; var csrfTokenName = 'csrfValue'; var csrfTokenValue = '${user.csrfValue}'; //user is the object, which also contains a setCsrfValue() method that generates the CSRF value var csrfParam = {csrfValue : csrfTokenValue}; function csrfUrl(url) { if (url.indexOf('?') == -1) { //setCSRF code here return url+'?'+csrfTokenName+'='+csrfTokenValue; } else { //setCSRF code here return url+'&amp;'+csrfTokenName+'='+csrfTokenValue; } } &lt;/script&gt; I tried adding this &lt;% User user = (User) session.getAttribute('user'); //fixed typo %&gt; In the script but the page won't load (on that note, is there a tool/setting for debugging JSP, using STS with Tomcat and Firefox) How do I reference this object correctly so that I can call setCsrfValue(); I tried the following but the page didn't load &lt;% User user = (User) session.getAttribute('user'); //fixed typo user.setCsrfValue(); %&gt;
has comment: http://stackoverflow.com/comment/47667099
type: Question
tagged with: debugging
has comment: http://stackoverflow.com/comment/47667634
has comment: http://stackoverflow.com/comment/47667283
downvote count: 0
tagged with: csrf
tagged with: jsp
tagged with: javascript
tagged with: tomcat

http://stackoverflow.com/q/29752980
score: 2
tagged with: popup
tagged with: sapui5
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47713560
type: Question
has title: popup (like sap.m.dialog) with multiple windows
upvote count: 2
has body: I´m planning to create a popup window, which has multiple views/screens/or something like that where you can navigate through. I want to keep it responsive so my initial thought was using sap.m.dialog. I´m also using only XML views/fragments and I want to keep it stringent. I looked at the test ressources and found something pretty usefull for sap.ui.commons.Dialog - Dialog - SAPUI5 Demo Kit Even though the idea is good, it doesn´t seem to work with sap.m.Dialog (especially the last example with XML fragments). Does anyone of you know how to create a responsive popup with different screens (maybe a fragment for each view) where you can navigate through? My approaches so far do not look very promissing, but I could also post some code if that helps. Thanks in advance!
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/29845180
tagged with: javascript
favorite count: 0
tagged with: multi-window
has comment: http://stackoverflow.com/comment/47794625

http://stackoverflow.com/comment/47793974
has text: [`String.split()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)
comment on: http://stackoverflow.com/q/29833642
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29718378
downvote count: 0
answers question: http://stackoverflow.com/q/29718328
score: 1
has comment: http://stackoverflow.com/comment/47571296
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47571415
has comment: http://stackoverflow.com/comment/47571395
has body: You should use .change() to detect when the checkbox has been fired: $("input[name=check]").change(function() { if($(this).is(":checked")) $(this).parent().find("input[name=number]").attr("disabled","disabled"); else $(this).parent().find("input[name=number]").removeAttr("disabled"); }); Like above, you should check if the checkbox is :checked or not to set the disabled value. Then, you can search the checkbox's parent() to find the correct sibling to disable. Demo: http://jsfiddle.net/zj88pLe6/3/
type: Answer
accepted answer of: http://stackoverflow.com/q/29718328

http://stackoverflow.com/a/29773769
answers question: http://stackoverflow.com/q/29773577
has comment: http://stackoverflow.com/comment/47678429
has comment: http://stackoverflow.com/comment/47680373
has comment: http://stackoverflow.com/comment/47678247
has body: The code you provided will not function as you may think. Atleast not if you use both together. Both codes introduce a new module jointApp and actually only the first one defines a controller. The $scope of that controller is NOT the same of the function in your second code. If you want to call a method from outside of a controller take a look at events in angular. That would be the best way to archive this. You could also use a dummy object and two-way-bind it (scope: { dummy: '=' }) and then call the method you create on that object in your directive from other code-parts. Take a look at this plnkr demonstrating both approaches. http://plnkr.co/edit/YdcB10UpXGqKAxYzXISL?p=preview
has comment: http://stackoverflow.com/comment/47678089
score: 0
has comment: http://stackoverflow.com/comment/47678670
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47681173
accepted answer of: http://stackoverflow.com/q/29773577

http://stackoverflow.com/a/29788073
upvote count: 2
answers question: http://stackoverflow.com/q/29787611
has comment: http://stackoverflow.com/comment/47741521
type: AcceptedAnswer
downvote count: 0
has body: I played with your sample, and made it (perhaps) work based on what I think you're trying to achieve. Sorry if I misunderstood. The jsfiddle is here: https://jsfiddle.net/6s5h1dar/1/ Essentially I modified your code using help from this page: http://howtocenterincss.com/ Modified HTML: &lt;div id="bubbleWrap"&gt; &lt;div id="middleBubble"&gt;&amp;nbsp;&lt;/div&gt; &lt;/div&gt; Modified CSS: #bubbleWrap { display: table-cell; vertical-align: middle; height: 485px; width: 485px; } #middleBubble { background: url(../img/circle/9.png); background-repeat: no-repeat; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; color: #252525; font-size: 1em; text-align: center; } Does that suit your needs?
has comment: http://stackoverflow.com/comment/47753678
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29787611

http://stackoverflow.com/q/29712400
has comment: http://stackoverflow.com/comment/47560299
tagged with: android
linked to: http://stackoverflow.com/q/4481058
has comment: http://stackoverflow.com/comment/47560414
tagged with: cordova
type: UnansweredQuestion
has body: I have to access cellid in index.html from signal.js java script file , cellid is defined in signal.js file. currently am using require function in index.html to get signal object, but this is not working **index.html** &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" charset="utf-8" src="signal.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" charset="utf-8"&gt; var signal = require ("signal"); alert("CellID : "+ signal.cellID); var CellID = signal.cellID; &lt;/script&gt; &lt;/head&gt; &lt;/html&gt; signal.js var exec = require('cordova/exec'), cordova = require('cordova'); var Signal = function() { this.imei = null; this.operator = null; this.cellID = null; this.lac = null; this.neighbors = {}; // Create new event handlers on the window (returns a channel instance) this.channels = { watchingnetwork: cordova.addWindowEventHandler("watchingnetwork") }; for (var key in this.channels) { this.channels[key].onHasSubscribersChange = Signal.onHasSubscribersChange; } }; Signal.onHasSubscribersChange = function() { exec(signal.status, signal.error, "Signal", "getSignalInfo", []); } /** * Callback for signal initiated * * @param {Object} info keys: imei, isPlugged */ Signal.prototype.status = function(info) { cordova.fireWindowEvent("watchingnetwork", info); if (info) { if (signal.imei !== info.imei || signal.operator !== info.operator) { if (info.imei == null &amp;&amp; signal.imei != null) { return; // special case where callback is called because we stopped listening to the native side. } // Something changed. Fire watching network event signal.imei = info.imei; signal.operator = info.operator; signal.cellID = info.cellID; signal.lac = info.lac; signal.neighbors = info.neighbors; } } }; /** * Error callback for signal initiated */ Signal.prototype.error = function(e) { console.log("Error initializing advanced network plugin: " + e); }; var signal = new Signal(); module.exports = signal; how can i do this.?
score: 1
has answer: http://stackoverflow.com/a/29712548
type: Question
answer count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/47560350
has title: How to call function in one javascript from other javascript
tagged with: javascript
tagged with: phonegap-plugins
has answer: http://stackoverflow.com/a/29712420
favorite count: 0
has comment: http://stackoverflow.com/comment/47612989
upvote count: 3

http://stackoverflow.com/comment/47611435
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29735265
has text: You almost certainly don't want to run a query every time someone hovers over an element; the load from that will be tremendous and many of the queries will return a response after the user has moved on.

http://stackoverflow.com/q/29815125
score: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29816970
has body: I have a page which is built up of tiles (imagine a list of div's with a thumbnail and a title) - each 'tile' can have several tags attributed to them.. E.g: tile 1 has the following tags: foo, bar, baz, quz tile 2 has the following tags: foo, bar, baz tile 3 has the following tags: bar, baz tile 4 has the following tags: baz, quz .. and so on.. At the top of the page there is a simple filter menu - with each tag clickable in a list. When clicking a tag in the filter menu e.g. foo, hide any tile which hasn't got the foo tag attributed to it. In this case, tiles 3 and 4 will be removed from view. Each tile has the following template, but I need to extend this to incorporate the tag filtering... &lt;div ng-repeat="tile in tiles" class="col-md-2" ng-show="showFiles.filters[tile.filetype]"&gt; &lt;div class="sc-file-container"&gt; &lt;h3&gt;{{tile.name}}&lt;/h3&gt; // add image here too &lt;/div&gt; &lt;/div&gt; Very new to the angular way, but basically in order to use ng-hide/ng-show I've been creating arrays in the controller $scope - see above, so when showFiles.filters['tile.filetype'] is set true (by an onclick via a directive on another filter menu for example), the tile will show or hide.. Question: As there are potentially several tags attributed to each tile - what would be the best way to utilise ng-show in the above example? How can I iterate over the tags array - but keep within the &lt;div&gt;? Is it possible to have 2 ng-repeat's on one element or would I have to create several dummy &lt;div&gt; wrappers, just to apply for example ng-show="filterByTag['foo']" to the tile Example of json: "tiles" : { .. . "filetype" : "pdf", "name" : "this is tile 1!", .. "tags":[ { "id":1, "name":"foo" }, { "id":2, "name":"bar" }, { "id":3, "name":"baz" } .. ] .. }
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29816818
accepted answer: http://stackoverflow.com/a/29816818
type: Question
has title: Nesting ng-repeat on one element for filtering
possible better answer: http://stackoverflow.com/a/29816970
answer count: 2
has comment: http://stackoverflow.com/comment/47757992
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/48293806
score: 0
comment on: http://stackoverflow.com/q/29726928
type: Comment
type: QuestionComment
has text: Hi @Rup, You were right, it was a base64 script and I used the TAC plugin to find it. Thanks for the help

http://stackoverflow.com/q/29796693
has comment: http://stackoverflow.com/comment/47722221
has comment: http://stackoverflow.com/comment/47721658
has body: I have an object: TICKET_PRIORITIES: { LOW: 'low', NORMAL: 'normal', HIGH: 'high', VERY_HIGH: 'very high' } In client side I have to add select at first. Result I wanted to be TICKET_PRIORITIES: { SELECT: 'select', LOW: 'low', NORMAL: 'normal', HIGH: 'high', VERY_HIGH: 'very high' } In this select I wanna select "select" option and select option should be at the first of drop down.
linked to: http://stackoverflow.com/q/29031394
has answer: http://stackoverflow.com/a/29797129
type: Question
upvote count: 2
downvote count: 2
linked to: http://stackoverflow.com/q/10691409
has comment: http://stackoverflow.com/comment/47722725
has comment: http://stackoverflow.com/comment/47721793
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/5525795
score: 0
has answer: http://stackoverflow.com/a/29798111
answer count: 3
has answer: http://stackoverflow.com/a/29797154
has comment: http://stackoverflow.com/comment/47721617
has title: How to add an element at first of object
has comment: http://stackoverflow.com/comment/47723154
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47723285

http://stackoverflow.com/q/29802080
has comment: http://stackoverflow.com/comment/47732512
answer count: 4
type: AnsweredQuestion
tagged with: object
has comment: http://stackoverflow.com/comment/47732360
has answer: http://stackoverflow.com/a/29802307
has comment: http://stackoverflow.com/comment/47732834
type: Question
has comment: http://stackoverflow.com/comment/47732371
has answer: http://stackoverflow.com/a/29802330
has body: Consider this code: var MSE = { Module : {} }; MSE.Module = (function() { 'use-strict'; var app = { tabsPre : function() { var tabsPre = { init : function() { }, changeTab : function(arg) { return arg; } }; tabsPre.init(); return tabsPre; } }; return app; })(); console.log( MSE.Module.tabsPre() ); console.log( MSE.Module.tabsPre().changeTab() ); // undefined console.log( MSE.Module.tabsPre.changeTab() ); // Uncaught TypeError: MSE.Module.tabsPre.changeTab is not a function I am trying to access changeTab() in the tabsPre object, but I don't seem to be able to. The last two console.log statements aren't giving me what I had hoped for. How can I do this? Here's a JSFiddle: https://jsfiddle.net/xhb16qL6/ In the first console.log, I can see the function is there: Any help or guidance on what I'm doing wrong would be great. I'm probably having a dumb day and can't see it. Thanks, Mikey
tagged with: javascript
has answer: http://stackoverflow.com/a/29802294
score: 0
possible better answer: http://stackoverflow.com/a/29802330
accepted answer: http://stackoverflow.com/a/29802294
has title: Why does a function in my object return undefined?
has answer: http://stackoverflow.com/a/29802421

http://stackoverflow.com/q/29739098
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47612876
tagged with: formatting
accepted answer: http://stackoverflow.com/a/29752822
has body: I have a question regarding reading a webpage then printing a pop up copy. Basically I have a form on page A. If the user elects to pay by check, their invoice will popup in a new window B which is a print preview. The invoice table found on A is well formatted. Unfortunately in the pop up print page B, the table formatting (in fact all the page formatting) is gone. Namely, the centring of the first column and right justifying of the 2nd, row shading, and table border. I was thinking of creating 3 divs; one before, one after and one including the table invoice, but all my attempts give a misformatted table. Then I thought I'd rewrite using divs in the page A, and rewriting the popup printer page to reflect this (multiple strings getting written as strHeader, strTable, strFooter). Any thoughts on how best to proceed? Here's my code: <?php $this->set('title_for_layout', 'Event Registration Payment')?> <?php if($eventRegistration['EventRegistration']['payment_type'] =="cheque"):?> To pay by cheque... click here <?php endif;?> <?php echo $this->Session->flash(); ?> <?php echo $this->requestAction('/liveEditRegions/getRegion/60'); ?> Item Price <?php if($registrationPrice > 0):?> Registration Price $<?php echo number_format($registrationPrice, 2) ?> <?php endif;?> <?php if($eventRegistration['EventRegistration']['dinner_ticket_number'] > 0):?> Dinner Ticket(s) x <?php echo $eventRegistration['EventRegistration']['dinner_ticket_number']?> @ $<?php echo number_format($eventRegistration['EventRegistration']['dinner_ticket_price'])?> $<?php echo number_format($dinnerticketTotal, 2) ?> <?php endif;?> <?php if($eventRegistration['EventRegistration']['student_social_ticket_number'] > 0):?> Student Social Ticket(s) x <?php echo $eventRegistration['EventRegistration']['student_social_ticket_number']?> @ $<?php echo number_format($eventRegistration['EventRegistration']['student_social_ticket_price'])?> $<?php echo number_format($ssticketTotal, 2) ?> <?php endif;?> Sub total $<?php…
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47636830
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29752822
score: 0
has comment: http://stackoverflow.com/comment/47612226
has title: Can't pass formatting to javascript
upvote count: 1

scroll
tags question: http://stackoverflow.com/q/29770576
tags question: http://stackoverflow.com/q/29795040
tags question: http://stackoverflow.com/q/29756186
tags question: http://stackoverflow.com/q/29815398
tags question: http://stackoverflow.com/q/29750711
tags question: http://stackoverflow.com/q/29695082
tags question: http://stackoverflow.com/q/29760049
tags question: http://stackoverflow.com/q/29813330
type: Tag
tags question: http://stackoverflow.com/q/29708176
tags question: http://stackoverflow.com/q/29829512
tags question: http://stackoverflow.com/q/29755271
tags question: http://stackoverflow.com/q/29775133
tags question: http://stackoverflow.com/q/29697043
tags question: http://stackoverflow.com/q/29817548
tag name: scroll
tags question: http://stackoverflow.com/q/29836167
tags question: http://stackoverflow.com/q/29731180
tags question: http://stackoverflow.com/q/29688907

http://stackoverflow.com/comment/47776224
type: Comment
has text: Highly doubt it is the Ajax call, it is your loop that is slow. Do not append on every row! Build up all the rows/cells in a string and append once.
score: 3
comment on: http://stackoverflow.com/q/29824906
type: QuestionComment

http://stackoverflow.com/comment/47791483
type: Comment
comment on: http://stackoverflow.com/q/29832438
has text: `[05]+` is means 1-or-more-of-these-chars. 000000005555050505050505050505 would match. Try `[05]{2}` instead...
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47540233
has text: @DBS: That may be an option - someone actually posted that as an answer and deleted - but I believe currently is the most appropriate option. I guess what'd be nice is if the transition were to just `know` that I'm styling the fill and to check the CSS fill style first.
comment on: http://stackoverflow.com/q/29701689
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47788161
type: AnswerComment
has text: I have import <uses-permission android:name="android.permission.INTERNET" /> and <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> to the AndroidManifest.xml but it is still not work
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29829999

http://stackoverflow.com/q/29764078
type: Question
score: 0
tagged with: function
has answer: http://stackoverflow.com/a/29770125
answer count: 1
accepted answer: http://stackoverflow.com/a/29770125
tagged with: web
has comment: http://stackoverflow.com/comment/47660161
tagged with: asp.net
has comment: http://stackoverflow.com/comment/47661391
tagged with: telerik
has comment: http://stackoverflow.com/comment/47661304
has body: I have a JS script to popup a calendar.If i put AJAX on the page to avoid refresh i got error : The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). I have read that if i change <%= to <%# should work. I try it and the page loads but the function does not work. js function ShowDatePopup() { $find("<%= RadDatePicker1.ClientID %>").showPopup(); } aspx <telerik:RadDatePicker ID="RadDatePicker1" Runat="server" Culture="el-GR" Visible="False" Skin="WebBlue" AutoPostBack="True" > <ClientEvents OnFocus="ShowDatePopup"/> </telerik:RadDatePicker> What i am doing wrong and how i can fix this?
has title: Js with ajax couse error on page load
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47660874
tagged with: javascript

http://stackoverflow.com/comment/47778072
type: QuestionComment
comment on: http://stackoverflow.com/q/29825546
has text: Because I have access to this form and it was easier for me because I only "skills" in html and php
score: 0
type: Comment

http://stackoverflow.com/comment/47695153
score: 1
comment on: http://stackoverflow.com/a/29780484
type: AnswerComment
has text: You're right. I've edited the example above to reflect that. Thanks.
type: Comment

query-string
tags question: http://stackoverflow.com/q/29834985
tags question: http://stackoverflow.com/q/29804219
tag name: query-string
tags question: http://stackoverflow.com/q/29817181
type: Tag

http://stackoverflow.com/q/29735873
has answer: http://stackoverflow.com/a/29743426
favorite count: 0
type: UnansweredQuestion
has body: I have simple grunt-browserify config. This configuration works perfectly until I change any JavaScript file, then "watchify" compiles build again. Since that moment build.js fails in browser with exception: Uncaught Error: Cannot find module 'i18n' Seems like "watchify" ingnores alias option, or Am I doing something wrong ? browserify: { client: { src: ['app/app.js'], dest: 'app/build.js', options: { browserifyOptions: { debug: true }, alias: [ './app/dispatchers/appDispatcher.js:appDispatcher', './app/models/i18n.js:i18n' ], watch: true } } } Thank you.
score: 1
tagged with: watchify
type: Question
tagged with: javascript
tagged with: gruntjs
has comment: http://stackoverflow.com/comment/47616655
tagged with: browserify
upvote count: 1
answer count: 1
downvote count: 0
has title: grunt-browserify alias stop working

http://stackoverflow.com/q/29725585
has title: Multiple "if" statements
has answer: http://stackoverflow.com/a/29725691
downvote count: 2
accepted answer: http://stackoverflow.com/a/29725606
has comment: http://stackoverflow.com/comment/47585917
has answer: http://stackoverflow.com/a/29725604
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/12984191
possible better answer: http://stackoverflow.com/a/29725658
score: 1
upvote count: 3
has answer: http://stackoverflow.com/a/29725606
has comment: http://stackoverflow.com/comment/47585621
has comment: http://stackoverflow.com/comment/47585804
type: Question
has answer: http://stackoverflow.com/a/29725648
tagged with: javascript
tagged with: jquery
answer count: 6
has comment: http://stackoverflow.com/comment/47585368
linked to: http://stackoverflow.com/q/12984191
has answer: http://stackoverflow.com/a/29725658
has body: Is there a way to have multiple javascript "if" statements in one? for example: if (location.host === "www.google.com", "www.jsfiddle.net") { blah }; or would I just have to use "||", example: if (location.host === "www.google.com" || location.host === "www.jsfiddle.net"){ blah }; If there is a way to do this, or perhaps an easier way, could you please note it below. This is different because the other question has only received JS answers, however this one has received jQuery replies, as well as it is to obtain different goals.
has answer: http://stackoverflow.com/a/29725736
favorite count: 0

http://stackoverflow.com/comment/47541288
type: QuestionComment
comment on: http://stackoverflow.com/q/29702255
has text: So, angularfire is required to work with angular? Sorry, I've come from an over-reliance on tools like Yeoman, and am trying to get my own dev stack working. So sorry if it's a silly question.
score: 0
type: Comment

http://stackoverflow.com/comment/70799295
has text: @Suray Jain, you may want to ask a different question. The following should work: ` `
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29723729

http://stackoverflow.com/comment/109739384
type: Comment
comment on: http://stackoverflow.com/a/42039244
score: 1
type: AnswerComment
has text: You think or you know? According to a statement in this post https://dmitripavlutin.com/javascript-array-from-applications/ you could be right -> Moreover, you can use Array.from() with any object or primitive that implements the iterable protocol

http://stackoverflow.com/q/29801376
has comment: http://stackoverflow.com/comment/47730844
answer count: 4
has answer: http://stackoverflow.com/a/29801436
downvote count: 9
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47731054
tagged with: jquery
linked to: http://stackoverflow.com/q/2140627
has answer: http://stackoverflow.com/a/29801458
has title: How to compare the order of two sets of data?
upvote count: 0
favorite count: 0
has body: I have got two sets of data: var array = ["one" , "two" , "three" , "Four" , "Five"]; var T1 = "One" ; var T2 = "two" ; var T3 = "three" ; var T4 = "Four" ; var T5 = "Five" ; I want to check the order of data in both sets, I was trying this way: if(T1==array[0] &amp;&amp; T2==array[1] &amp;&amp; T3 ==array[2] &amp;&amp; T4==array[3] &amp;&amp; T5==array[4]) { alert('Yes'); } else { alert('No'); } But i'm getting alert as "No". Could you please let me know how to resolve this? http://jsfiddle.net/85utz097/
type: Question
score: -9
has answer: http://stackoverflow.com/a/32228688
has answer: http://stackoverflow.com/a/66437893

http://stackoverflow.com/q/29749239
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47630873
score: 0
has body: I have a text box, created in HTML. The user may type input into this text box. I would like to validate their input dynamically, as they type, and search for spelling mistakes in their text. If there is a spelling mistake, underline the word. This is a common functionality I assume, but I cannot find a plugin or API call that will accomplish this for me. Can anyone please point me in the right direction? Preferably something that will work in Spanish rather than English :). Thanks you.
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47630914
has comment: http://stackoverflow.com/comment/47630851
type: UnansweredQuestion
has title: Dynamic spell-checker for HTML text box?
tagged with: jquery-ui
type: Question
has answer: http://stackoverflow.com/a/29749410
tagged with: validation
answer count: 1

http://stackoverflow.com/comment/47718434
has text: Here is a [possible answer](http://stackoverflow.com/questions/5848598/how-can-i-bind-all-events-on-a-dom-element)
comment on: http://stackoverflow.com/q/29795060
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/47801828
comment on: http://stackoverflow.com/q/29837329
score: 0
has text: You know what i just realized that I confused everyone with the fiddle code, the code itself highlights the TD when the time is 15mins about to expire. What I needed is to turn orange when it was 30 mins overdue and red when its 1 hour overdue. Looks like rich.okelly has the code I needed but will need to mix this in with IronFlare's code to convert my date.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29828967
score: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47784313
has body: I have a situation where I am using $http.get in a for loop. I now need to associate the http response to the object that was being iterated in the loop. The problem however is .success is asynchronous, so this does not work: for (var i =0; i&lt; monitors.length; i++) { var url = loginData.apiurl + "/events/index/MonitorId:"+monitors[i].Monitor.Id+".json?page=1"; console.log ("Monitor event URL:"+url); $http.get(url) .success (function (data) { // by the time we reach here, i is out of context, // so this is an error console.log ("**** EVENT COUNT FOR MONITOR " + monitors[i].Monitor.Id + " IS " + data.pagination.count); monitors[i].Monitor.Events = data.pagination.count; }) .error (function (data) { }); } So is it possible for me to pass a variable in the http.get function that returns on success too as a context? If not, how does one do this the Angular way?
has comment: http://stackoverflow.com/comment/47784207
answer count: 0
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47784636
duplicate of: http://stackoverflow.com/q/750486
tagged with: javascript
has title: Angular JS $http: Returning arbitrary application specific context
downvote count: 0

http://stackoverflow.com/q/29784756
score: 1
has comment: http://stackoverflow.com/comment/47701027
tagged with: css-transitions
upvote count: 1
has comment: http://stackoverflow.com/comment/47700856
has comment: http://stackoverflow.com/comment/47699691
type: Question
has comment: http://stackoverflow.com/comment/47700157
has comment: http://stackoverflow.com/comment/47700431
answer count: 2
accepted answer: http://stackoverflow.com/a/29785444
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47701123
has comment: http://stackoverflow.com/comment/47699967
has body: As part of an AngularJS app I'm creating I've got a list of records that're broken up in to 3 sections: A list of the records before the currently selected record, the currently selected record and then a list of records after the currently selected record. Both lists of records and the currently selected record are created from a single parent list of all records (the order of records in this list of all records doesn't change). So the basic HTML structure looks like this: &lt;div class="card list" ng-repeat="timeRecord in recordsBeforeCurrent"&gt; .... &lt;/div&gt; &lt;div class="card" ng-class="active" id="currentRecordCard"&gt; .... &lt;h2 ng-class="activeTimer" id="currentRecordTimer"&gt;&lt;/h2&gt; .... &lt;/div&gt; &lt;div class="card list" ng-repeat="timeRecord in recordsAfterCurrent"&gt; .... &lt;/div&gt; Whenever the currently selected record changes I want to be able to apply css transitions to the currentRecordCard element and the currentRecordTimer element. I do this using the following css: #currentRecordCard { margin-top: 20px; margin-bottom: 20px; transition: margin 1s ease; } #currentRecordCard.active { margin-top: 40px; margin-bottom: 40px; } #currentRecordTimer { font-size: 20px; position: absolute; left: 0; margin-left: 16px; transition: all 0.5s ease; } #currentRecordTimer.activeTimer { font-size: 30px; left: 50%; margin-left: -57px; } Each time the user clicks on a record in either of the recordsBeforeCurrent or recordsAfterCurrent lists, a function resumeRecord() is called which currently looks like this: $scope.resumeRecord = function(record){ $scope.active = ""; $scope.activeTimer = ""; *** currentRecord = null; lists of before and after records are cleared; currentRecord is set whichever record was just clicked; lists of before and after records are recalculated; *** $scope.active = "active"; $scope.activeTimer = "activeTimer"; } Currently the transitions work correctly the first time that the currentRecord is changed but every time after t…
has comment: http://stackoverflow.com/comment/47701287
possible better answer: http://stackoverflow.com/a/29786458
has comment: http://stackoverflow.com/comment/47701168
has answer: http://stackoverflow.com/a/29786458
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47699802
has comment: http://stackoverflow.com/comment/47700159
favorite count: 0
has comment: http://stackoverflow.com/comment/47700252
tagged with: angularjs
has title: CSS transitions only work the first time they are applied
has answer: http://stackoverflow.com/a/29785444
tagged with: css
has comment: http://stackoverflow.com/comment/47699842
type: AnsweredQuestion

http://stackoverflow.com/comment/47653509
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29760589
has text: Oh thank you. Well, the statement itself isn't wrong because I did test it, but I get what you're saying in that there's a way to set up things so that it will work. May I ask how that structure looks like, loosely? What do I need to do to get Angular to work if I "initialize" it in a layout file?

http://stackoverflow.com/q/29756073
has answer: http://stackoverflow.com/a/29756442
score: 0
has comment: http://stackoverflow.com/comment/47644354
tagged with: linkedin-api
answer count: 1
has comment: http://stackoverflow.com/comment/47644410
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47644591
has title: Get LinkedIn basic profile from someone through the LinkedIn URL
type: Question
has body: I would like to know if its possible to get the LinkedIn basic profile from someone ? Example When I register a new user on the system, wish it were possible to get the basic information for this new user to note the URL of that person LinkedIn for example. If it's possible, how can I do it with Javascript SDK ? Code // Setup an event listener to make an API call once auth is complete function onLinkedInLoad() { IN.Event.on(IN, "auth", getProfileData); } // Handle the successful return from the API call function onSuccess(data) { console.log(data); } // Handle an error response from the API call function onError(error) { console.log(error); } // Use the API call wrapper to request the member's basic profile data function getProfileData() { IN.API.Raw("/people/~").result(onSuccess).error(onError); }
tagged with: javascript

http://stackoverflow.com/comment/47611995
comment on: http://stackoverflow.com/a/29739291
has text: Thank you so much. :) If has any doubt can I ask it again within this hour. Will you please reply back?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29801133
has comment: http://stackoverflow.com/comment/47730580
type: Answer
accepted answer of: http://stackoverflow.com/q/29800534
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47730764
has body: if you want to delete the Events as well you will need to undelegate events, as if you didn't do so and you created a new Backbone view the old view will still listen to actions and if you have a click callback will be triggered for new and old one destroy:=&gt; @.undelegateEvents() @$(el).empty()
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29800534

http://stackoverflow.com/a/29773411
type: Answer
accepted answer of: http://stackoverflow.com/q/29752326
upvote count: 3
answers question: http://stackoverflow.com/q/29752326
has body: No, Chrome's V8 does not expose any internals as part of Extension APIs, or, for that reason, remote debugger protocol. What you see in Dev Tools is about the limit of what is exposed. You'll need to re-parse it yourself or use a modified version of Chromium that exposes the information you need.
score: 3
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47635701
type: QuestionComment
score: 0
has text: factory is a variable not a function
type: Comment
comment on: http://stackoverflow.com/q/29744491

http://stackoverflow.com/comment/53720227
comment on: http://stackoverflow.com/a/29828014
score: 0
has text: I did as you suggested in above blog post (Wissel,net). But I encountered same as the last comment of it (Stefan Zehnder). I tested by opening a XPage in which some custom controls as referred to a jar file (custom controls class in xsp package). As a result, I cannot see them in the xPage. Maybe the “composite-file” property in the xsp-config file (in WEB-INF) points to the wrong file or class. If you have any idea, please kindly help.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47810773
type: Comment
comment on: http://stackoverflow.com/q/29841884
has text: On key press validate the character to make sure if its a operator then add extra space, if character check if previous word or character is a keyword or a variable etc etc, hell lots of if else. First you think or draft what all keywords user can use, what sort of validations you want to provide and what are the limitations.
score: 0
type: QuestionComment

http://stackoverflow.com/q/29789506
type: Question
has title: jQuery ajax only works locally but not on Server
has comment: http://stackoverflow.com/comment/47708096
has comment: http://stackoverflow.com/comment/47709674
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/29789857
has comment: http://stackoverflow.com/comment/47708117
favorite count: 0
has answer: http://stackoverflow.com/a/29789617
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29789643
has comment: http://stackoverflow.com/comment/47708125
has comment: http://stackoverflow.com/comment/47715860
tagged with: php
has body: my front-end sends a jquery-ajax request to a back-end in order get values to calculate something. This works fine on my local webserver but if i do it online, i only get result 0 in my calculations, which means that i dont get the ajax response. Here is my ajax-method: function transmitToBackend(weights, subfeatures) { $.post("../Backend/StartFeasibilityAnalysis.php", { features: JSON.stringify(weights), subfeatures: JSON.stringify(subfeatures) }, function(data){ convertData(data); }); } Could it be that the convertData(data) Method gets called before the data was transmitted from the back-end? Best regards
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47709523

http://stackoverflow.com/comment/47605811
type: QuestionComment
comment on: http://stackoverflow.com/q/29736102
score: 0
has text: what python version?
type: Comment

http://stackoverflow.com/comment/47712271
type: Comment
comment on: http://stackoverflow.com/a/29791617
has text: Its just forum i didn't mind it. W3school is basic to learn all tutorials for begineers.
score: 0
type: AnswerComment

http://stackoverflow.com/q/29742593
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29742803
has body: I'm using JS with similar if statements in order to have Divs side by side. As the topic title suggests, can these if statements be combined or made more efficient in any way? EDIT: The purpose of this code is to make all Divs the same height. JS: $(document).ready(function(){ $('.container').each(function(){ var firstDiv = $(this).find('.first'); var secondDiv = $(this).find('.second'); var thirdDiv = $(this).find('.third'); var fourthDiv = $(this).find('.fourth'); if(firstDiv.height() &gt;= secondDiv.height()){ secondDiv.css('height',firstDiv.height()); } else { firstDiv.css('height',secondDiv.height()); } if(secondDiv.height() &gt;= thirdDiv.height()){ thirdDiv.css('height',secondDiv.height()); } else { secondDiv.css('height',thirdDiv.height()); } if(thirdDiv.height() &gt;= fourthDiv.height()){ fourthDiv.css('height',thirdDiv.height()); } else { thirdDiv.css('height',fourthDiv.height()); } }); }); Test page: http://www.gloryhood.com/articles/ztest.html
has comment: http://stackoverflow.com/comment/47619314
upvote count: 1
accepted answer: http://stackoverflow.com/a/29743210
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/29742803
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47619161
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47618175
has answer: http://stackoverflow.com/a/29743210
has comment: http://stackoverflow.com/comment/47620588
has comment: http://stackoverflow.com/comment/47618427
has comment: http://stackoverflow.com/comment/47618214
has comment: http://stackoverflow.com/comment/47618413
has title: Combining Similar If Statements In Javascript

http://stackoverflow.com/comment/47821015
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29846421
has text: If i use post by the way it doesnt even gie me a http response :/
type: Comment

http://stackoverflow.com/comment/47595970
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29721413
has text: be careful this is not a SPA concept, you don't do that because it's SPA, you do that because you need, in my projects I have never ever manipulated UI elements when working knockout. Nevertheless, if possible, try to run a sample on jsfiddle with fake data and then I would be able to help you buddy
type: Comment

http://stackoverflow.com/comment/47631164
comment on: http://stackoverflow.com/a/29748838
score: 0
type: Comment
type: AnswerComment
has text: Glad to hear it, No problem! :)

http://stackoverflow.com/a/29784395
type: Answer
answers question: http://stackoverflow.com/q/29784284
score: 1
has body: Because parents is an array. You must specify the index (0 in your case). See the response here : How to get value from a nested JSON array in AngularJS template?
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/47721695
type: Comment
type: QuestionComment
has text: The script is defined by the page (i.e. it works in that frame)? Is there already a content script from your extension in this frame, or do you need to inject it too?
score: 0
comment on: http://stackoverflow.com/q/29795924

http://stackoverflow.com/comment/47543406
comment on: http://stackoverflow.com/a/29700206
type: Comment
has text: Your second problem sounds like you have no php-interpreter on your server?! :D
score: 0
type: AnswerComment

http://stackoverflow.com/a/29714929
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29714652
answers question: http://stackoverflow.com/q/29714652
has comment: http://stackoverflow.com/comment/47565419
has comment: http://stackoverflow.com/comment/47565791
has comment: http://stackoverflow.com/comment/47564999
has comment: http://stackoverflow.com/comment/47566352
has body: I think the issue is that you have ViewStateMode="Disabled", remove it and the list box will not be empty after submit.
has comment: http://stackoverflow.com/comment/47565240
has comment: http://stackoverflow.com/comment/47565131

http://stackoverflow.com/comment/47757068
has text: actually it is valid as i receive the same when i post a url.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29814761

http://stackoverflow.com/comment/47680615
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29774952
has text: I think a lot of people confuse jQuery with Javascript.
type: Comment

http://stackoverflow.com/comment/47541499
type: Comment
comment on: http://stackoverflow.com/q/29702511
type: QuestionComment
score: 0
has text: Put `window.onload = new newCard;` at the end of your script

http://stackoverflow.com/comment/47527472
type: AnswerComment
type: Comment
has text: Before `var map;` inicialize it. `function somename(arugments) { stuffToDo(); }`. Then call it as `.addListener( marker, 'click',somename)`
comment on: http://stackoverflow.com/a/29695012
score: 0

http://stackoverflow.com/q/29804356
tagged with: addeventlistener
has answer: http://stackoverflow.com/a/29805439
tagged with: javascript
tagged with: google-maps-api-3
upvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/29807203
accepted answer: http://stackoverflow.com/a/29807203
linked to: http://stackoverflow.com/q/5838868
favorite count: 0
possible better answer: http://stackoverflow.com/a/29805439
type: AnsweredQuestion
score: 2
downvote count: 0
has title: Google Maps API v3 binding events to multiple maps
type: Question
has answer: http://stackoverflow.com/a/29805543
tagged with: google-maps
has body: I've got a page with two Google maps on, using the v3 API. Currently they have one pin each, with the same lat &amp; long set for each pin, although one of the maps will have other pins added at a later date (when I can get this to work!) The maps are generated by looping through an object, so further maps can be added simply if needed. What I am trying to do is bind the bounds_changed event once to both maps, to run map.setZoom() after map.fitBounds() has been run. The event, however, only binds to the last map to be set up, so does not reset the zoom on the first map. Link to JSFiddle replicating the issue: http://jsfiddle.net/pkhb8mvz/7/ (For a more clear example of what the event is being bound to, change the event to listen on click rather than bounds_changed then try clicking on the first map and watch the zoom level change on the second map) Any help greatly appreciated!

http://stackoverflow.com/q/29764143
favorite count: 0
has answer: http://stackoverflow.com/a/29764200
answer count: 5
has answer: http://stackoverflow.com/a/68389268
possible better answer: http://stackoverflow.com/a/29764250
has comment: http://stackoverflow.com/comment/47668009
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29764250
downvote count: 1
has answer: http://stackoverflow.com/a/71488230
type: Question
accepted answer: http://stackoverflow.com/a/29764200
score: 3
has title: Reverse words in array string matching punctuation in Javascript
tagged with: javascript
has answer: http://stackoverflow.com/a/59690365
linked to: http://stackoverflow.com/q/958908
upvote count: 4
has body: How do I reverse the words in this string including the punctuation? String.prototype.reverse = function () { return this.split('').reverse().join(''); } var str = "This is fun, hopefully."; str.reverse(); Currently I am getting this: ".yllufepoh ,nuf si sihT" When I want to return this: "sihT si nuf, yllufepoh."
has comment: http://stackoverflow.com/comment/47660471
tagged with: string

http://stackoverflow.com/a/29702866
score: 0
has comment: http://stackoverflow.com/comment/47542236
type: Answer
answers question: http://stackoverflow.com/q/29702499
has body: Use the x(?=y) rule that states "Matches 'x' only if 'x' is followed by 'y'. This is called a lookahead" using a * to allow more matches following @, and then get all a-z A-Z . - characters until a space /s is found. var emails = ""; emails += "washington.guedes@gmail.com "; emails += "guedes@outlook.com "; emails += "wg100@ig.com.br "; var re = /(?=@*)([a-zA-Z.-]+\s)/g; console.log(re.exec(emails));
has comment: http://stackoverflow.com/comment/47543057

http://stackoverflow.com/q/29806692
possible better answer: http://stackoverflow.com/a/29806875
has answer: http://stackoverflow.com/a/29806835
answer count: 4
tagged with: jsdata
has answer: http://stackoverflow.com/a/29806875
type: AnsweredQuestion
has title: How to update my $scope after adding new elements?
has answer: http://stackoverflow.com/a/33430426
type: Question
accepted answer: http://stackoverflow.com/a/29806835
tagged with: javascript
tagged with: ionic-framework
has body: I have a problem with my controller. I use ionic (angular) and js-data. when I add a new item via addItem() I will only when see it if I reload the page via F5. Here is my code: .controller('FooCtrl', function($scope, $ionicPlatform, foo) { $ionicPlatform.ready(function() { foo.findAll().then(function (items) { $scope.items = items; }); }); $scope.item = {}; $scope.addItem = function () { foo.create({ name: $scope.item.name }); }; }) what I have to do to see the new element withous first pressing F5 in my browser window?
has answer: http://stackoverflow.com/a/29806820
score: 0
has comment: http://stackoverflow.com/comment/47741500
tagged with: angularjs

http://stackoverflow.com/comment/47698247
has text: It's jquery. Did I put it in the wrong area? Understand, finding the scores isn't the issue. I can't figure out how to put the winner's name there. I didn't include it because nothing worked.
comment on: http://stackoverflow.com/q/29784137
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29749026
answer count: 2
has title: binding data with ui-jq slider in angular
has answer: http://stackoverflow.com/a/31548605
has answer: http://stackoverflow.com/a/41736603
tagged with: javascript
type: UnansweredQuestion
tagged with: angularjs
type: Question
tagged with: angularjs-ng-repeat
has body: I have a page where users can rate their performance in different categories. I am using the ui-jq slider for angular and i want to bind the selected value to a model in $scope. {{competence.competence.name}} {{competence.competence.level}}
score: 0

http://stackoverflow.com/q/29733970
type: Question
tagged with: session
has body: Im doing a form POST submit from javascript to PHP and it works fine on desktop but doesnt post the values on iPhone? They're stored as PHP session variables in the PHP but it seems theyre not posting even out of session store. Has anyone seen this issue before? Javascript: var $form = $('&lt;form method="POST" action="profile.php"&gt;&lt;/form&gt;'); $form.submit(function () { var input = $("&lt;input&gt;") .attr("type", "hidden") .attr("name", "email").val(email); $(this).append(input); return true; }); $form.submit(); PHP: if(isset($_POST['email'])) { $myEmail = $_POST['email']; $myEmail = $_SESSION["email"] = $_POST['email']; $myEmail = $_SESSION["email"]; } else{ $myEmail = $_SESSION["email"]; } Works fine on desktop. No values at all on iPhone. Thanks.
tagged with: post
tagged with: iphone
has title: POST to PHP Session doesnt work on iPhone?
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47601673
has comment: http://stackoverflow.com/comment/47601434
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/47601587

http://stackoverflow.com/q/29742404
has comment: http://stackoverflow.com/comment/47741398
answer count: 2
has title: $state.go() doesn't load controller in ionic application
has comment: http://stackoverflow.com/comment/47618003
downvote count: 0
has answer: http://stackoverflow.com/a/30155328
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/33919991
has answer: http://stackoverflow.com/a/33919991
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47618355
has body: Using the following code, when a page with id=0 loads first time there is no problem with controller. But when again the same page loads with same id=0 again, it does not loads controller. $state.go('tab.dash', { id: $rootScope.products[CONSTANTS.i].id }, { reload: true }); How does it happen? Please suggest me a solution.
accepted answer: http://stackoverflow.com/a/30155328
tagged with: ionic-framework
type: Question
tagged with: angular-ui-router
score: 5
upvote count: 5
tagged with: javascript
linked to: http://stackoverflow.com/q/29792166

http://stackoverflow.com/q/29800417
has answer: http://stackoverflow.com/a/30267663
score: 1
has answer: http://stackoverflow.com/a/31302690
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: karma-jasmine
tagged with: angularjs
has title: Unit Testing angularjs directive with angular-material-design with requirejs throws a "GET" error
type: UnansweredQuestion
tagged with: angular-material
tagged with: requirejs
upvote count: 1
has body: My app uses requirejs as well as angularjs. I'm using text! in order to load my templates (so as not to use templateURL in my directives). It all works fine - unless one of the directives contains an image in its template. I'm now trying to setup my tests for new directives with icons in their templates, with no success. For instance, I have the following directive template: &lt;buttonDirective&gt; &lt;md-icon md-svg-src="/android.svg" alt="android "&gt;&lt;/md-icon&gt; &lt;/buttonDirective&gt; Karma yells at me that "/android.svg" is being called (the known "GET" error: Unexpected request: GET IMAGEFILEPATH). I've tried to add my image files to the karma config, but this did not solve the issue. Any way around this besides not using the md-icon? (it works when I change the m d-icon to a simple image, so I guess the issue is that the md-icon directive is using some async call to the svg file and Karma hates that...).
type: Question

http://stackoverflow.com/q/29811633
accepted answer: http://stackoverflow.com/a/29811853
tagged with: css
has body: I understand this could be a hard one, I have 10+ years working with HTML, but I can't find a solution that doesn't involve working with complicated calculations with Javascript. I have a fixed-size container divided in two, so the container has a top half and a bottom half. The top half has an image. The bottom half has text. What I want is that the image and the text occupy all the available space. If the text is short, there is more space available for the image. If the text is larger, the image is smaller, dynamically. I've added a couple of screenshots to illustrate what I want. In all cases, they occupy 100% of the available vertical space of the fixed-size container.
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47753837
type: Question
has answer: http://stackoverflow.com/a/29812113
upvote count: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/29811877
has title: How to make an image height resize accordingly to the size of the contents below it, in a fixed size container
score: 5
has comment: http://stackoverflow.com/comment/47751587
has answer: http://stackoverflow.com/a/29812130
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/29812113
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29811853

http://stackoverflow.com/comment/47620867
comment on: http://stackoverflow.com/a/29743484
score: 0
type: AnswerComment
has text: I believe this best way to achieve this . As other methods may vary from browser to browser
type: Comment

http://stackoverflow.com/q/29699956
has comment: http://stackoverflow.com/comment/47670212
has title: How do I obfuscate global variable using YUI without putting entire class inside a closure
upvote count: 7
has comment: http://stackoverflow.com/comment/47661178
tagged with: yui
accepted answer: http://stackoverflow.com/a/29908133
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/9582341
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47907578
tagged with: minify
has comment: http://stackoverflow.com/comment/47820635
score: 7
favorite count: 0
has body: Suppose there is a global variable which is a function function MyClass(){} and there are methods of this class such as MyClass.func1 = function() { } I want to ensure that YUI compression and obfuscation works without putting entire class inside a closure like (function () { function MyClass(){} MyClass.func1 = function() { } })(); Is there a way to make YUI compression work without doing this?
type: Question
has comment: http://stackoverflow.com/comment/47759526
has answer: http://stackoverflow.com/a/29908133
answer count: 1

http://stackoverflow.com/comment/47571733
type: Comment
comment on: http://stackoverflow.com/a/29718215
score: 1
has text: @Taylorsuk added an example for you :)
type: AnswerComment

http://stackoverflow.com/q/29783404
answer count: 1
downvote count: 0
tagged with: javascript
upvote count: 1
favorite count: 0
has title: Replace ( with javascript
has body: Firstly sorry for my english I have javascript statement that doesn't work, can someone tell me how to replace ( entities? I use userscript for execute it but it changed to (_domain.com) not _domain.com I have tried to search in google but google not read "(" or ")" and i have tried to change ( with &amp;lpar; &amp;#x00028; &amp;#40; but it cant find it anywhere. document.body.innerHTML= document.body.innerHTML.replace("(http://domain.com)","_domain.com");
accepted answer: http://stackoverflow.com/a/29783490
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29783490
type: Question

http://stackoverflow.com/q/29763501
has answer: http://stackoverflow.com/a/29763569
type: Question
tagged with: function
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29763577
has comment: http://stackoverflow.com/comment/47658642
favorite count: 0
has answer: http://stackoverflow.com/a/29763535
has body: /* CS 22A Assignment 2 Question 2 Write a function snooze that takes on parameter, day, and returns a boolean: true if day is a weekend, false if otherwise. If invalid argument/no argument, return false. The parameter day may be lowercase, uppercase, or mixed. */ function snooze(day){ day = day || 0; var Sat = 'Saturday'; var Sun = 'Sunday'; if (day === Sat){ return true; } else if (day === Sat.toUpperCase()){ return true; } else if (day === Sat.toLowerCase()){ return true; } else if (day === Sun){ return true; } else if (day === Sun.toUpperCase()){ return true; } else if (day === Sun.toLowerCase()){ return true; } else { return false; } } console.log(snooze('Monday')) // false console.log(snooze('tuesday')) // false console.log(snooze('SUNDAY')) // true console.log(snooze('Saturday')) // true console.log(snooze('October')) // false console.log(snooze()) // false console.log(snooze('SatUrDaY')) // true Hi all. I'm a bit new to programming and I'm taking up the javascript class at my school at the moment. One of the questions in my assignment this week is to create a function that takes on a parameter and returns a boolean, just as described in the comments above my code. My issue is that I do not understand how to make it so mixed-case inputs will be understood as their lowercase/uppercase counterparts. I did some googling and most results tell me to use regex, a concept we have yet to cover and I would get in trouble for doing so. Can someone shed some light as to how I can approach this? Also, while I'm at it- can someone nudge me in the correct path for the last question of this assignment? Your task is to define a function count that takes two parameters: word and char. The function returns the number of times the character occurs in the given word. You may assume that both parameters are lower case strings. Again, I have googled how to approach that problem but most results tell me to use regex or arrays, concepts we have yet to cover in class and I would get i…
answer count: 5
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47658760
upvote count: 1
tagged with: mixed-case
has answer: http://stackoverflow.com/a/29763537
has title: mixed-case lettering in JS function variables
score: 1
has comment: http://stackoverflow.com/comment/47658835
has answer: http://stackoverflow.com/a/29763582

http://stackoverflow.com/comment/47732487
has text: It's not updated as my test is changing the background color of the navbar and I don't see it in the browser until I refresh the page myself the second time.
comment on: http://stackoverflow.com/a/29801252
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/29758978
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
possible better answer: http://stackoverflow.com/a/29759011
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29759011
has comment: http://stackoverflow.com/comment/47652817
favorite count: 0
has answer: http://stackoverflow.com/a/29759009
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has title: How to use JavaScript function after jQuery.load()?
accepted answer: http://stackoverflow.com/a/29759009
has body: I'm trying to call the draw() function when my "#livemap" li element is clicked. The $("#livemap").click() works fine but draw() doesn't. draw() does work fine when I start the app with the html from livemap.php inside "#content" instead. This leads me to believe that the document.getElementbyId("a") in draw() doesn't yet know that "a" exists in the HTML... So what do I do about it? index.html: ... Map ... livemap.php: Any direction on how to fix this would be much appreciated!
type: Question

http://stackoverflow.com/comment/47761146
type: Comment
type: QuestionComment
has text: What does this have to do with JavaScript?
comment on: http://stackoverflow.com/q/29816966
score: 0

http://stackoverflow.com/q/29817457
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47762067
type: Question
tagged with: http://stackoverflow.com/tag/pdf
has comment: http://stackoverflow.com/comment/47761913
has title: Lauch Acrobat Reader From Javascript
tagged with: acrobat
has body: Wanted to know if we can launch acobat reader from javascript. The requirement is like, when user clicks a button a PDf should be downloaded and opened in adobe reader on the client machine.
score: 0
has comment: http://stackoverflow.com/comment/47762037
answer count: 0
has comment: http://stackoverflow.com/comment/47761906

http://stackoverflow.com/q/29750706
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/29751128
has answer: http://stackoverflow.com/a/29751064
type: AnsweredQuestion
has title: Fading out option
possible better answer: http://stackoverflow.com/a/29751064
has answer: http://stackoverflow.com/a/29751128
type: Question
has body: $(function(){ var $btn = $('#activate'); $btn.click(function(){ var $this = $(this); $this.attr('disabled', 'disabled').html("Activated"); $("#countdown").countdown360({ radius : 40, seconds : 10, fontColor : '#FFFFFF', autostart : false, onComplete : function () { console.log('done');} }).start(); setTimeout(function () { $this.removeAttr('disabled').html('Activate'); }, 10000); }); }); I've put timer that can be activated by clicking on a button. So I want from timer to fade out when the action is complete (after 10 seconds)....thanks for adding the solution. Next question is: how to define cancel button when I click on it I want to: activate button to be enabled again stop countdown timer
answer count: 2
has comment: http://stackoverflow.com/comment/47634181

http://stackoverflow.com/comment/47576048
has text: @kidA I followed instructions from the codex page about jQuery noConflict Wrappers http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers
comment on: http://stackoverflow.com/q/29720668
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29779058
has comment: http://stackoverflow.com/comment/47708292
has comment: http://stackoverflow.com/comment/47736278
score: 0
has body: You simply just have to allow what you want, not determine what you don't want. This is easy by determining if the keyCode is a period (190) or in between 48 and 57. function validateNum(e) { var elem = document.getElementById("txtprice"); if (e.keyCode &gt;= 48 &amp;&amp; e.keyCode &lt;= 57 || e.keyCode == 190) { var txt = elem.value; if (e.keyCode == 190 &amp;&amp; txt.match(new RegExp('\\.','g')).length &gt; 1) { e.preventDefault(); } } else { e.preventDefault(); } } Here is a working js fiddle: http://jsfiddle.net/e72uqvbv/ UPDATE: I miss understood the period situation request, I have updated my answer.
answers question: http://stackoverflow.com/q/29775955
type: Answer

http://stackoverflow.com/a/29792718
has body: here is a working jsfiddle of your code: new Chart(rice).Line(riceData); http://jsfiddle.net/mahmalsami/jqcthmyo/ So the problem is definitively coming from your external Chart.min.js inclusion You may find a 404 on your js get. Please make sure you're linking to the correct js folder. (try accessing your localhost/Chart.min.js to see if you can access to your file)
has comment: http://stackoverflow.com/comment/133448137
type: Answer
has comment: http://stackoverflow.com/comment/107082381
has comment: http://stackoverflow.com/comment/106898269
accepted answer of: http://stackoverflow.com/q/29785623
upvote count: 10
answers question: http://stackoverflow.com/q/29785623
type: AcceptedAnswer
downvote count: 0
score: 10

http://stackoverflow.com/a/29834526
type: Answer
answers question: http://stackoverflow.com/q/29834479
upvote count: 2
has body: function oddEven() { var i, elements = document.getElementsByTagName("p"); for(i = 0; i &lt; elements.length; i += 1) { elements[i].className = i % 2 === 0 ? "even" : "odd"; } } You can also do it directly with CSS without any JavaScript: p:nth-child(even) { background: #00ff00; } p:nth-child(odd) { background: #ff0000; } This only works if the ps share a common parent though.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29834479
has comment: http://stackoverflow.com/comment/47795913
score: 2

http://stackoverflow.com/comment/47577199
type: Comment
type: QuestionComment
has text: better you create a jsFiddle at https://jsfiddle.net/ so that it would be more clear
comment on: http://stackoverflow.com/q/29718750
score: 0

http://stackoverflow.com/q/29805854
has answer: http://stackoverflow.com/a/29808339
type: Question
has comment: http://stackoverflow.com/comment/47739803
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I'd like to attach some fixed alerts underneath the navbar-fixed navigation bar in bootstrap. My best attempt to this point is to make a div positioned at 50px with position: fixed; and width: 100%, and to insert the alerts in this div. The problem is that this cuts off the top of my other content the same way that navbar-fixed cuts off content when one fails apply padding to the body element. #Alerts { position: fixed; width: 100%; top: 50px; } .alert { top: 0px; //position: fixed; padding-left: 15px; padding-right: 15px; padding-top: 4px; padding-bottom: 4px; margin-bottom: 0px; border-radius: 0px; } body { padding-top: 50px; // to avoid 'underlapping' the navbar } Here's a link to a not-working example: http://www.bootply.com/pnEHtLhUBi My best idea at the moment is to use JS to adjust the padding-top value on body as alerts are created/destroyed, but this is likely bad for maintenance/readability and I'd prefer to do something more declarative with css. Any suggestions?
tagged with: twitter-bootstrap-3
type: UnansweredQuestion
upvote count: 1
has title: Fixed divs under the bootstrap fixed nav
has comment: http://stackoverflow.com/comment/47739873
has answer: http://stackoverflow.com/a/29808502
score: 1

http://stackoverflow.com/q/29779357
has answer: http://stackoverflow.com/a/29779408
possible better answer: http://stackoverflow.com/a/29779411
has comment: http://stackoverflow.com/comment/47688799
has answer: http://stackoverflow.com/a/29779411
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29779449
tagged with: javascript
has body: I am trying to pull an object's property and make that string a lowercase string. For some reason it's not working: I have an object, story, that has a property called status. The status reads as "Vacant" or "Occupied" or some other things. I want to write the code so the admins of this sheet can write either "Vacant" or "vacant" and not have to worry about capitalizing. The status also shows on the page, so it's best to show the proper capitalization of "Vacant". But that's besides the point. I have an if statement: $.each(story, function(i){ if(story[i].status == "vacant"){ showVacant(i-1); } else if(story[i].status == "occupied"){ showOccupied(i-1); } else if(story[i].status == "feature"){ showFeatured(i-1); } else { showVacant(i-1); } }); I tried using the toLowerCase(); in the if statement: if(story[i].status.toLowerCase() == "vacant"){ but console returned the error Cannot read property 'toLowerCase' of undefined. I also tried making it a variable with .toString() first as well: myStatus = story[i].status.toString(); if(myStatus.toLowerCase() == "vacant"){ But this gives me a console error Cannot read property 'toString' of undefined How can I make sure the strings are always lowercase when it comes to this statement?
has title: Javascript - 'toLowerCase()' not working on object property
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/29779449

http://stackoverflow.com/comment/47701762
has text: Yep, [doesn’t seem to be supported](http://caniuse.com/#feat=download)…
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29785990

http://stackoverflow.com/q/29697836
tagged with: jasmine
has body: I Just updated to protractor 2.0 and I found some issues in my project. An expect() fails because given text is '' it seems expect is done before sendKeys() is finished. elem.clear().sendKeys('Message'); expect(elem.getAttribute('value')).toBe('Message'); The error I get is: Expected '' to be 'Message'. That worked before updating to protractor 2.0, and I know that one of the beaking changes is related with then() and promises: To enable the update and remove confusion, this removes the element().then function unless there is an action result. This function is completely unnecessary, because it would always resolve to itself, but the removal may cause breaking changes. In other words, an ElementFinder is now no longer a promise until an action has been called. But in other tests of my project it works, I think that the problem might be related that I am doing that expect inside a loop. Here whole code describe('message', function() { it('Should fill out visible message fields', function(){ getDisplayedElements(element.all(by.model('message'))) .then(function(displayedMessageInputs){ _.each(displayedMessageInputs, function(elem){ elem.clear().sendKeys('Message'); expect(elem.getAttribute('value')).toBe('Message'); }); }); }); }); If I use then() functions it works but... I don't like it! elem.clear().sendKeys('Message') .then(function(){ return elem.getAttribute('value'); }) .then(function(inputValue){ expect(inputValue).toBe('Message'); });
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: Protractor 2.0 is not waiting to sendKeys() . Promises issue
tagged with: angularjs-e2e
has answer: http://stackoverflow.com/a/29697965
score: 2
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/47936131
tagged with: protractor
tagged with: javascript
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/47609991
type: Comment
comment on: http://stackoverflow.com/a/29738386
has text: I guess I could replace the double quotes upon retrieval but i'm back to the same issue with the escape method.
score: 0
type: AnswerComment

http://stackoverflow.com/a/29745295
has body: function left_padding_zeros(number, length) { var my_string = '' + number; while (my_string.length &lt; length) { my_string = '0' + my_string; } return my_string; }
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29745254

http://stackoverflow.com/comment/47771498
score: 0
type: Comment
has text: I assume you're looking for RequestCycle.get().find(AjaxRequestTarget.class)
type: QuestionComment
comment on: http://stackoverflow.com/q/29810628

http://stackoverflow.com/q/29811230
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29811279
has title: Position: absolute making the image take the whole page
score: 0
has body: I got a slider banner, it works perfectly, but i need to put an posiiton:absolute to put one div above another, and when i do it, it just ignore the width and height i designed for the img, and make the img occupate the whole screen. Could someone help me ? HTML: &lt;div class="row"&gt; &lt;div class="eight columns all"&gt; &lt;img src="img/slide_1.jpg" class="hide" id="img-slide"&gt; &lt;img src="img/slide_2.jpg" class="hide" id="img-slide"&gt; &lt;img src="img/slide_3.jpg" class="hide" id="img-slide"&gt; &lt;!--&lt;p&gt;&gt;&gt;&lt;/p&gt; --&gt; &lt;/div&gt; CSS: .all img{ margin:15px; height: 95%; width:95%; border-radius:5px; position:absolute; } .all img.show{ opacity:1; left: 0px; -webkit-transition:all 1.0s ease-in-out; -moz-transition:all 1.0s ease-in-out; -o-transition:all 1.0s ease-in-out; transition:all 1.0s ease-in-out; } .all img.hide{ left: -1000px; opacity: 0; -webkit-transition:all 1.0s ease-in-out; -moz-transition:all 1.0s ease-in-out; -o-transition:all 1.0s ease-in-out; transition:all 1.0s ease-in-out; } And the JS: function loop() { var listPict = document.getElementsByClassName('all')[0].children; var old = listPict.length - 1; var current = 0; listPict[current].setAttribute('class', 'show'); listPict[old].setAttribute('class', 'hide'); old = current; current++; if (current === listPict.length) current = 0; setTimeout(loop, 3000); }
answer count: 1
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/47769654
type: AnswerComment
has text: They all trigger `submit`. You need to check which button triggered it. You can do that with `ev.target` inside the `submit` event.
type: Comment
comment on: http://stackoverflow.com/a/29821481
score: 0

angular-strap
tag name: angular-strap
type: Tag
tags question: http://stackoverflow.com/q/29835100

http://stackoverflow.com/comment/47745607
type: Comment
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/29807458
has text: @PatrickM: [The module is written in C++](https://github.com/fbzhong/node-cityhash), so there is no JS to copy & paste.

http://stackoverflow.com/comment/47517518
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29689145
has text: dont undestand the last u say but i try the solutionated do not understand what you say , because I have all code within the $(document).ready(function(){... , if u can doing a example in pastebin and show me

http://stackoverflow.com/q/29756287
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29756346
has answer: http://stackoverflow.com/a/29756407
has comment: http://stackoverflow.com/comment/47644921
has body: I'm trying to make the entire li tag area clickable as well as the text which I have made clickable already. I have tried giving it a href property but that doesn't work. I have already set the li background to change color when it's hovered over but as I said, how do I also make the entire area clickable? Thanks in advance. HTML: Lakeside Books <!--[if IE]> <![endif]--> Welcome To Lakeside Books Home Categories Bestsellers Contact LAKESIDE BOOKS KERRYS LOCAL BOOKSTORE Best Selling Books Right Now The Girl On The Train Paula Hawkins Meet Me In Manhattan Claudia Carroll The Pointless Book 2 Alfie Deyes CSS: html, body { /* ### */ margin:0; padding:0; height:100%; width:100%; } body { background-color: #fdfdfd; font-family: Arial, "Open Sans", sans-serif-light, sans-serif, "Segoe UI"; } #wrapper { width: 100%; height: 100%; margin:0 0 0 20%; /* ### */ } #sidebar { background-color: #212528; position: fixed; width: 20%; height: 100%; top: 0; left: 0; overflow: hidden; } #nav { color: #DADADA; display: block; max-width: 100%; } #nav ul { padding-left: 0; } #nav li { list-style-type: none; margin: 0; padding: 0.75em 0 0.75em 0; text-align: center; max-width: 100%; } #nav li:hover { background:#333; } #nav li a { display: block; padding: 0.5em 0; } .link { text-align: right; margin-right: 25%; letter-spacing: 1px; } a:link, a:visited, a:hover, a:active{ color: #DADADA; text-decoration: none; } #welcometext { text-align: center; font-style: italic; text-transform: uppercase; font-size: 1em; margin-top: 2em; } #searchbar { width: 70%; margin-left: auto; margin-right: auto; padding: 1em 1em 0.5em 1em; text-align: right; } #searchbar .searchstyle{ -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } #searchbar input { max-width: 95%; } #sectionone { /*position: fixed;*/ top: 0; right: 0; width: 80%; } #containerone { margin-top: 0; width: 80%; height: 100%; margin-left: auto; margin-right: auto; text-align: center; border-bottom: 2px solid #DADADA; box-s…
has comment: http://stackoverflow.com/comment/47645145
accepted answer: http://stackoverflow.com/a/29756346
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
favorite count: 0
upvote count: 2
type: AnsweredQuestion
has title: How To Make Entire 'li' Area and Text A Clickable Link
has answer: http://stackoverflow.com/a/29756588
has comment: http://stackoverflow.com/comment/47644947
type: Question
score: 2
possible better answer: http://stackoverflow.com/a/29756407
downvote count: 0
has answer: http://stackoverflow.com/a/29756527

google-chrome
tags question: http://stackoverflow.com/q/29755486
tags question: http://stackoverflow.com/q/29787549
tags question: http://stackoverflow.com/q/29826199
tags question: http://stackoverflow.com/q/29776011
tags question: http://stackoverflow.com/q/29733784
tags question: http://stackoverflow.com/q/29703231
tags question: http://stackoverflow.com/q/29826909
tags question: http://stackoverflow.com/q/29795924
tags question: http://stackoverflow.com/q/29795807
tags question: http://stackoverflow.com/q/29797825
tags question: http://stackoverflow.com/q/29818384
tags question: http://stackoverflow.com/q/29712793
tags question: http://stackoverflow.com/q/29774836
tags question: http://stackoverflow.com/q/29818457
tags question: http://stackoverflow.com/q/29782991
tags question: http://stackoverflow.com/q/29793360
tags question: http://stackoverflow.com/q/29838052
tags question: http://stackoverflow.com/q/29798185
tags question: http://stackoverflow.com/q/29773833
tags question: http://stackoverflow.com/q/29809200
tags question: http://stackoverflow.com/q/29716122
tags question: http://stackoverflow.com/q/29818829
tags question: http://stackoverflow.com/q/29732195
tags question: http://stackoverflow.com/q/29752487
tags question: http://stackoverflow.com/q/29698466
tags question: http://stackoverflow.com/q/29825934
tags question: http://stackoverflow.com/q/29723060
tags question: http://stackoverflow.com/q/29697561
tags question: http://stackoverflow.com/q/29809688
tags question: http://stackoverflow.com/q/29773562
tags question: http://stackoverflow.com/q/29787932
tags question: http://stackoverflow.com/q/29802937
tags question: http://stackoverflow.com/q/29812914
tags question: http://stackoverflow.com/q/29709291
tags question: http://stackoverflow.com/q/29802732
tags question: http://stackoverflow.com/q/29786604
tags question: http://stackoverflow.com/q/29806276
tags question: http://stackoverflow.com/q/29736331
tags question: http://stackoverflow.com/q/29707615
tags question: http://stackoverflow.com/q/29724974
tags question: http://stackoverflow.com/q/29718763
tags question: http://stackoverflow.com/q/29802740
tags question: http://stackoverflow.com/q/29744566
tags question: http://stackoverflow.com/q/29740028
tags question: http://stackoverflow.com/q/29797563
tags question: http://stackoverflow.com/q/29698988
tags question: http://stackoverflow.com/q/29744784
type: Tag
tags question: http://stackoverflow.com/q/29709107
tags question: http://stackoverflow.com/q/29790450
tags question: http://stackoverflow.com/q/29709354
tags question: http://stackoverflow.com/q/29726604
tags question: http://stackoverflow.com/q/29780938
tag name: google-chrome
tags question: http://stackoverflow.com/q/29698064
tags question: http://stackoverflow.com/q/29821843
tags question: http://stackoverflow.com/q/29793012
tags question: http://stackoverflow.com/q/29731465
tags question: http://stackoverflow.com/q/29827748
tags question: http://stackoverflow.com/q/29818554
tags question: http://stackoverflow.com/q/29774144
tags question: http://stackoverflow.com/q/29757165
tags question: http://stackoverflow.com/q/29810689
tags question: http://stackoverflow.com/q/29780700
tags question: http://stackoverflow.com/q/29789503
tags question: http://stackoverflow.com/q/29761386
tags question: http://stackoverflow.com/q/29693277
tags question: http://stackoverflow.com/q/29789841
tags question: http://stackoverflow.com/q/29729067
tags question: http://stackoverflow.com/q/29831774
tags question: http://stackoverflow.com/q/29725201
tags question: http://stackoverflow.com/q/29752326
tags question: http://stackoverflow.com/q/29694992
tags question: http://stackoverflow.com/q/29691302
tags question: http://stackoverflow.com/q/29783044
tags question: http://stackoverflow.com/q/29795933
tags question: http://stackoverflow.com/q/29754096
tags question: http://stackoverflow.com/q/29770912
tags question: http://stackoverflow.com/q/29835004

http://stackoverflow.com/comment/47612318
has text: i don't think you can run javascript from the shell. but i'm not sure. your saying it worked in the past?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29739604

http://stackoverflow.com/a/29777076
score: 0
has comment: http://stackoverflow.com/comment/47709990
type: Answer
has body: Avoid watches An event would be the appropriate way to go for this kind of requirement, like how alex has pointed out. A plunk demonstrating an example: http://plnkr.co/edit/v6OXjOXZzF9McMvtn6hG?p=preview But for this particular scenario, I don't think the "angular way" is the "way". Given the nature of how $broadcast and/or $emit works (i.e. the default way events work in angular) I would avoid them...(Read the docs to understand why). In short, these mechanisms are meant to trigger listeners (attached to some scope) up/down the scope heirarchy. You don't really need all that. (Ref code for $emit) I'd normally rely on other event propagation mechanisms (considering this pattern of requirement). app.controller('MainCtrl', function($scope, SessionService, $document){ // You will want to invoke attachUser some other way (perhaps on authentication), this is for test purposes only $scope.isLoggedIn = false; $document.bind('$loggedin', function(){ $scope.isLoggedIn = true; $scope.user = SessionService.fName; }); $scope.logout = function() { SessionService.attachUser(null, null); $scope.isLoggedIn = false; }; }); app.controller('LoginCtrl', function($scope, SessionService, $document){ $scope.doLogin = function() { console.log('doLogin'); SessionService.attachUser(1234, $scope.username); var doc = $document[0]; var evt = new Event('$loggedin'); doc.dispatchEvent(evt); }; }); Plunk Of course, when you are done with that view, always cleanup. Handle the $destroy event on that controller's scope and unbind the event handler... $scope.$on('$destroy', function() { $document.unbind('$loggedin'); }; Refer MDN for more on how to trigger events using DOM. Update: [24 Sep] Here is a small directive setup which demonstrates the point: app.directive('ngNest', function($parse, $compile, $timeout){ var end = false; var level = 0; var fnPostLink = function(scope, element, attrs) { //console.log('start:', ++fnPostLink.count); var lvl = attrs.level; if(!lvl) { throw 'Level not specified'; …
has comment: http://stackoverflow.com/comment/47684684
has comment: http://stackoverflow.com/comment/47688521
has comment: http://stackoverflow.com/comment/52939792
has comment: http://stackoverflow.com/comment/47688343
answers question: http://stackoverflow.com/q/29774838
has comment: http://stackoverflow.com/comment/47688207

http://stackoverflow.com/comment/47677855
type: Comment
has text: Yes, you need to know that the member is actually there and that it's a number
comment on: http://stackoverflow.com/a/29773536
score: 0
type: AnswerComment

http://stackoverflow.com/a/29789221
has comment: http://stackoverflow.com/comment/47713982
score: 1
has comment: http://stackoverflow.com/comment/47732247
has body: Try with - $stmt-&gt;bind_param('sssssssss',$target_path, $date, $retrace, $start_of_swing_trade, $end_of_swing_trade, $bull_flag, $bear_flag, $ema_crossover, $trading_instrument); if(!$stmt){ exit("bind failed");} //will return 0 if fail if($stmt-&gt;execute() != 0){ $success = true; }else{ $success = false; } header('location:yourform.php?success='.$success); exit; On you form page add a check for it - if (isset($_GET['success']) &amp;&amp; $_GET['success']) { echo "New record created successfully"; } else if (isset($_GET['success']) &amp;&amp; !$_GET['success']) { echo "Failed to insert new record"; }
downvote count: 0
has comment: http://stackoverflow.com/comment/47713381
upvote count: 1
has comment: http://stackoverflow.com/comment/47714373
has comment: http://stackoverflow.com/comment/47714019
has comment: http://stackoverflow.com/comment/47714911
type: Answer
has comment: http://stackoverflow.com/comment/47713490
has comment: http://stackoverflow.com/comment/47714337
answers question: http://stackoverflow.com/q/29789153

http://stackoverflow.com/comment/133696190
has text: Weirdly, removing useFakeTimers did not work for me (jest@29.5.0): ``` jest.useFakeTimers().setSystemTime(new Date('2021-08-16T12:00:00.000Z')); // worked jest.setSystemTime(new Date('2021-08-16T12:00:00.000Z')); // dates generated via 'getTime' will be the real date ```
comment on: http://stackoverflow.com/a/63377110
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29798536
tagged with: dropzone.js
score: 0
has title: Including an external javascript script breaks the submission of a form which has remote:true
has answer: http://stackoverflow.com/a/29801807
possible better answer: http://stackoverflow.com/a/29799734
tagged with: ruby-on-rails
type: AnsweredQuestion
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29799734
accepted answer: http://stackoverflow.com/a/29801807
has body: I have a new.html.erb file which contains a form to create a new listing. Now this page also has a dropzone element taken from dropzone.js for letting the users drop there images which later gets uploaded. This form has remote:true Here are the codes:- /new.html.erb/ <%=form_for @listing, :html=> { class:'ui form centered black segment'},remote: true do |f|%> New Listing Create New Listing Manage your preferences Title <%=f.text_field :title,placeholder:'Title of the listing'%> Pet <%= f.select(:pet_type,options_for_select([['Dog',1,{class:'item'}],['Cat',2,{class:'item'}],['Bird',3,{class:'item'}]]),{prompt:'Pet'},class:'ui dropdown pet_type')%> Breed <%= f.select(:breed_type,options_for_select(Breed.all.collect{|x| [x.name,x.id,class:'item']}),{prompt:'Breed'},class:'ui dropdown disabled breed_type')%> Gender <%= f.select(:gender,options_for_select([['Male',1,{class:'item'}],['Female',2,{class:'item'}]]),{prompt:'Gender'},class:'ui dropdown gender')%> State State Alabama Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware District Of Columbia Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming Tell everyone in short about your pet <%=f.text_area :love_for_pets%> Additional Info Price <%=f.text_field :price,placeholder:"Price"%> Phone Number <%=f.text_field :phone_no,placeholder:"Phone_no"%> I agree to the Terms of Service. We noticed some issues <%=f.submit 'Register',class:'ui button'%> <%end%> Upload Images Upload File Drop your images here /ListingController/ class ListingsController < ApplicationController def new @breeds=Breed.all @listing=Listing.new end def create @listing=Listing.new(listing_par…
tagged with: javascript

http://stackoverflow.com/q/29720594
tagged with: ajax
has comment: http://stackoverflow.com/comment/47575740
has comment: http://stackoverflow.com/comment/47575733
tagged with: php
type: AnsweredQuestion
downvote count: 0
type: Question
has body: I'm sending Ajax request to a php file, that file returns an JSON array of the submitted data, the first time is great, it sends the data and gets it, so i can use it, but second time it gives me an error SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data My goal is to validate the data in the php file, if the data is not validated then i'm adding an error classes to the fields that are not validated, then the user correct those fields, and sends the form again, without refreshing. My testing shows that its working for the first time, but when i want to send the form the second time, it gives me the above error, any clues what it can be? AJAX : $('#ajax').submit('submit', function(){ var that = $(this), url = that.attr('action'), type = that.attr('method'), data = {}; that.find('[name]').each(function(index, value){ var that = $(this), name = that.attr('name'), value = that.val(); data[name] = value; }); $.ajax({ url: url, type: type, data: data, cache:false, success: function(response){ var json = response, obj = JSON.parse(json); if(obj.title == 'Mrs.'){ // $('#title').addClass('has-warning'); $(function () { $('#name').tooltip({ 'title': 'Please fill name'}); }); } alert(obj.title); } }); return false; }); PHP file: if(Input::exists()){ if(token::check(Input::get('token'))){ echo json_encode( array( "title" =&gt; Input::get('title') ) ); } }
score: 1
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has comment: http://stackoverflow.com/comment/47575760
has answer: http://stackoverflow.com/a/29720684
accepted answer: http://stackoverflow.com/a/29720684
upvote count: 1
answer count: 1
has title: AJAX won't get JSON data second time
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/47747922
has text: How would I insert that value? Ie. If I have it req.params.username? That is to say, how would I replace Mich with a variable?
comment on: http://stackoverflow.com/a/29809918
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29764648
type: Answer
has comment: http://stackoverflow.com/comment/47663459
accepted answer of: http://stackoverflow.com/q/29764311
upvote count: 1
has comment: http://stackoverflow.com/comment/47661782
score: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47661007
has body: I think you are using Meteor in the wrong way. You should understand the data context you are in. With {{#each queries}} you set the data context of the loop to each element. So within your event 'click .btn-remove' you should be able to fetch the id directly with this.id instead of using data attributes. Like this: {{#each queries}} ... X {{/each}} And in the template event: Template.messagesNew.events({ 'click .btn-remove': function(e) { var queryId = this.id; //get the current item id with this.id //then do whatever you want based on the queryId you got ... } });
answers question: http://stackoverflow.com/q/29764311

http://stackoverflow.com/comment/47656980
score: 0
type: AnswerComment
has text: I don't know how I missed that one in the docs. Makes sense, thanks!
type: Comment
comment on: http://stackoverflow.com/a/29761351

http://stackoverflow.com/a/29691455
has body: jQuery.contains only returns boolean and doe not have a callback. Try this code. $(document).ready(function(){ alert($.contains(document.body,$('p')[0])); });
downvote count: 0
answers question: http://stackoverflow.com/q/29691398
has comment: http://stackoverflow.com/comment/47519634
type: Answer
has comment: http://stackoverflow.com/comment/47519474
score: 1
upvote count: 1

http://stackoverflow.com/q/29833642
has answer: http://stackoverflow.com/a/29833798
downvote count: 2
accepted answer: http://stackoverflow.com/a/29833798
has title: How do I enter data in array from a text file in JavaScript?
has body: I would like to populate an array using the data in text file in JavaScript. The data in text file is in the following format: 0.1 0.5 0.2 0.8 0.3 0.7 0.4 0.9 0.5 0.2 and so on..
has comment: http://stackoverflow.com/comment/47795878
type: AnsweredQuestion
score: -2
has comment: http://stackoverflow.com/comment/47794009
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47794011
has comment: http://stackoverflow.com/comment/47793974

http://stackoverflow.com/q/29832371
score: 3
type: Question
has title: Meteor + Materialize: collapsable in for each doesn't work
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: meteor
favorite count: 0
has answer: http://stackoverflow.com/a/29834956
tagged with: collapsable
tagged with: materialize
tagged with: http://stackoverflow.com/tag/html
has body: I have a collapsable (materialize) whose elements are created from a for each, however the "dropdown" doesn't work. Everything that isn't in the for each works. How can I fix this problem? jobList.html {{#each jobs}} {{title}} {{description}} {{/each}} jobList.js Template.jobList.rendered = function () { $('.collapsible').collapsible({ accordion: false }); }; Template.jobList.helpers({ jobs: function() { return Jobs.find(); } }); The template jobList is in another template that does nothing appart from having {{> jobList}}.
upvote count: 3
accepted answer: http://stackoverflow.com/a/29834956
type: AnsweredQuestion

http://stackoverflow.com/comment/47734217
has text: I haven't been able to reproduce the problem. Are you sure this code contains it and that you haven't created a reduced test case where the problem is one of the things you've removed?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29802972

http://stackoverflow.com/q/29764508
has comment: http://stackoverflow.com/comment/47662847
downvote count: 0
has comment: http://stackoverflow.com/comment/47662524
score: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47697605
has body: I am using jssor`s simple fade slider and It is working fine but there is an issue with height and width .. Actually I am using the width as percentage and the problem cause by it is that as I increases width height also increases similarly for vice versa.. What I want is height of the slider remain fixed but the width changes accordingly ..
favorite count: 0
linked to: http://stackoverflow.com/q/25371616
type: Question
has comment: http://stackoverflow.com/comment/47663789
has comment: http://stackoverflow.com/comment/47706932
tagged with: css
tagged with: jssor
has answer: http://stackoverflow.com/a/33088046
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/47662967
has title: Jssor Slider Fixed Height with dynamic width
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/47670432
type: Comment
type: QuestionComment
has text: @AleksandrM not possible, exact duplicate, he has even copied the user name that posted the question...
comment on: http://stackoverflow.com/q/29767221
score: 0

http://stackoverflow.com/comment/47675905
score: 2
has text: What is the `http` request for? Is it getting the myModalContent.html partial? The 404 is telling you exactly what the issue is. It can't find that html partial. Is your server up? If you type that entire url in a separate browser tab what is the response?
comment on: http://stackoverflow.com/q/29772609
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29744512
answer count: 1
has comment: http://stackoverflow.com/comment/47622589
has comment: http://stackoverflow.com/comment/47623656
has body: I want to display google map inside repeater from database values comes, i searched on google and reached to this result but not working with me i don't know if it have something missing or not can you help me please. <asp:Literal runat="server" ID="Literal1"></asp:Literal> Here my code behind aspx.cs, public class Markers { public string City { get; set; } public string Latitude { get; set; } public string Longitude { get; set; } } void GetData(string strRsult) { XmlDataDocument xmlDataDoc = new XmlDataDocument(); xmlDataDoc.LoadXml(strRsult); Literal1.Text = " "; } } XML file - <AVSearch_PropertyDetails RequestedCurrency="EUR"> - <Property IDHotel="10000" PropertyCode="10000" Hotelname="REZ:Online HOTEL" StarCategory="0" ImageIdentifier="RHN_10000" NumberOfRooms="80" CheckinTime="00:00" CheckoutTime="23:59" Email="info@r-h-n.com" Status="0" StatusInfo=""> - - <Distance Type="1" Distance="0.50" /> <Distance Type="2" Distance="1.81" /> - <Description IDLanguage="4" IDType="1" Text="This is the test hotel used for testing and debugging purposes only. Please do not book this hotel." /> <Description IDLanguage="4" IDType="4" Text="This is a testhotel" /> <Description IDLanguage="4" IDType="3" Text="Terms & conditions EN" /> `
has title: how to display G map by repeater and markers from database
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/47622836
upvote count: 5
has comment: http://stackoverflow.com/comment/47622171
has answer: http://stackoverflow.com/a/29744891
has comment: http://stackoverflow.com/comment/47623194
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47623597
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/47622551
tagged with: c#
score: 5
tagged with: google-maps
tagged with: javascript
has comment: http://stackoverflow.com/comment/47621917

http://stackoverflow.com/a/46377138
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29789833
has body: Add below css code .ui-select-choices-content{ overflow-y:scroll !important; &amp;::-webkit-scrollbar { width: 8px !important; } &amp;::-webkit-scrollbar-thumb { border-radius: 7px; -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3); background-color: red; } }
upvote count: 1
type: Answer

http://stackoverflow.com/a/29716449
answers question: http://stackoverflow.com/q/29716169
score: 0
type: Answer
has body: I solved the problem, All I had to do was to convert cellphones to string,no need to hidden element I just added this line of code: var cellPhone=cellPhones.toString();

http://stackoverflow.com/comment/47770773
comment on: http://stackoverflow.com/q/29822056
type: Comment
type: QuestionComment
has text: @erik Same thing - blank page
score: 0

http://stackoverflow.com/comment/47682168
type: AnswerComment
type: Comment
has text: thanks for your answer, but unfortunately i can have more than 1 dom with the exact same text whitin the same parent.
comment on: http://stackoverflow.com/a/29773051
score: 0

http://stackoverflow.com/comment/47798806
has text: that's because you need to focus in first (click the result area), and you won't see the resume button if you focus out after the 'Full' message is shown. that was how your code was like, and it's working just fine now ;)
type: AnswerComment
comment on: http://stackoverflow.com/a/29722926
score: 0
type: Comment

http://stackoverflow.com/q/29771468
has title: Iframe click make div show hide
type: AnsweredQuestion
tagged with: iframe
type: Question
has answer: http://stackoverflow.com/a/29771609
tagged with: c#
tagged with: javascript
tagged with: jquery
score: 0
has body: I have an iframe on which it opens a page which has three links. I want to show the div on one of its links. Please suggest what to do. Here is my code: this is a test div // Hide this div To have a full view click here Locate Us Please suggest..!!!
answer count: 1
accepted answer: http://stackoverflow.com/a/29771609
tagged with: asp.net

http://stackoverflow.com/a/29807335
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29782430
downvote count: 0
has body: Thanks a lot @adelriosantiago, I added a condition to check points or point property depends of series or pie. The latest version of highcharts (4.1.5) have problem to display tooltip of embedded pie, I had to use a previous version (4.0.4) formatter : function() { var s = '' + this.x + ''; var color = null; if (typeof this.points != 'undefined') { $.each(this.points, function(i, point) { color = point.series.color.stops[1][1]; if (i == 3) { s += ' \u00A2 '; s += point.series.name + ': ' + Highcharts.numberFormat(point.y, 2); } else { s += ' \u25CF '; s += point.series.name + ': ' + Highcharts.numberFormat(point.y, 0); } }); } else { color = this.point.color.stops[1][1]; s = ' ' + this.point.name + ' '; s += ' \u25CF '; s += Highcharts.numberFormat(this.point.y, 2) + ' (' + Highcharts.numberFormat(this.point.percentage, 2) + '%)'; } return s; } Here the full fix http://jsfiddle.net/castocolina/2mdt9rhb/4/
upvote count: 2

http://stackoverflow.com/q/29791367
upvote count: 1
answer count: 1
downvote count: 0
favorite count: 0
has body: My program is a web based windows app. I found I can drag the links in app to desktop and the system will create a shortcut that will expose my true url, and some bad UE. Is there any way to prevent this?
has answer: http://stackoverflow.com/a/29800559
accepted answer: http://stackoverflow.com/a/29800559
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47729353
type: AnsweredQuestion
score: 1
tagged with: web-applications
type: Question
tagged with: javascript
has title: Is there any way to prevent users dragging a link to desktop and create a shortcurt?
linked to: http://stackoverflow.com/q/16205940

http://stackoverflow.com/comment/47640691
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29754102
has text: Yeah, I gleaned over the link contents. At "Further examples" section, "Workers are mainly useful for allowing your code to perform processor-intensive calculations without blocking the user interface thread". But my prob is that my user interface thread integrity isn't the issue, it's the reverse ( Flash video ) lol.

events
tags question: http://stackoverflow.com/q/29732741
tags question: http://stackoverflow.com/q/29844153
tags question: http://stackoverflow.com/q/29689920
tags question: http://stackoverflow.com/q/29691166
tags question: http://stackoverflow.com/q/29799757
tags question: http://stackoverflow.com/q/29718833
tags question: http://stackoverflow.com/q/29772653
tags question: http://stackoverflow.com/q/29728429
tags question: http://stackoverflow.com/q/29693789
tags question: http://stackoverflow.com/q/29788306
tags question: http://stackoverflow.com/q/29759276
tags question: http://stackoverflow.com/q/29764242
tag name: events
tags question: http://stackoverflow.com/q/29779216
tags question: http://stackoverflow.com/q/29804126
tags question: http://stackoverflow.com/q/29758731
type: Tag
tags question: http://stackoverflow.com/q/29741849

http://stackoverflow.com/a/29991618
has body: So I used ember-cli and finally figured out a way to get this working. I used the ember-cli g route to generate my routes. I ran it once for each of my routes except for application. After that things just worked properly. Here is a git repository that someone created for me that will help anyone with this same problem : https://github.com/mooror/mooror. Thanks everyone
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29786001
answers question: http://stackoverflow.com/q/29786001
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/29778195
has comment: http://stackoverflow.com/comment/47689383
has comment: http://stackoverflow.com/comment/47758232
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29777990
type: Answer
score: 3
upvote count: 3
has body: When localStorage is modified, a storage event will be fired on all other pages that share the storage. You just need to handle the event, and retrieve updated data. This also works for sessionStorage. document.addEventListener('storage', function(e) { // don't forget to take a look at the parameter - event object // update your page here, good luck }, false);
answers question: http://stackoverflow.com/q/29777990
has comment: http://stackoverflow.com/comment/47702957

http://stackoverflow.com/q/29828051
has title: Catch error and log as if it was not caught
has body: I'm not sure about the title. Here is an example : function myFct() { throw("error"); // line 2 } function Foo() { try { myFct(); } catch (e) { console.error("Error in myFct :"); // line 10 console.debug(e); } } Foo(); The console will output : Error in myFct : (myFile.js:10) [Details about error] (myFile.js:11) I want my console to output something like this : Error in myFct : (myFile.js:10) [Details about error] (myFile.js:2) Note the line 2. I want the same output as if I was not catching the error. It would be really useful for debug. I'm using Chrome Dev Tools but any cross browser solution is a huge plus. Note : feel free to edit the title to better match future searches, I can't find a simple way to explain my wish
type: AnsweredQuestion
tagged with: error-handling
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29828358
accepted answer: http://stackoverflow.com/a/29828358
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47782650
tagged with: javascript
score: 1
favorite count: 0

http://stackoverflow.com/comment/47609777
comment on: http://stackoverflow.com/q/29737885
type: Comment
has text: You can set the additional class name into the textbox(with the same class name), and loop over it.
type: QuestionComment
score: 0

http://stackoverflow.com/q/29785887
has body: I have an external script followed by an inline script at the bottom of my &lt;body&gt;. It looks like the inline script is running before the external script, which isn't supposed to happen, according to this answer: If you aren't dynamically loading scripts or marking them as defer or async, then scripts are loaded in the order encountered in the page. It doesn't matter whether it's an external script or an inline script - they are executed in the order they are encountered in the page. Inline scripts that come after external scripts have are held until all external scripts that came before them have loaded and run. Src: https://stackoverflow.com/a/8996894/114855 This is my code: &lt;script src="https://checkout.stripe.com/checkout.js"&gt;&lt;/script&gt; &lt;script&gt; var handler = StripeCheckout.configure({ key: 'pk_live_HhFqemZFyEUJVorFzYvjUK2j', token: function(res) { $('#pay_token').val(res.id); $('#pay_email').val(res.email) $('#pay_amount').val(parseFloat($("#amount").val())*100); $('#pay_description').val($("#description").val()); $('#pay_real').submit(); } }); /* .. */ &lt;/script&gt; &lt;/body&gt; Console is showing that StripeCheckout is not defined (which the external script should define) This makes sense, since the network tab shows that my external request is still pending. But I'm not sure why the browser didn't wait for checkout.js to be fetched:
has answer: http://stackoverflow.com/a/29785931
linked to: http://stackoverflow.com/q/29830272
has answer: http://stackoverflow.com/a/29832079
answer count: 2
score: 5
upvote count: 5
downvote count: 0
has title: Scripts loading out of order in Chrome
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47701529
favorite count: 0
linked to: http://stackoverflow.com/q/8996852
type: Question
linked to: http://stackoverflow.com/q/1206937
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47766618
score: 0
comment on: http://stackoverflow.com/q/29819918
has text: Well, I want to create a small webpage to access and alter a database on the server. This should include a bit of UI, dropdowns, tabs, etc. to insert and delete data. Is this not the proper way to set things up? Again, I am new to this world, so this setup might not even be feasible.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29817014
tagged with: safari-extension
score: 3
upvote count: 3
has answer: http://stackoverflow.com/a/30691260
has body: I am trying to develop the safari extension which does cross script loading. but i am getting the content security policy directive error. Refused to execute inline script because it violates the following Content Security Policy directive: In chrome by adding the content security policy in my manifest.json file i could get away with it. How can i do it for safari extension Any help or clues are mostly appreciated
type: Question
downvote count: 0
tagged with: javascript
answer count: 1
tagged with: browser-extension
has title: How to add Content Security Policy to Safari extension
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/47871522
score: 0
type: Comment
type: QuestionComment
has text: can you provide in your question what you've done so far to us, so we can help you :)
comment on: http://stackoverflow.com/q/29727436

http://stackoverflow.com/comment/47688219
score: 0
type: Comment
has text: An excellent solution @robjez. It works well and does the trick. I had also tried transforms but my version didn't work properly. The only thing I would change in your solution is to give the a left and right margin equivalent to the image size rather than specifying a fixed width. Many thanks for finding the solution! It has been driving me mad for a few days! And, as you say: no JavaScript! Excellent.
comment on: http://stackoverflow.com/a/29773605
type: AnswerComment

http://stackoverflow.com/q/29826851
type: Question
has title: Changing the camera's near plane
has body: I have a view with (buffer) geometry objects and a few different layers of markups, each stored in their own scene. This allows me to easily switch them off or draw them on top of objects regardless of depth. What I'm trying to accomplish is easy cross sections using the camera's near and far fields. I place the (orthographic) camera at the location I'd like to make my 'cut' and that works well. The issue is that I can't 'cut' off my markup layers when I 'cut' through the objects. I would like the markups to still be fully visible. What I've attempted is changing the camera's near field inside the render loop: function animate() { requestAnimationFrame( animate ); renderer.clear(); // Switch the near field for this scene var oldNear = camera.near; camera.near = -1000; renderer.render( sceneFTA, camera ); camera.near = oldNear; // renderer.render( scene, camera ); //the following scenes are always drawn on top renderer.clearDepth(); renderer.render(sceneMarkup, camera); renderer.render(scenePts, camera); } I'm not sure what's going wrong. I can change the camera.near property before the render loop and see the changes take effect, but quickly switching inside the loop doesn't seem to do anything. The result of this is identical to leaving the near field unchanged. Any ideas how I can make the near-field change work?
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29831579
tagged with: javascript
tagged with: three.js
has answer: http://stackoverflow.com/a/29831579
has comment: http://stackoverflow.com/comment/47789256
has comment: http://stackoverflow.com/comment/47783209
type: AnsweredQuestion

http://stackoverflow.com/q/29798271
score: 2
has comment: http://stackoverflow.com/comment/47725254
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29798702
downvote count: 0
favorite count: 0
type: Question
upvote count: 2
has body: I am using node.js and monodb database where I want to query records based on date and I want to ignore time and date only month and year will be matched here is my code:- collection.find({ date: { "$gte": sDate, "$lt": eDate) } }).count(function (e, c) { }); this is working but matching date and time as well how I can match only month and year? Please help me to solve this problem. Edit:- some data from collection:- { "_id" : ObjectId("5535e76f82a964d011e34fcf"), "VisitorId" : "5535e72a82a964d011e34fcb", "date" : ISODate("2015-01-21T06:00:15.761Z"), } { "_id" : ObjectId("5535e75f82a964d011e34fcf"), "VisitorId" : "5535e72a82a964d011e34fcb", "date" : ISODate("2015-04-21T06:00:15.761Z"), } I will pass two params i.e {month:"1",year:"2015"}; and in output first docs should be display. Thanks
answer count: 1
tagged with: node.js
accepted answer: http://stackoverflow.com/a/29798702
tagged with: date
has title: Searching Dates and Ignoring time and date in mongoDB node.js
tagged with: mongodb
tagged with: javascript
linked to: http://stackoverflow.com/q/26308525

http://stackoverflow.com/comment/47769264
has text: Please don't post further questions inside an answer.
type: Comment
comment on: http://stackoverflow.com/a/29820476
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47536715
comment on: http://stackoverflow.com/q/29700409
score: 0
type: Comment
type: QuestionComment
has text: I want the badgethat has not be found @Pointy sry - i changed to variables and shortened them to make it more readable - i ll fix it

http://stackoverflow.com/comment/47807050
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29839854
has text: @hutingung here is odata_odi.PRODUCT sample data.

http://stackoverflow.com/comment/47611102
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29738971
has text: Yeah, I can see that now. check out the comment by @JonathanLonowski above for a better solution...
type: AnswerComment

http://stackoverflow.com/comment/47764967
type: AnswerComment
type: Comment
has text: I agree @Shikkediel.. But here we are talking about scroll and the same says _In general use document mainly to register events and use window to do things like scroll, scrollTop, and resize._!!! and I have also mentioned in my answer to try it not as perfect answer!!
comment on: http://stackoverflow.com/a/29816933
score: 0

http://stackoverflow.com/comment/47638890
has text: I assume that you have the actual version where it says "Here goes the version" right? Since you have internalization, you have `_locales/en` directory and `messages.json` set up? Do you get the same result if you remove the locale bit from manifest? Where it says "Here goes the URL" you have a full working URL right? If all yes then it should work just fine.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29752487

http://stackoverflow.com/q/29791063
type: Question
has answer: http://stackoverflow.com/a/29791141
type: AnsweredQuestion
has body: Here is the code and fiddle: var config = function(){ return { name: ["john", "lucy", "lily"], age: ["22", "21", "22"], gender: ["male", "female", "female"], people: function(index){ index--; this.name = name[index]; this.age = age[index]; this.gender = gender[index]; }, people2: function(index){ index--; this["name"] = name[index]; this["age"] = age[index]; this["gender"] = gender[index]; }, }; }(); alert(config.people(1).name); alert(config.people2(1).name); I can get the value by code like: config.name[1]; I want to restructure a key/value array like: {name:"john",age:22,gender:male} The index value delegates the first, second and third people info. Can anyone help me to get the code working? I'm stuck!
score: 1
accepted answer: http://stackoverflow.com/a/29791164
has title: How to create key/value array by normal array?
downvote count: 0
tagged with: javascript
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/29791164
has answer: http://stackoverflow.com/a/29791662
upvote count: 1
possible better answer: http://stackoverflow.com/a/29791141

php
tags question: http://stackoverflow.com/q/29838142
tags question: http://stackoverflow.com/q/29836478
tags question: http://stackoverflow.com/q/29750806
tags question: http://stackoverflow.com/q/29830121
tags question: http://stackoverflow.com/q/29714789
tags question: http://stackoverflow.com/q/29694984
tags question: http://stackoverflow.com/q/29722215
tags question: http://stackoverflow.com/q/29710266
tags question: http://stackoverflow.com/q/29692997
tags question: http://stackoverflow.com/q/29830098
tags question: http://stackoverflow.com/q/29802780
tags question: http://stackoverflow.com/q/29826006
tags question: http://stackoverflow.com/q/29831625
tags question: http://stackoverflow.com/q/29822149
tags question: http://stackoverflow.com/q/29768070
tags question: http://stackoverflow.com/q/29737777
tags question: http://stackoverflow.com/q/29769342
tags question: http://stackoverflow.com/q/29793283
tags question: http://stackoverflow.com/q/29799512
tags question: http://stackoverflow.com/q/29773198
tags question: http://stackoverflow.com/q/29704204
tags question: http://stackoverflow.com/q/29705734
tags question: http://stackoverflow.com/q/29758369
tags question: http://stackoverflow.com/q/29688594
tags question: http://stackoverflow.com/q/29740963
tags question: http://stackoverflow.com/q/29697654
tags question: http://stackoverflow.com/q/29735265
tags question: http://stackoverflow.com/q/29834966
tags question: http://stackoverflow.com/q/29809751
tags question: http://stackoverflow.com/q/29815866
tags question: http://stackoverflow.com/q/29814286
tags question: http://stackoverflow.com/q/29740089
tags question: http://stackoverflow.com/q/29789946
tags question: http://stackoverflow.com/q/29723588
tags question: http://stackoverflow.com/q/29727836
tags question: http://stackoverflow.com/q/29749532
tags question: http://stackoverflow.com/q/29779201
tags question: http://stackoverflow.com/q/29825933
tags question: http://stackoverflow.com/q/29831797
tags question: http://stackoverflow.com/q/29737237
tags question: http://stackoverflow.com/q/29777380
tags question: http://stackoverflow.com/q/29701738
tags question: http://stackoverflow.com/q/29791332
tags question: http://stackoverflow.com/q/29745821
tags question: http://stackoverflow.com/q/29814761
tags question: http://stackoverflow.com/q/29742102
tags question: http://stackoverflow.com/q/29718750
tags question: http://stackoverflow.com/q/29726569
tags question: http://stackoverflow.com/q/29734856
tags question: http://stackoverflow.com/q/29761081
tags question: http://stackoverflow.com/q/29831077
tags question: http://stackoverflow.com/q/29734853
tags question: http://stackoverflow.com/q/29761289
tags question: http://stackoverflow.com/q/29720594
tags question: http://stackoverflow.com/q/29743018
tags question: http://stackoverflow.com/q/29716062
tags question: http://stackoverflow.com/q/29708162
tags question: http://stackoverflow.com/q/29833592
tags question: http://stackoverflow.com/q/29843807
tags question: http://stackoverflow.com/q/29814446
tags question: http://stackoverflow.com/q/29755655
tags question: http://stackoverflow.com/q/29823666
tags question: http://stackoverflow.com/q/29795058
tags question: http://stackoverflow.com/q/29738938
tags question: http://stackoverflow.com/q/29730479
tags question: http://stackoverflow.com/q/29795212
tags question: http://stackoverflow.com/q/29807765
tags question: http://stackoverflow.com/q/29764767
tags question: http://stackoverflow.com/q/29792448
tags question: http://stackoverflow.com/q/29722046
tags question: http://stackoverflow.com/q/29723732
tags question: http://stackoverflow.com/q/29717023
tags question: http://stackoverflow.com/q/29798110
tags question: http://stackoverflow.com/q/29775303
tags question: http://stackoverflow.com/q/29844047
tags question: http://stackoverflow.com/q/29713268
tags question: http://stackoverflow.com/q/29766626
tags question: http://stackoverflow.com/q/29739624
tags question: http://stackoverflow.com/q/29738869
tags question: http://stackoverflow.com/q/29797367

http://stackoverflow.com/q/29828408
has body: I have a map of the USA that I'm trying to display lat/lon points over. I've mashed together a few examples to get this far, but I've hit a wall. My points are in a csv file, which I'm not sure how to upload here, but it's just 65,000 rows of number pairs. For instance 31.4671154,-84.9486771. I'm mostly following the example from Scott Murray's book here. I'm using the Albers USA projection. var projection = d3.geo.albersUsa() .scale(1200) .translate([w / 2, h / 2]); And setting up the landmarks as an svg group appended to the map container. var svg = d3.select("body").append("svg") .attr("width", w) .attr("height", h) .on("click", stopped, true); svg.append("rect") .attr("class", "background") .attr("width", w) .attr("height", h) .on("click", reset); var g = svg.append("g"); var landmarks = svg.append("g") I read the data and try to set circles at each lat/lon point. d3.csv("./public/assets/data/landmark_latlon_edited.csv", function(error, latlon){ console.log(latlon); landmarks.selectAll("circle") .data(latlon) .enter() .append("circle") .attr({ 'fill': '#F00', 'r': 3 }) .attr('cx', function(d){ return projection([d.lon, d.lat][0]); }) .attr('cy', function(d){ return projection([d.lon, d.lat])[1]; }) .style({ 'opacity': .75 }); }); Now, the problem is that the cx property is not receiving a value. When viewed in the inspector the circles don't show a cx, and, indeed, appear in the svg at the appropriate y values, but in a stacked column at x=0. &lt;circle fill="#F00" r="3" cy="520.8602676002965" style="opacity: 0.75;"&gt;&lt;/circle&gt; I found an old issue I thought might be related here which states that the projection method will return null if you try to feed it values outside of its normal bounding box. I opened the csv in Tableau and saw a couple values that were in Canada or some U.S. territory in the middle of the Pacific (not Hawaii), and I removed those, but that didn't solve the problem. I'm decidedly novice here, and I'm sure I'm missing something obvi…
tagged with: d3.js
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/csv
tagged with: http://stackoverflow.com/tag/svg
tagged with: mapping
has title: D3 projection not setting cx property
has answer: http://stackoverflow.com/a/32016725
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29830823
score: 0
answer count: 2

http://stackoverflow.com/a/29759493
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29759226
type: Answer
accepted answer of: http://stackoverflow.com/q/29759226
has body: The option to pass to Mocha is: --compilers coffee:coffee-script/register. Note the lack of space after the colon. I believe what is happening is that with the space, it tells Mocha that to compile coffee files, it should load a module with a path which is an empty string, and you get the error you get.
score: 0

http://stackoverflow.com/a/29747541
answers question: http://stackoverflow.com/q/29747118
has comment: http://stackoverflow.com/comment/47627758
downvote count: 0
score: 1
has body: One solution might be to use jQuery's promise interface alongside passing in an array of those promises to $.when using apply: var urls = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; // return a promise for each url function getData(url) { return $.ajax({ url: url }); } // return an array of promises function getPromises(urls) { return urls.map(function (url) { return getData(url); }); } // when all the promises have been returned loop over the returned // data and update the table sequentially with each row $.when.apply(null, getPromises(urls)).then(function () { for (var i = 0, l = arguments.length; i &lt; l; i++) { // update row with the data from arguments[i] } }); Note that I've not tested this code, but this is certainly the route I would attempt to take.
type: Answer
upvote count: 1

math
tags question: http://stackoverflow.com/q/29798378
type: Tag
tags question: http://stackoverflow.com/q/29734884
tags question: http://stackoverflow.com/q/29800911
tag name: math

visualization
tags question: http://stackoverflow.com/q/29832994
tag name: visualization
tags question: http://stackoverflow.com/q/29728037
type: Tag

http://stackoverflow.com/comment/47700294
comment on: http://stackoverflow.com/q/29784721
score: 0
type: Comment
type: QuestionComment
has text: When I call the php file from wordpress, the 2nd dropdown will not be filled, allthough when I call the page directly (via URL) then, everything is working fine. Wordpress will not give me any error! I have not called "wp_enqueue_script"? Do I have to call it - alltough my php page is only called from wordpress and not really part of it? Kind Regards, Stefan

http://stackoverflow.com/comment/47750419
type: Comment
score: 0
has text: Thank you. It is really handy. Like this feature since Python.
type: AnswerComment
comment on: http://stackoverflow.com/a/29804014

http://stackoverflow.com/a/29757087
has comment: http://stackoverflow.com/comment/47649527
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47649288
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29718887
has body: Here's what you need to change. The reason things weren't working before is that you were first cloneing the object and then adding the path class. Here's a CodePen. s.select('#' + selector) .addClass('path') .clone() .attr({ stroke: "#FFE840", filter: 'none' });
answers question: http://stackoverflow.com/q/29718887

http://stackoverflow.com/a/29740945
answers question: http://stackoverflow.com/q/29740830
has comment: http://stackoverflow.com/comment/47656643
has comment: http://stackoverflow.com/comment/47667390
upvote count: 4
has comment: http://stackoverflow.com/comment/47618984
has comment: http://stackoverflow.com/comment/47615006
has comment: http://stackoverflow.com/comment/47656732
has comment: http://stackoverflow.com/comment/47619133
downvote count: 0
has comment: http://stackoverflow.com/comment/47615074
score: 4
has body: void 0 will yield undefined, as will void X for any X; it is shorter, and cannot get redefined like undefined can. So ===void 0 compares jQuery.migrateMute with undefined. !0 is true. Thus, the "translation" of jQuery.migrateMute===void 0&amp;&amp;(jQuery.migrateMute=!0) is: if (jQuery.migrateMute === undefined) { jQuery.migrateMute = true; } Then the stuff after the comma executes, independently from this.
has comment: http://stackoverflow.com/comment/47615103
has comment: http://stackoverflow.com/comment/47615338
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29740830
has comment: http://stackoverflow.com/comment/47615286
has comment: http://stackoverflow.com/comment/47656854
has comment: http://stackoverflow.com/comment/47618842
has comment: http://stackoverflow.com/comment/47619220
type: Answer
has comment: http://stackoverflow.com/comment/47618596
has comment: http://stackoverflow.com/comment/47656819
has comment: http://stackoverflow.com/comment/47615349

http://stackoverflow.com/comment/47716337
score: 1
has text: possible duplicate of [How to merge two arrays in Javascript and de-duplicate items](http://stackoverflow.com/questions/1584370/how-to-merge-two-arrays-in-javascript-and-de-duplicate-items)
type: Comment
comment on: http://stackoverflow.com/q/29794051
type: QuestionComment

http://stackoverflow.com/a/29698284
has comment: http://stackoverflow.com/comment/47539558
has comment: http://stackoverflow.com/comment/47538872
score: 1
has comment: http://stackoverflow.com/comment/47535670
has comment: http://stackoverflow.com/comment/47540654
has comment: http://stackoverflow.com/comment/47535869
has comment: http://stackoverflow.com/comment/47536408
upvote count: 1
type: AcceptedAnswer
has body: You need to use ExternalInterface. Call JS function window.open with next arguments: ExternalInterface.call("window.open", 'http://stackoverflow.com','winname', 'directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=350');
accepted answer of: http://stackoverflow.com/q/29697492
has comment: http://stackoverflow.com/comment/47541008
answers question: http://stackoverflow.com/q/29697492
has comment: http://stackoverflow.com/comment/47539508
type: Answer
has comment: http://stackoverflow.com/comment/47540039
downvote count: 0

http://stackoverflow.com/comment/47555813
comment on: http://stackoverflow.com/q/29709919
score: 0
has text: @Andrew no errors. Everything looks fine that is showing up, except that I am not seeing the "finished" console log that I put to verify the code was working properly.
type: Comment
type: QuestionComment

gridview
tags question: http://stackoverflow.com/q/29740139
tag name: gridview
type: Tag
tags question: http://stackoverflow.com/q/29797173
tags question: http://stackoverflow.com/q/29771652

http://stackoverflow.com/a/48173769
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29753184
has body: It might be that your links have already got the a tags with it so in this case you do not need to re-add the a tags... In this case do this... Add this to you scripts (include acc. to your angular version) Add this to your app.js var app = angular.module('modulename', [ 'ngSanitize']); And than in your view do this If it is the div that you want the link to attach to... The above would give you something as this

http://stackoverflow.com/a/29821113
has comment: http://stackoverflow.com/comment/47773659
answers question: http://stackoverflow.com/q/29820966
type: Answer
has comment: http://stackoverflow.com/comment/47804642
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47780472
has comment: http://stackoverflow.com/comment/47770074
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29820966
has body: Try This. Moved document.getElementById("mainContainer").innerHTML = "goodbye"; to the setTimeout function, that will execute after Hello is printed in the div. Your code was executing like: Animate the box with 1500 miliseconds - Animation starts Change main content to goodBye without waiting for animation completion - Right after animation start Animation got Completed, so change content to Hello - Animation Completes, though the user never saw it. // MOVE THE BLOCK TO THE RIGHT function animateCharacter(callbackSent) { $("#myObject").animate({left: "+=50"},1500, callbackSent); } // DO THIS WHEN THE BUTTON IS PUSHED function doTask() { myCallback = function () { document.getElementById("mainContainer").innerHTML = "hello"; setTimeout(function(){document.getElementById("mainContainer").innerHTML = "goodbye"; },1000); }; animateCharacter(myCallback); // WORKS FINE IF THIS IS COMMENTED OUT, // BUT I WANT MORE CODE TO EXECUTE } :c) Move the Block
has comment: http://stackoverflow.com/comment/47769975

http://stackoverflow.com/q/29701738
tagged with: http://stackoverflow.com/tag/html
tagged with: php
answer count: 4
has answer: http://stackoverflow.com/a/29702406
has answer: http://stackoverflow.com/a/29702025
downvote count: 1
type: Question
has body: My html: Username Password My php code: echo " "; What I want to achieve is showing that error message near the submit buttons. html and php codes are located in 2 different files. index.html and login.php both are in the same folder.
score: -1
has answer: http://stackoverflow.com/a/29701929
upvote count: 0
has answer: http://stackoverflow.com/a/29702068
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47539313
has title: Showing error message in html form using php and javascript
type: UnansweredQuestion

google-maps-api-3
tags question: http://stackoverflow.com/q/29832416
tags question: http://stackoverflow.com/q/29832744
tags question: http://stackoverflow.com/q/29745515
tags question: http://stackoverflow.com/q/29808144
tags question: http://stackoverflow.com/q/29844694
tags question: http://stackoverflow.com/q/29698080
tags question: http://stackoverflow.com/q/29795320
tags question: http://stackoverflow.com/q/29806300
tags question: http://stackoverflow.com/q/29784821
tags question: http://stackoverflow.com/q/29760560
tags question: http://stackoverflow.com/q/29739752
tags question: http://stackoverflow.com/q/29810202
tags question: http://stackoverflow.com/q/29801060
tags question: http://stackoverflow.com/q/29689817
tags question: http://stackoverflow.com/q/29819746
tags question: http://stackoverflow.com/q/29800640
tags question: http://stackoverflow.com/q/29723134
tags question: http://stackoverflow.com/q/29805673
tags question: http://stackoverflow.com/q/29705531
tags question: http://stackoverflow.com/q/29839556
tags question: http://stackoverflow.com/q/29690634
tags question: http://stackoverflow.com/q/29697046
tags question: http://stackoverflow.com/q/29739964
tags question: http://stackoverflow.com/q/29737392
tags question: http://stackoverflow.com/q/29777365
tags question: http://stackoverflow.com/q/29740712
tag name: google-maps-api-3
tags question: http://stackoverflow.com/q/29804356
tags question: http://stackoverflow.com/q/29778591
type: Tag
tags question: http://stackoverflow.com/q/29829134
tags question: http://stackoverflow.com/q/29829470
tags question: http://stackoverflow.com/q/29843155
tags question: http://stackoverflow.com/q/29711462
tags question: http://stackoverflow.com/q/29810345
tags question: http://stackoverflow.com/q/29794966
tags question: http://stackoverflow.com/q/29813983
tags question: http://stackoverflow.com/q/29775702
tags question: http://stackoverflow.com/q/29699178
tags question: http://stackoverflow.com/q/29795807
tags question: http://stackoverflow.com/q/29830327
tags question: http://stackoverflow.com/q/29806987
tags question: http://stackoverflow.com/q/29758354
tags question: http://stackoverflow.com/q/29694594
tags question: http://stackoverflow.com/q/29771959

http://stackoverflow.com/comment/47827376
score: 1
has text: that could be good but notice that if i write in the input: "ab" and in the the textarea: "deabchab", only the first "ab" is highlight. I have to highlight everytime that "ab" appears
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29798728

http://stackoverflow.com/a/29804428
has body: Put it all into a service and call out to the service for everything. Edit: see updated plnk. All this said, you will now need to notify the controllers when these change in the service. See my answer here on using the observer pattern with a service in Angular. angular.module('Cross.Controller.demo',[]); angular.module('Cross.Controller.demo').factory('sharedFactory', function() { var kids = [ {"Name":"John", "Expense":"1000"}, {"Name":"Anna", "Expense":"900"}]; var house = {"Category":"Utilities", "Expense":"2000"}; var getHouse = function() { return house; } var getKids = function() { return kids; } var getTotalExpenses = function() { var expenses = parseInt(house.Expense); kids.forEach(function(kid) { expenses += parseInt(kid.Expense); }); return { Category: "Total", Expense: expenses } } return { getHouse: getHouse, getKids: getKids, getTotalExpenses: getTotalExpenses } }); angular.module('Cross.Controller.demo').controller('KidsCtrl', function ($scope, sharedFactory) { $scope.Kids = sharedFactory.getKids(); }); angular.module('Cross.Controller.demo').controller('HouseCtrl', function ($scope, sharedFactory) { $scope.House = sharedFactory.getHouse(); }); angular.module('Cross.Controller.demo').controller('ResultCtrl', function ($scope, sharedFactory) { $scope.Result = sharedFactory.getTotalExpenses(); });
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29804181
type: Answer
has comment: http://stackoverflow.com/comment/47736997
answers question: http://stackoverflow.com/q/29804181
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47737165

http://stackoverflow.com/comment/47649604
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29758485
has text: actually your code shows that the rule `remote` was removed successfully.
score: 0

http://stackoverflow.com/q/29751445
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/47636201
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47635057
tagged with: vb.net
score: 2
answer count: 0
upvote count: 2
type: Question
tagged with: javascript
tagged with: jquery
has body: So I'm working on a project which uses AngularJS and a Web API written in VB.NET All of this works fine untill we have to maintain the routing. The following code is from my angularApp, which defines the routing. var angularApp = angular.module('AngularApp', ['ngRoute']); angularApp.config(['$routeProvider', function ($routeProvider) { $routeProvider .when('/ExpenseOverview', { controller: 'ExpenseOverviewController', templateUrl: 'Angular/Views/ExpenseOverview.aspx' }) .when('/AddExpense', { controller: 'AddExpenseController', templateUrl: 'Angular/Views/AddExpense.aspx' }) .when('/ApproveExpense', { controller: 'AddExpenseController', templateUrl: 'Angular/Views/ApproveExpense.aspx' }) .when('/Organogram', { controller: 'AddExpenseController', templateUrl: 'Angular/Views/Organogram.aspx' }) .when('/AddType', { controller: 'AddExpenseController', templateUrl: 'Angular/Views/AddType.aspx' }) .when('/ExpenseEvidence', { controller: 'AddExpenseController', templateUrl: 'Angular/Views/ConfirmExpenseEvidence.aspx' }) .otherwise({ redirectTo: '/ExpenseOverview' }); }]); EDIT I used .aspx pages because I wanted to use some code behind. If necessairy, I'll change them to static HTML files. Everything works fine on startup, the routing works as it was programmed to. Next to that, when I navigate to other pages, the routing still works like expected. But from that point on, when I navigate back to the main form with the back button from Chrome, it all falls apart. When I click on this button to navigate to another page (label is in Dutch), the routing isn't even triggered. This button is a simple HTML5 button and I also tried with a simple tag. It just triggers a postback (sort of, the screen flashes for a second) and nothing happens. So in an attempt to reset everything, I tried to reload the page and this is what becomes of my URL: And after navigating to another page, it just changes the "#/???" part of my URL, which basically means that my routing is changed completely a…
has comment: http://stackoverflow.com/comment/47661485
downvote count: 0
has title: Angular + VB.NET - Routing not working

http://stackoverflow.com/a/29875586
has comment: http://stackoverflow.com/comment/138389309
type: Answer
answers question: http://stackoverflow.com/q/29810409
has body: Sharing the answer as anyone might require this in future. http://community.tableau.com/message/358767#358767 Here is the code if anybody wishes to use this. http://pastebin.com/bruVTSmN
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/29701125
tagged with: css
has answer: http://stackoverflow.com/a/29701568
has comment: http://stackoverflow.com/comment/47538366
has comment: http://stackoverflow.com/comment/47542288
has comment: http://stackoverflow.com/comment/47538205
type: Question
linked to: http://stackoverflow.com/q/4787527
tagged with: width
has comment: http://stackoverflow.com/comment/47540163
answer count: 1
tagged with: javascript
has title: javascript - get div width and add to border
has comment: http://stackoverflow.com/comment/47538582
tagged with: border
score: 0
has comment: http://stackoverflow.com/comment/47539156
has comment: http://stackoverflow.com/comment/47542022
tagged with: http://stackoverflow.com/tag/html
has body: Hey I want to get the width of a div and add it to a css class as border width. Thanks in advance! Here is the div: &lt;div id="web" class="well"&gt; &lt;div style="padding:19px"&gt; &lt;a style="text-decoration:none;" class="boxclose web_close"&gt;&lt;/a&gt; &lt;h2 style="color:#242424; font-weight:bold;"&gt;&lt;em style="color:#4fd886;"&gt;&amp;mdash;&lt;/em&gt; Web.&lt;/h2&gt; &lt;p&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; and here is the CSS class: .well:before { width: 0; height: 0; content: ""; border-bottom: 81px solid #fff; border-left:/*WIDTH HERE*/ solid transparent; position: absolute; bottom: 100%; }
has comment: http://stackoverflow.com/comment/47540817
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47538328

http://stackoverflow.com/comment/47677307
score: 0
type: AnswerComment
type: Comment
has text: Yeah sorry, body means whole document. you need to identify the element which respond to click. I have updated the answer.
comment on: http://stackoverflow.com/a/29773255

http://stackoverflow.com/comment/49404975
comment on: http://stackoverflow.com/q/29724512
score: 0
type: Comment
has text: can you show us the entire rendered html document?
type: QuestionComment

http://stackoverflow.com/a/63935080
has body: After hours of searching google I finally found the answer. Just add this config: devServer: { before(app, server) { const chokidar = require('chokidar'); chokidar.watch('path/to/my-files/').on('all', function (event, path) { server.sockWrite(server.sockets, 'content-changed'); }); }, } Found it on a blog here: https://daltontan.com/easiest-way-to-reload-webpack-dev-server-when-other-files-change/30
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29757124

http://stackoverflow.com/a/65425159
answers question: http://stackoverflow.com/q/29714096
score: 0
has body: This fiddle works great for dynamically generated content. https://jsfiddle.net/bsxcL71L/2/ function down() { $('html, body').animate({ scrollTop: hg}, 20000); up(); }; function up() { $('html, body').animate({ scrollTop: $('#start').offset().top }, 20000); down(); }; $(document).ready(function () { hg = $('#content').height() - 420; down(); });
type: Answer

http://stackoverflow.com/comment/47764911
type: Comment
comment on: http://stackoverflow.com/a/29818178
score: 0
has text: Tried from their, it is still opening if I visit from the same site
type: AnswerComment

http://stackoverflow.com/q/29789386
possible better answer: http://stackoverflow.com/a/29790016
has comment: http://stackoverflow.com/comment/47707908
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47707923
score: 0
tagged with: checkbox
has title: checkbox multi select add remove class
has answer: http://stackoverflow.com/a/29790016
upvote count: 2
downvote count: 2
has answer: http://stackoverflow.com/a/29789884
accepted answer: http://stackoverflow.com/a/29789884
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47707902
has comment: http://stackoverflow.com/comment/47708013
has comment: http://stackoverflow.com/comment/47708941
has body: So I have a multiple checkboxes and dropdown options. When I select a checkbox, I want to apply some class to the select options of dropdown and when I uncheck the same I want to remove that applied class. The problem, I am getting is since checkbox is multi-select, It doesn't work the way I want. Say when I check 1st checkbox, I want to apply abc class to option audi and when I uncheck the checkbox remove that abc css class property. Now when say both the check boxes are selected we should be able to do adding and removing of class at the same time. I have a bike I have a car Volvo Saab Opel Audi Here is my fiddle Please help. Update: Now, when It gets checked, I am applying the class abc to the dropdowns and also able to remove on uncheck. but it is getting applied to all the select options. What i want is the class should apply to options of the dropdowns.
answer count: 2

http://stackoverflow.com/a/29769017
has body: You can listen onload event on your font and detect @font-face support. If onload or support echec you set body font-size to 14px To detect onload font you can try this: https://github.com/patrickmarabeas/jQuery-FontSpy.js To detect @font-face support you can try this github project: https://github.com/paulirish/font-face-detect
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47670313
has comment: http://stackoverflow.com/comment/47669412
type: Answer
answers question: http://stackoverflow.com/q/29768402
accepted answer of: http://stackoverflow.com/q/29768402
has comment: http://stackoverflow.com/comment/47670114

http://stackoverflow.com/comment/84211819
score: 0
type: AnswerComment
type: Comment
has text: "Supposedly this will work" part didn't work for me, and after looking at the Phaser.Game code, I don't understand why should it. But the last code snippet worked like a charm, thank you. Would you consider removing the dubious suggestion in favor of the working one?
comment on: http://stackoverflow.com/a/35826717

http://stackoverflow.com/q/29819188
has comment: http://stackoverflow.com/comment/47767555
type: Question
has comment: http://stackoverflow.com/comment/47765714
downvote count: 0
has body: I use this js code to gain a parallax effect (function() { var parallax = document.querySelectorAll(".parallax"), speed = 0.5; window.onscroll = function(){ [].slice.call(parallax).forEach(function(el, i){ var windowYOffset = window.pageYOffset, elBackgrounPos = "50% " + (windowYOffset * speed) + "px"; el.style.backgroundPosition = elBackgrounPos; }); }; })(); On Chrome browser it's nice and smooth but on IE and mobile browsers the background doesn't move smoothly, it's somehow laggy. any solutions?
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: parallax
tagged with: lag
answer count: 0
has title: JavaScript parallax effect is laggy
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47764952
has comment: http://stackoverflow.com/comment/47765525
score: 1

http://stackoverflow.com/a/29931367
has comment: http://stackoverflow.com/comment/48013308
type: Answer
has body: I had the same exact problem with 0.13.2, however, the cause of my error and solution to it were a bit different: The error came down to my npm version. I was using npm 2.1.4 since upgrading (now at 2.8.4) and running npm update -g npm I was able to get everything working without touching my package.json or anything else. Let me know if that works for you!
upvote count: 3
answers question: http://stackoverflow.com/q/29786154
has comment: http://stackoverflow.com/comment/48105677
score: 3
downvote count: 0

http://stackoverflow.com/a/29782809
answers question: http://stackoverflow.com/q/29782735
score: 0
has body: $_SERVER['HTTP_USER_AGENT'] Contents of the User-Agent: header from the current request, if there is one. This is a string denoting the user agent being which is accessing the page. A typical example is: Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586). Among other things, you can use this value with get_browser() to tailor your page's output to the capabilities of the user agent.
type: Answer

http://stackoverflow.com/a/63752149
has comment: http://stackoverflow.com/comment/131604397
has body: The react documentation explain how to do that: https://create-react-app.dev/docs/importing-a-component/#absolute-imports just add a jsconfig.json in your project root: { "compilerOptions": { "baseUrl": "src" }, "include": ["src"] }
type: Answer
has comment: http://stackoverflow.com/comment/134369497
has comment: http://stackoverflow.com/comment/125203027
score: 46
has comment: http://stackoverflow.com/comment/140031070
upvote count: 46
answers question: http://stackoverflow.com/q/29755065
downvote count: 0

http://stackoverflow.com/q/29824848
tagged with: javascript
has comment: http://stackoverflow.com/comment/47778145
score: 0
has comment: http://stackoverflow.com/comment/47776538
has comment: http://stackoverflow.com/comment/47776078
answer count: 1
has title: Disable weird condition check in jslint
linked to: http://stackoverflow.com/q/24233814
has comment: http://stackoverflow.com/comment/47779853
has comment: http://stackoverflow.com/comment/47777689
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47776156
has comment: http://stackoverflow.com/comment/47776807
has comment: http://stackoverflow.com/comment/47776267
has comment: http://stackoverflow.com/comment/47777408
has comment: http://stackoverflow.com/comment/47776820
has answer: http://stackoverflow.com/a/29825011
has body: I got some strange errors in my js library by Jslint. if (d.r.test(this.user)) { return !0; } Jslint Error Weird Condition return !0; I don't know what is wrong in the code, I used return !0 instead of return true and I believe return !0 will perform better than return true. What is wrong in the code and how to disable the check in jslint? P.S: How to disable the Weird Condition check in JSLint? I read this question before asking this but it is different and the solution suggested in that was not working.
has comment: http://stackoverflow.com/comment/47776389
type: Question
accepted answer: http://stackoverflow.com/a/29825011
tagged with: jslint
has comment: http://stackoverflow.com/comment/47778075

http://stackoverflow.com/q/29802526
has comment: http://stackoverflow.com/comment/47777938
downvote count: 0
tagged with: javascript
tagged with: jquery-isotope
tagged with: jquery
favorite count: 0
has title: How do I get Angular Isotope to be fully responsive?
has comment: http://stackoverflow.com/comment/47781830
tagged with: angularjs
answer count: 0
has comment: http://stackoverflow.com/comment/47740081
type: UnansweredQuestion
upvote count: 1
has body: I am trying to create a fully responsive version of Isotope using AngularJS/Angular-Isotope. I have created a non-AngularJS version that utilises this jQuery (found on Stackoverflow and other sources) to make the columns and items responsive: $(window).load(function() { var $container = $('#one-column'), margin = 10, colWidth = function () { var w = $container.width(), columnNum = 1, columnWidth = 0; if (w &gt; 1200) { columnNum = 5; } else if (w &gt; 1024) { columnNum = 4; } else if (w &gt; 768) { columnNum = 3; } else if (w &gt; 480) { columnNum = 2; } columnWidth = Math.floor(w/columnNum); var $item = $('.story'), width = columnWidth-10 $item.css({ width: width }); var $featured = $('.featured'), dblwidth = columnWidth*2-10 if (w &gt; 480) { $featured.css({ width: dblwidth }); } else { $featured.css({ width: width }); } return columnWidth; }; $(window).on('throttledresize', isotope); }); Introducing Angular to this jQuery version causes the masonry layout to sporadically load or not load - with no errors, so I have used ManKindSoftware's Angular Isotope to load items and then filter accordingly - which loads every time. However on initial load the items are all a fixed height and the columns are adaptive rather than responsive. I cannot seem to figure out how I can flexibly change the column widths based on resizing and make the columns and isotope items responsive. Does anyone have any experience doing this?
tagged with: responsive-design
has comment: http://stackoverflow.com/comment/47831159
score: 1
type: Question

http://stackoverflow.com/a/29744891
has comment: http://stackoverflow.com/comment/47670624
has comment: http://stackoverflow.com/comment/47629659
has comment: http://stackoverflow.com/comment/47672246
has comment: http://stackoverflow.com/comment/47623607
has comment: http://stackoverflow.com/comment/47657269
has comment: http://stackoverflow.com/comment/47625178
has comment: http://stackoverflow.com/comment/47625859
has comment: http://stackoverflow.com/comment/47672881
answers question: http://stackoverflow.com/q/29744512
has comment: http://stackoverflow.com/comment/47625982
type: Answer
has comment: http://stackoverflow.com/comment/47622940
has comment: http://stackoverflow.com/comment/47670705
has comment: http://stackoverflow.com/comment/47624931
has comment: http://stackoverflow.com/comment/47628222
has body: Download Google Map DLL in your project from codeplex GoogleMapControl. Register DLL in your page: <%@ Register Assembly="Artem.Google" Namespace="Artem.Google.UI" TagPrefix="artem" %> Here is the steps to create Google Map dynamically in repeater control. First download Artem.Google.dll from this link and put down DLL in bin folder. ASPX Page Code: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="GmapRepeater.aspx.cs" Inherits="GmapRepeater" %> <%@ Register Assembly="Artem.Google" Namespace="Artem.Google.UI" TagPrefix="artem" %> <asp:ScriptManager runat="server"></asp:ScriptManager> <asp:Repeater ID="rptMarkers" runat="server" OnItemDataBound="rptMarkers_ItemDataBound"> <artem:GoogleMap ID="GMap" runat="server"></artem:GoogleMap> </asp:Repeater> ASPX.CS Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Artem.Google.UI; public partial class GmapRepeater : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GetData(); } } protected void rptMarkers_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Markers loData = (Markers)e.Item.DataItem; GoogleMap GMap = (GoogleMap)e.Item.FindControl("GMap"); GMap.MapType = Artem.Google.UI.MapType.Roadmap; GMap.ApiVersion = "v2"; GMap.Latitude = Convert.ToDouble(loData.Latitude); GMap.Longitude = Convert.ToDouble(loData.Longitude); GMap.Zoom = 18; GMap.EnableMapTypeControl = false; GMap.Height = 200; GMap.Width = 195; Marker loMarker = new Marker(); loMarker.Position.Latitude = Convert.ToDouble(loData.Latitude); loMarker.Position.Longitude = Convert.ToDouble(loData.Longitude); loMarker.Clickable = true; loMarker.Info = "Marker Information"; loMarker.Title = "Title of your Marker"; loMarker.Visible = true; GMap.Markers.Add(loMarker); } } private void GetData() { XmlDataDocument xmlDataD…
score: 0

http://stackoverflow.com/comment/47671419
comment on: http://stackoverflow.com/q/29770394
has text: JS _only_ has runtime
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/47645885
type: Comment
has text: @SavageSpud -- the idea is to VISUALLY make it look like the whole things is clickable. You do this by making the LI invisible and styling the link itself.
comment on: http://stackoverflow.com/a/29756346
score: 0
type: AnswerComment

http://stackoverflow.com/q/29807636
favorite count: 0
has answer: http://stackoverflow.com/a/29807724
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29807707
score: 2
upvote count: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29807707
type: Question
has title: How to iterate over array objects inside of a function
answer count: 2
tagged with: for-loop
has body: I have vs.selectedTags which is an array with 3 objects. In my for loop which will run 3 times, I need to make 3 API calls to get the tickers data for each object which I'm able too. My problem comes when I try to assign those tickers to each vs.selectedTags[i].tickers object in the array. It can't iterate over the i inside of the ApiFactory call. i becomes 3, and I have to cheat by using [i-1] to stop it from erroring out. However i still stays stuck at 2 so it always saves the last tickers data to all the items in my vs.selectedTags array. var vs = $scope; for (var i = 0; i &lt; vs.selectedTags.length; i++) { console.log(i); vs.selectedTags[i].tickers = ''; console.log(vs.selectedTags[i].tickers); ApiFactory.getTagData(vs.chosenTicker, vs.selectedTags[i].term_id).then(function(data) { // console.log(data.data.ticker_tag); console.log(data.data.ticker_tag.tickers); console.log(i-1); // console.log(vs.selectedTags[0]); // How would you properly iterate [0 - 1 - 2] here? vs.selectedTags[i-1].tickers = data.data.ticker_tag.tickers; console.log(vs.selectedTags[i-1]); }); }
tagged with: arrays
downvote count: 0
possible better answer: http://stackoverflow.com/a/29807724
tagged with: javascript

http://stackoverflow.com/comment/47715425
comment on: http://stackoverflow.com/q/29793026
type: Comment
type: QuestionComment
has text: jogesh_pi maybe exactly problem is convert "&amp;" to "&". Above is the console.log what i get from ajax. CMIIW guys... still learn..
score: 0

tree
tags question: http://stackoverflow.com/q/29721734
type: Tag
tags question: http://stackoverflow.com/q/29794911
tags question: http://stackoverflow.com/q/29840275
tag name: tree
tags question: http://stackoverflow.com/q/29805832
tags question: http://stackoverflow.com/q/29742659

http://stackoverflow.com/a/29827182
type: Answer
has comment: http://stackoverflow.com/comment/47781183
has comment: http://stackoverflow.com/comment/47782544
score: 1
has comment: http://stackoverflow.com/comment/47782452
has comment: http://stackoverflow.com/comment/47780915
upvote count: 1
has comment: http://stackoverflow.com/comment/47781540
has comment: http://stackoverflow.com/comment/47781166
has comment: http://stackoverflow.com/comment/47782343
has body: You can use bind : phoneAjaxCalls.push(newPhone.bind(window, tlcPhone, stagingFormPhone.studentsdcid)); and then change your call to $.when in order to really call the functions returning the needed promises: $.when.apply($j, $.map(phoneAjaxCalls, $.call.bind($.call)).done(function () { or, in a more readable way: $.when.apply($j, $.map(phoneAjaxCalls, function(f){ return f() }).done(function () { But this construct looks like a hack, do you really need to store functions instead of structured arguments or instead of executing the ajax calls as soon as possible ? The normal way to use promises is the one you show in the question : the callback you pass to done does wait for the promises to be fullfiled.
has comment: http://stackoverflow.com/comment/47781017
has comment: http://stackoverflow.com/comment/47781935
answers question: http://stackoverflow.com/q/29827169
has comment: http://stackoverflow.com/comment/47781486
downvote count: 0

http://stackoverflow.com/q/29694415
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47525936
has comment: http://stackoverflow.com/comment/47525577
has comment: http://stackoverflow.com/comment/47525320
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47525763
has comment: http://stackoverflow.com/comment/47525351
score: 0
has body: I am trying to test my jvectormap locally. Previously I was just accessing the HTML file directly through the browser. I recently switched to using an HTTP server to serve the files, but now the map displays with a very small height. The strange thing is, if I resize the browser (bigger or smaller) the map gets larger and larger (doesn't seem to stop expanding). The map when it's initially rendered has a height of 54px. Setting the height CSS attribute for the div I defined to contain the map, as well as the .jvectormap-container div, does not help. It it increases the background size, but not the size of the actual map. It is the height in the &lt;svg&gt; tag that is actually causing me this issue. When I access the site again via the file directly, it renders fine. When I do "view source" and access all the files through the HTTP server, they also look fine too. There are no errors in the JS console. I get the same issue on multiple browsers. Here is my body html: &lt;body&gt; &lt;div id="world-map" style="position: absolute; top: 0; right: 0; bottom: 0; left: 0;"&gt;&lt;/div&gt; &lt;script src="main.js"&gt;&lt;/script&gt; &lt;/body&gt; And main.js contains var mapDiv = $('#world-map'); mapDiv.vectorMap();
has comment: http://stackoverflow.com/comment/47525278
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47525332
tagged with: http://stackoverflow.com/tag/svg
tagged with: jvectormap
has title: Small jvectormap height when served through HTTP server
has answer: http://stackoverflow.com/a/29728406
upvote count: 1
accepted answer: http://stackoverflow.com/a/29728406
downvote count: 1

http://stackoverflow.com/comment/47711477
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29791053
has text: As I told - Elements added from template from script tag.

http://stackoverflow.com/a/31548605
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29749026
has comment: http://stackoverflow.com/comment/51059779
has body: I had same problem and write an attribute directive which is named as ng-slider-model for value binding. .directive('ngSliderModel', ['$parse', function($parse) { return { scope: { ngSliderModel: '=', uiOptions: '=' }, restrict: 'A', required: ['ngSliderModel'], link: function(scope, element, attrs) { // check there is uiOption or not var options = ('uiOptions' in attrs) ? scope.uiOptions : {}; // get the value of ngSlider Model var val = scope.ngSliderModel; // if value is range [15,25] then return values for uiOptions propertyName else value for singles var propName = (angular.isArray(val)) ? 'values' : 'value'; /* if you want to slide when the scope value changed not from slider... watch the ngSliderModel attribute */ scope.$watch('ngSliderModel', function(newValue) { element.slider(propName, newValue); }); // set value for options options[propName] = val; // binding slide event element.bind('slide', function() { // Read the current value var value = element.slider('option', propName); scope.$apply(function() { // Apply the value to scope scope.ngSliderModel = value; }); }); } }; }]);;
has comment: http://stackoverflow.com/comment/51058129

http://stackoverflow.com/q/29753272
type: Question
has comment: http://stackoverflow.com/comment/47638913
has title: Javascript onFocus triggers on page load
tagged with: javascript
score: 4
has body: Fiddle So I'm having this problem. I have a simple form: &lt;form method="post" action="login.php"&gt; &lt;input type="text" name="Username" value="Username" /&gt; &lt;input type="password" name="Password" value="Password" /&gt; &lt;input type="submit" name="submit" value="Log in" /&gt; &lt;/form&gt; And this script: function focus(element) { console.log('focused ' + element.getAttribute('name')); var elementValue = element.value; var elementName = element.getAttribute('name'); elementValue = (elementValue == elementName ? '' : elementValue); } var fields = ['Username', 'Password']; for (var i = 0; i &lt; fields.length; i++) { console.log(i + ': ' + fields[i]); var input = document.getElementsByName(fields[i])[0]; console.log('input value: ' + input.value); input.onFocus = focus(input); } It is supposed to create Focus event listeners for every of the inputs and call focus() function as user clicks on any of the fields. But for some reason, as console shows, it just calls the function once a loop for every of the fields and just stops not responding to future Focus events. So my guess is there's something wrong with this line input.onFocus = focus(input);, but I don't know what. What am I missing?
upvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/29753321
downvote count: 0
favorite count: 0
tagged with: onfocus
possible better answer: http://stackoverflow.com/a/29753321
has answer: http://stackoverflow.com/a/29753310
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29753310

http://stackoverflow.com/q/29759206
has title: Initialize Javascript Dictionary From Array of Pairs
duplicate of: http://stackoverflow.com/q/26454655
possible better answer: http://stackoverflow.com/a/29759270
score: 1
has answer: http://stackoverflow.com/a/29759270
upvote count: 1
accepted answer: http://stackoverflow.com/a/29759261
type: Question
answer count: 2
tagged with: arrays
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/26454655
has body: I have an array that looks something like this: [["key1", "value1"], ["key2", "value2"]]. I want a dictionary that looks like this: {"key1": "value1", "key2": "value2"}. In Python, I could just pass the array to the dict initializer. Is there some equivalent way of doing this in Javascript, or am I stuck initializing an empty dictionary and adding the key/value pairs to the dictionary one at a time?
favorite count: 0
has answer: http://stackoverflow.com/a/29759261
has comment: http://stackoverflow.com/comment/47650908
tagged with: python
tagged with: dictionary
has comment: http://stackoverflow.com/comment/47650713
type: AnsweredQuestion

http://stackoverflow.com/comment/47570270
type: QuestionComment
has text: BTW, you could use `this.myButton = ` as an alternative to `myNS.myButton =`. Probably a matter of personal preference in this case...
type: Comment
comment on: http://stackoverflow.com/q/29717833
score: 0

http://stackoverflow.com/comment/47664468
has text: Not being a security expert here, but I don't think there's a lot you can actually do about it, while this might validate them client side, I would recommend that you also do validating server side.
score: 0
comment on: http://stackoverflow.com/q/29766626
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29752892
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29752798
type: Answer
has comment: http://stackoverflow.com/comment/47638056
upvote count: 1
has body: Do not put tr> inside another tr> {{i}}{{p}}
downvote count: 1
has comment: http://stackoverflow.com/comment/47638860
answers question: http://stackoverflow.com/q/29752798
score: 0

http://stackoverflow.com/q/29785242
has comment: http://stackoverflow.com/comment/47700378
has answer: http://stackoverflow.com/a/29785485
has comment: http://stackoverflow.com/comment/47700470
has comment: http://stackoverflow.com/comment/47700397
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47700484
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47700371
has title: Overlap Issue with div in HTML and JS
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47700463
has answer: http://stackoverflow.com/a/29785562
has comment: http://stackoverflow.com/comment/47700630
has comment: http://stackoverflow.com/comment/47700521
has body: I am trying to rotate an image within a div using html and js. I have it working for the most part except for an overlapping issue: the image either covers up everything or overlaps during rotation. I thought I had resolved it with my js formula which sets the div size based on the image size, however it's not working and I'm not sure why. Any ideas? rotate
type: UnansweredQuestion

http://stackoverflow.com/q/29811418
tagged with: deferred-execution
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: deferred
favorite count: 0
has comment: http://stackoverflow.com/comment/47750715
has comment: http://stackoverflow.com/comment/47750748
has body: If you have a function which has both .then and .always callbacks, which one will get executed first?
linked to: http://stackoverflow.com/q/12448171
has answer: http://stackoverflow.com/a/29811460
has comment: http://stackoverflow.com/comment/47756665
score: 5
has comment: http://stackoverflow.com/comment/47751591
duplicate of: http://stackoverflow.com/q/12448171
type: Question
has title: What comes first .always() or .then() callbacks in jQuery?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47750798
upvote count: 5
accepted answer: http://stackoverflow.com/a/29811460

http://stackoverflow.com/q/29759276
score: 1
upvote count: 1
type: AnsweredQuestion
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29759304
type: Question
answer count: 1
downvote count: 0
has title: JavaScript - checkboxes and events
favorite count: 0
has body: How do i trigger an event when an input of type="checkbox" is checked? For buttons i simply create an addEventListener with the event 'click'. Is there a similar way of doing this with checkboxes? For example i have two containers, both containing a checkbox and a div element. When one of the checkboxes is "checked", then i want their div element (box) to change color or something like that. And then go back to its first state when its unchecked. &lt;div class="boxCont"&gt; &lt;input type="checkbox" class="checkbox"&gt; &lt;div class="box"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="boxCont"&gt; &lt;input type="checkbox" class="checkbox"&gt; &lt;div class="box"&gt;&lt;/div&gt; &lt;/div&gt; Example: https://jsfiddle.net/qua1ity/vs64yyrv/1/ Is this possible with JavaScript, without changing the HTML?
tagged with: events
tagged with: checkbox
has answer: http://stackoverflow.com/a/29759304

http://stackoverflow.com/a/29784852
has comment: http://stackoverflow.com/comment/47793000
has body: Yep, it's your JSON. You need "label" and "data" instead of "acctlocv" and "percval". [ { "label":"CHE3", "data":3774 }, { "label":"CMI- CRL2", "data":5 }, { "label":"CMI1", "data":4106 }, { "label":"CMI2", "data":10259 }, { "label":"CUST", "data":75 }, { "label":"HELOCR", "data":6 }, { "label":"Network", "data":8675 } ] http://jsfiddle.net/xyktLseo/1/ Edit - Raidri's comment is correct, 'data' can be strings and flot will convert. http://jsfiddle.net/xyktLseo/2/
type: Answer
has comment: http://stackoverflow.com/comment/47796744
has comment: http://stackoverflow.com/comment/47781800
has comment: http://stackoverflow.com/comment/47711928
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47780296
has comment: http://stackoverflow.com/comment/47778440
answers question: http://stackoverflow.com/q/29783615
upvote count: 1
has comment: http://stackoverflow.com/comment/47793109

http://stackoverflow.com/a/29704287
has comment: http://stackoverflow.com/comment/47577831
has comment: http://stackoverflow.com/comment/47578896
downvote count: 0
has comment: http://stackoverflow.com/comment/47558889
has body: The key is not to work against knockout. Your viewmodel never needs to know the HTML elements that are used to render it. If you want to influence visibility of your items, introduce a visible property on your viewmodel and make your view react to changes in this property. If necessary create custom bindings that handle the animation itself - I've created fadeVisible and slideVisible bindings below. The following uses a separate Planet viewmodel and a subscription to the typeToShow property. function Planet(data) { var self = this; self.name = data.name; self.type = data.type; self.visible = ko.observable(true); } Planet.create = function (data) { return new Planet(data); }; function Planets(data) { var self = this; self.planets = ko.observableArray(ko.utils.arrayMap(data.planets, Planet.create)); self.typeToShow = ko.observable("all"); self.displayAdvancedOptions = ko.observable(true); self.addPlanet = function(name, type) { self.planets.push(new Planet({ name: name || "New planet", type: type || "rock" })); }; self.typeToShow.subscribe(function (type) { ko.utils.arrayForEach(self.planets(), function(planet) { planet.visible(type === "all" || ko.unwrap(planet.type) === type); }); }); } ko.bindingHandlers.fadeVisible = { init: function(element, valueAccessor) { var value = valueAccessor(), visible = ko.unwrap(value); $(element).toggle(visible); }, update: function(element, valueAccessor) { var value = valueAccessor(), visible = ko.unwrap(value); $(element)[visible ? "fadeIn" : "fadeOut"](); } }; ko.bindingHandlers.slideVisible = { init: function(element, valueAccessor) { var value = valueAccessor(), visible = ko.unwrap(value); $(element).toggle(visible); }, update: function(element, valueAccessor) { var value = valueAccessor(), visible = ko.unwrap(value); $(element)[visible ? "slideDown" : "slideUp"](); } }; ko.applyBindings(new Planets({ planets: [ { name: "Mercury", type: "rock"}, { name: "Venus", type: "rock"}, { name: "Earth", type: "rock"}, { name: "Mars", type…
score: 1
has comment: http://stackoverflow.com/comment/47579150
upvote count: 1
answers question: http://stackoverflow.com/q/29688663
has comment: http://stackoverflow.com/comment/47560241
type: Answer

http://stackoverflow.com/q/29773873
tagged with: highcharts
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
tagged with: highslide
accepted answer: http://stackoverflow.com/a/29774067
has body: I am trying to post data from highcharts. point: { events: { click: function (e) { hs.htmlExpand(null, { pageOrigin: { x: e.pageX || e.clientX, y: e.pageY || e.clientY }, headingText: this.series.name, maincontentText: Highcharts.dateFormat('%A, %b %e, %Y', this.x) + ':&lt;br/&gt; ' + this.y + ' visits ' + '&lt;div&gt;'+'&lt;button onclick="posting(this.y)"&gt;'+'send report' +'&lt;/button&gt;'+'&lt;/div&gt;', width: 200 }); } } } I am calling a function on clicking the button and I want to send data to it. How can we send this.y to posting() function so that we get current point value in the function. This fiddler is showing the undefined in alert. How can I achieve the this.y value there. Click on the points in the chart then click the send report button and you will get my problem.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29774041
type: Question
has title: Posting data to the server from highchart points
possible better answer: http://stackoverflow.com/a/29774041
has answer: http://stackoverflow.com/a/29774067

http://stackoverflow.com/q/29757124
tagged with: webpack
tagged with: javascript
upvote count: 2
has answer: http://stackoverflow.com/a/63935080
answer count: 1
has comment: http://stackoverflow.com/comment/47698204
tagged with: web
favorite count: 0
has body: sorry for the noob question (I'm still newbie with webpack) I'm interested in live reload my html, that means, everytime than I do a change in my html file my browser must show the latest changes, webpack has a nice feature than works for javascript, is possible use it with html? just now I'm using this skeleton https://github.com/gaearon/react-hot-boilerplate for develop, yes I'm working with react but also I'm building a few static pages I know about libs like live.js but I found it not so transparent: this reload my browser and this is empty for a few seconds, instead bracket (for html) and webpack (for js) are almost instantly and you dont feel the browser reload, an alternative like this outside of webpack also would be appreciate, thanks
has comment: http://stackoverflow.com/comment/47666883
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 2
downvote count: 0
has title: live html reload with webpack
type: Question

http://stackoverflow.com/comment/47838503
has text: You need to serve both the HTML and the API somewhere anyway. You can do these from same application. If you keep part of the dynamic page rendered by Laravel then indeed you cannot use it in mobile app so well
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29843311

http://stackoverflow.com/a/29825011
type: Answer
has comment: http://stackoverflow.com/comment/47776758
has comment: http://stackoverflow.com/comment/47777151
has comment: http://stackoverflow.com/comment/47777250
has comment: http://stackoverflow.com/comment/47780190
has comment: http://stackoverflow.com/comment/47777341
has comment: http://stackoverflow.com/comment/47782151
has body: You are getting a "Weird Condition" warning because your code is not idiomatic. Other programmers will likely find it confusing and so JSLint is warning you not to do it. One of the intended goals of JSLint is to discourage problematic styles of programming. i.e. Just because you can do something in JavaScript doesn't mean it is a good idea. This is an example of one of those cases where the authors of JSLint believe this style of programming should be discouraged. There is no way to turn off this warning in JSLint. I tried it here http://www.jslint.com/ and turned on all the tolerate options and still get the warning. The only way to prevent the warning is to either change the return value to be a boolean or to stop using JSLint.
answers question: http://stackoverflow.com/q/29824848
has comment: http://stackoverflow.com/comment/47779952
score: 0
has comment: http://stackoverflow.com/comment/47781567
has comment: http://stackoverflow.com/comment/47781489
has comment: http://stackoverflow.com/comment/47781400
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29824848
has comment: http://stackoverflow.com/comment/47779418
has comment: http://stackoverflow.com/comment/47778040
has comment: http://stackoverflow.com/comment/47781214

http://stackoverflow.com/comment/48337083
type: Comment
has text: Thanks Brett, with your previous comment as well as your latest example I've finally been able to overcome my problems. Thanks again!
score: 1
comment on: http://stackoverflow.com/a/29870861
type: AnswerComment

http://stackoverflow.com/comment/47785464
has text: There is nothing stopping you from doing that. Knockout is designed to make updating viewmodel values from JavaScript easy: that is its primary use case. If you have a specific question please ask it. I just re-used the code you posted; if this wasn't the right code, why did you use it?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29804734
type: Comment

http://stackoverflow.com/q/29762926
downvote count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/29763351
has body: I have 3 nested, isolate scope, directives (see CodePen here) and I am able to pass a function (that takes an argument) from the outermost directive to the innermost directive (passing the function from outer directive to intermediate directive to inner directive). What I'm failing to understand is what needs to be done to pass the argument from the inner directive back through intermediate directive back to the outer directive. Again, see the CodePen example. Note: Given only 2 isolate scope directives I can get this to work with something similar to the following... angular.module('myApp', []) .directive('myDir1', function() { return { template: ' ', controller: function($scope) { $scope.addName = function(name) { alert(name); // alerts 'Henry' }; } } }) .directive('myDir2', function() { return { scope: { addName: '&' }, template: "Click to Add {{testName}}!", controller: function($scope) { $scope.testName = 'Henry'; } } }); The above code gives me an Alert box with 'Henry' (just like I'd expect). It's when I add an third, intermediate, isolate scope directive that I run into problems... angular.module('myApp', []) .directive('myDir1', function() { return { template: ' ', controller: function($scope) { $scope.addName = function(name) { alert(name); // alerts 'Henry' }; } } }) .directive('myDir2', function() { return { scope: { addName: '&' }, template: ' ', } }) .directive('myDir3', function() { return { scope: { addName: '&' }, template: "Click to Add {{testName}}!", controller: function($scope) { $scope.testName = 'Henry'; } } }); This code gives me an alert box with undefined...
score: 13
has answer: http://stackoverflow.com/a/29775356
accepted answer: http://stackoverflow.com/a/29775356
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/18378520
has answer: http://stackoverflow.com/a/70191223
type: Question
has answer: http://stackoverflow.com/a/29763351
tagged with: javascript
upvote count: 13
favorite count: 0
answer count: 5
linked to: http://stackoverflow.com/q/34958681
has answer: http://stackoverflow.com/a/29763727
has answer: http://stackoverflow.com/a/29763148
has title: AngularJs: Passing Function Arguments Across Multiple Isolated Scopes with Angular Directives

http://stackoverflow.com/a/29795446
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47719540
has comment: http://stackoverflow.com/comment/47719105
type: Answer
has comment: http://stackoverflow.com/comment/47719135
answers question: http://stackoverflow.com/q/29795330
accepted answer of: http://stackoverflow.com/q/29795330
has body: toString.call(obj) returns the type of object, while obj.toString() returns the string representation of the object or the type of object if it doesn't have implemented this function. Example: var a = [5]; a.toString() // "5" toString.call(a) // "[object Array]" More details can be found on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString Using toString() to detect object class: var toString = Object.prototype.toString; toString.call(new Date); // [object Date] toString.call(new String); // [object String] toString.call(Math); // [object Math] // Since JavaScript 1.8.5 toString.call(undefined); // [object Undefined] toString.call(null); // [object Null] UnderscoreJS uses toString.call(obj) instead of typeOf because it's faster: _.isNumber = function(obj) { return toString.call(obj) == '[object Number]'; };
upvote count: 1
has comment: http://stackoverflow.com/comment/47719178
has comment: http://stackoverflow.com/comment/47720527
type: AcceptedAnswer

http://stackoverflow.com/q/29827271
type: Question
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Conditional Formatting Values in Table
has answer: http://stackoverflow.com/a/29827858
has body: I'm trying to set some conditional formatting on values within a table. For example I have 2 columns, 1 Row, so 2 values (1 in each td). I am trying to set the font colour of any values in the row that contain the text "Red" in the table to red. I don't seem to be getting errors. RESOLVED: Final Code: <?!= include('script_js'); ?> <? var data = getData(); ?> <? for (var i = 0; i < data.length; i++) { ?> <? for (var j = 0; j < data[i].length; j++) { ?> <?= data[i][j] ?> <? } ?> <? } ?> <?!= include('script_rag'); ?> script_rag:
has comment: http://stackoverflow.com/comment/47781680
accepted answer: http://stackoverflow.com/a/29827858
type: AnsweredQuestion

http://stackoverflow.com/a/29815353
has comment: http://stackoverflow.com/comment/47762483
answers question: http://stackoverflow.com/q/29814930
has body: The code below can be used, which loads a form with the submit button disabled and enable it when certain validation requirements of the form have been met: function formValidation(oEvent) { oEvent = oEvent || window.event; var txtField = oEvent.target || oEvent.srcElement; var t1ck = true; //Enter Text Field ID/Name in place of 't1' var msg = " "; if(document.getElementById("t1").value.length &lt; 3 ) { t1ck = false; msg = msg + "Text Entered should be minimun 3 char length"; } //Enter Text Field ID/Name in place of 't1' if(document.getElementById("s1").value.length &lt; 1 ) { t1ck = false; msg = msg + " Select one of the options"; } //Enter Select Field ID/Name in place of 's1' if(t1ck) { document.getElementById("btnSignUp").disabled = false; } //Enter submit button ID/Name in place of 'btnSignUp' else{ document.getElementById("btnSignUp").disabled = true; } } function resetForm() { document.getElementById("btnSignUp").disabled = true; var frmMain = document.forms[0]; frmMain.reset(); } window.onload = function () { var btnSignUp = document.getElementById("btnSignUp"); var btnReset = document.getElementById("btnReset"); //Enter reset button ID/Name in place of 'btnReset' var t1 = document.getElementById("t1"); var s1 = document.getElementById("s1"); var t1ck = false; document.getElementById("btnSignUp").disabled = true; t1.onkeyup = formValidation; s1.onclick = formValidation; btnReset.onclick = resetForm; }
score: 0
type: Answer

http://stackoverflow.com/comment/47658224
score: 0
type: Comment
type: QuestionComment
has text: If u have jQuery at your disposal, you should consider rewriting all of this code using jquery..
comment on: http://stackoverflow.com/q/29763285

http://stackoverflow.com/q/29753143
has body: Hello I try to create my own config. and its much working well but some times i when i change html code live reload is not working dont know why. Any one can help with that? var livereload = require('gulp-livereload'); gulp.task('reload-html',function(){ gulp.src('./*.html') .pipe(livereload()) .pipe(notify({ message: 'Reload html task complete' })); }); gulp.task('watch-files',function(){ livereload.listen(); gulp.watch('*.html',['reload-html']) gulp.watch('assets/sass/**/*.scss',['sass']); gulp.watch('assets/images/src/**/*',['images-min']); }); Also I use live reload plugin for google chrome.
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29753612
tagged with: javascript
has answer: http://stackoverflow.com/a/29753308
tagged with: gulp-watch
score: 0
has title: gulp live reload config
tagged with: gulp
type: UnansweredQuestion

http://stackoverflow.com/q/29793380
type: Question
tagged with: cmd
accepted answer: http://stackoverflow.com/a/29793869
favorite count: 0
has title: is there any solution to open browser in full screen mode from command line?
has answer: http://stackoverflow.com/a/29793925
has body: Is there any elegant(or not) solution to open a browser in full screen mode from command line. Browser full screen api will works only on any user action. I just need to display a data in a big monitor without showing title bar, menu bar etc. Whether it is possible with browser without any user action. Whether I could trigger any user action using selenium like tools. Or anybody could tell any other alternatives to display a data in full screen mode without any user action, but with command line. Thanks in advance.
linked to: http://stackoverflow.com/q/19355370
tagged with: web-applications
upvote count: 1
possible better answer: http://stackoverflow.com/a/29793925
has comment: http://stackoverflow.com/comment/47715314
score: 0
answer count: 3
tagged with: selenium
downvote count: 1
has answer: http://stackoverflow.com/a/29793869
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/29794632

http://stackoverflow.com/a/29826350
score: 3
has body: $('.button-1').click(function() { $('.div-2').hide(); $('.div-1').show(); }); $('.button-2').click(function() { $('.div-1').hide(); $('.div-2').show(); });
upvote count: 3
has comment: http://stackoverflow.com/comment/47781471
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29826214
has comment: http://stackoverflow.com/comment/47779471
answers question: http://stackoverflow.com/q/29826214
type: Answer

http://stackoverflow.com/comment/47575559
score: 0
type: QuestionComment
type: Comment
has text: @user2349668, `"123"` **does not match** the specified regex. Your comment directly conflicts with the question you've asked. Please add some *real* examples of *real* input that you expect to match, and *real* input that you expect to not match.
comment on: http://stackoverflow.com/q/29702412

http://stackoverflow.com/comment/47722987
score: 0
type: Comment
has text: yes I can understand you , I am not actually using your function but show me one new path Thanks very much , I will post also my answer after getting succuss but believe Going in your direction with minimum effert :)
comment on: http://stackoverflow.com/a/29794483
type: AnswerComment

http://stackoverflow.com/a/29814372
answers question: http://stackoverflow.com/q/29793022
type: Answer
has body: An alternate way, which I just found out. Will be useful to extract from existing code, without any modification. It does introduce an extra global variable, outside your main angular app, and might not be highly recommended, but still, posting this. var json = {}; var app = angular.module('app', ['flow']) .config(['flowFactoryProvider', function (flowFactoryProvider) { flowFactoryProvider.defaults = { target: 'processxls', permanentErrors: [404, 500, 501], maxChunkRetries: 4, chunkRetryInterval: 500, simultaneousUploads: 4 }; flowFactoryProvider.on('catchAll', function (event) { console.log('catchAll', arguments); this.jsonResponse = arguments[2]; //Note this change //json = this.jsonResponse; console.log(this.jsonResponse); json = angular.fromJson(this.jsonResponse); }); // Can be used with different implementations of Flow.js // flowFactoryProvider.factory = fustyFlowFactory; }]); 'json' variable now has the json response received. You can use it for further use now. P.S. in order to check for which value of 'i' arguments[i] gives you the json, see console.
score: 0

http://stackoverflow.com/q/29697343
tagged with: jquery
tagged with: ajax
has body: I have the following script to load an HTML page that is generated from a node.js server: (function nodeLoader(){ $.ajax({ url: "http://oclock.dyndns.org:8000", method: "get", data: {hk: hk }, success: function(data){ var visibile = $("div.scheda:visible").attr("id"); $('.scheda').hide('fast',function(){$('#99').html(data).show();}); setTimeout( function(){ //devo prendere id del messaggio visualizzato e settarlo a letto $('.scheda').hide('fast',function(){$('#'+visibile).show().html(data);}); },30000 ); } }); })(); the page loaded is the following: What I am trying to get is to add to nodeLoader a if (in success function) that says: if #container contains data (the node.js server is fetching something) then do hide and show. How can I do this? How to drill down data variable? The only idea I got is to change the node.js server to serve a json array instead of the page but I'd like not to rewrite the server by now.
answer count: 1
has answer: http://stackoverflow.com/a/29697490
favorite count: 0
upvote count: 2
downvote count: 1
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/29697490
type: Question
has title: handle data returned from an AJAX call
tagged with: javascript

http://stackoverflow.com/q/29758980
favorite count: 0
tagged with: go
has comment: http://stackoverflow.com/comment/47650570
tagged with: dictionary
score: 2
has comment: http://stackoverflow.com/comment/47650791
has comment: http://stackoverflow.com/comment/47685860
upvote count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29759876
has comment: http://stackoverflow.com/comment/47650828
downvote count: 1
type: Question
has title: Golang vs JavaScript (v8/node.js) map performance
tagged with: performance
has comment: http://stackoverflow.com/comment/47685504
has comment: http://stackoverflow.com/comment/47650879
has body: Out of curiosity I wrote some trivial benchmarks comparing the performance of golang maps to JavaScript (v8/node.js) objects used as maps and am surprised at their relative performance. JavaScript objects appear to perform roughly twice as fast as go maps (even including some minor performance edges for go)! Here is the go implementation: // map.go package main import "fmt" import "time" func elapsedMillis(t0, t1 time.Time) float64 { n0, n1 := float64(t0.UnixNano()), float64(t1.UnixNano()) return (n1 - n0) / 1e6 } func main() { m := make(map[int]int, 1000000) t0 := time.Now() for i := 0; i &lt; 1000000; i++ { m[i] = i // Put. _ = m[i] + 1 // Get, use, discard. } t1 := time.Now() fmt.Printf("go: %fms\n", elapsedMillis(t0, t1)) } And here is the JavaScript: #!/usr/bin/env node // map.js function elapsedMillis(hrtime0, hrtime1) { var n0 = hrtime0[0] * 1e9 + hrtime0[1]; var n1 = hrtime1[0] * 1e9 + hrtime1[1]; return (n1 - n0) / 1e6; } var m = {}; var t0 = process.hrtime(); for (var i=0; i&lt;1000000; i++) { m[i] = i; // Put. var _ = m[i] + 1; // Get, use, discard. } var t1 = process.hrtime(); console.log('js: ' + elapsedMillis(t0, t1) + 'ms'); Note that the go implementation has a couple of minor potential performance edges in that: Go is mapping integers to integers directly, whereas JavaScript will convert the integer keys to string property names. Go makes its map with initial capacity equal to the benchmark size, whereas JavaScript is growing from its default capacity). However, despite the potential performance benefits listed above the go map usage seems to perform at about half the rate of the JavaScript object map! For example (representative): go: 128.318976ms js: 48.18517ms Am I doing something obviously wrong with go maps or somehow comparing apples to oranges? I would have expected go maps to perform at least as well - if not better than JavaScript objects as maps. Is this just a sign of go's immaturity (1.4 on darwin/amd64) or does it represent some fundame…
has comment: http://stackoverflow.com/comment/47669699
has comment: http://stackoverflow.com/comment/47650681
answer count: 1
tagged with: javascript
tagged with: data-structures

http://stackoverflow.com/comment/47573949
type: Comment
has text: That is pretty awesome, does exactly what I want. Thanks for the quick response. Where is a good spot to views some docs on the setTimeout idea?
comment on: http://stackoverflow.com/a/29719665
score: 0
type: AnswerComment

http://stackoverflow.com/a/29746720
downvote count: 0
has body: You should try this there are basically two approach you can delete a row First is $(".button-remove").click(function(){ $(this).parent().parent().remove(); }); Second is $(document).ready(function(){ var3=$(".button-remove").click().val(); $(document).on("click",".button-remove",function(){ $(this).closest('.row').remove(); }); }); You can see the First demo Second Demo
answers question: http://stackoverflow.com/q/29746118
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/47763034
type: QuestionComment
has text: @VigneswaranMarimuthu Actually I have setup a registration form for item data and I wanted to save multiple Item at one click. To do this I created a form where I can dynamically add another set of fields so that I can save multiple items. And in order to add another set of fields I used the javascript clone to duplicate thesame set of fields where I can enter item data and to collect those data in the form I used 'form.serialize()' and submit it using ajax. The problem is in the multiple insert part because it only place the serialized data in one array even though it has a two set.
score: 0
comment on: http://stackoverflow.com/q/29817196
type: Comment

http://stackoverflow.com/q/29799936
tagged with: javascript
has comment: http://stackoverflow.com/comment/47728141
tagged with: compare
has answer: http://stackoverflow.com/a/29799996
answer count: 1
has title: Compare JavaScript Object-Array Property with String
tagged with: properties
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29799996
score: 0
has body: Hello I have a quick question regarding my javascript array: var firstrecord = { name: 'Luca', age: '19' }; var secondrecord = { name: 'Hans', age: '25' } var myArray = []; myArray.push(firstrecord,secondrecord); Alright, now I have a var SearchString = "Lu". What I'd do: for (var i = 0; i &lt; myArray.length; i++) { if (myArray[i].[name].IndexOf(SearchString, i)) != 1){ return myArray[i]; } } But this doesn't work. Is there any solution to this problem ? Update: indexOf != IndexOf Reminder to self.. first lookup the use of such functions before misusing them. :)
type: Question
tagged with: arrays

http://stackoverflow.com/comment/53843621
type: QuestionComment
comment on: http://stackoverflow.com/q/29718481
has text: I am facing the same problem, when using the htaccess to direct requests to the index.html (to avoid page for breaking in refresh). Have you been able to figure this out?
score: 0
type: Comment

http://stackoverflow.com/comment/47654146
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29761022
has text: it depends of console.log(), but you are right it's more close to question.

http://stackoverflow.com/comment/47557163
comment on: http://stackoverflow.com/q/29710737
type: QuestionComment
has text: I want to know how I can load it. I want to load it in a section of my website.
score: 0
type: Comment

http://stackoverflow.com/comment/47562348
type: Comment
has text: Thanks, I can't believe I didn't think of this..SMH
comment on: http://stackoverflow.com/a/29713569
score: 0
type: AnswerComment

http://stackoverflow.com/a/29696149
answers question: http://stackoverflow.com/q/29690952
type: Answer
upvote count: 5
score: 5
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29690952
has body: If you just want to be able to scroll in it in mobile the easiest way is just to add a scrollbar and hide it so you are able to scroll through the menu but without having a real scrollbar shown (or if you prefer you could leave it its up to you :) Here is what i have tried -> .top-nav-mobile .top-nav-btns { width: 280px; overflow: auto; } .top-nav-mobile .nav li { margin-bottom: 0px; display:inline-block; float:none; margin-right:-4px; } .top-nav-mobile .nav-tabs { border-bottom: none; white-space: nowrap; } *this adds the scrollbar and scrolling functionallity (we remove the set width so it ll work for as many as you want elements, the negative margin is for removing the white space that inline-block elements create AND the white-space:nowrap actually makes it to be on one expandable line :) .top-nav-mobile .top-nav-btns::-webkit-scrollbar { width: 0 !important; } *this hides it (if you want you could skip it) This is the working JSFiddle https://jsfiddle.net/6yw6rp02/4/ I hope i helped you :)

http://stackoverflow.com/comment/47616077
comment on: http://stackoverflow.com/q/29741161
type: Comment
type: QuestionComment
score: 1
has text: `ko.cleanNode($('.myClass'));` should be `ko.cleanNode($('.myClass')[0]);`

http://stackoverflow.com/comment/47715556
type: Comment
type: QuestionComment
score: 0
has text: the simple HTML & want to restrict download! what do u want to ask?
comment on: http://stackoverflow.com/q/29793498

http://stackoverflow.com/comment/47577220
type: AnswerComment
score: 0
type: Comment
has text: @DrewTuzson - please read my prior comment about sorting. `.sort()` by itself sorts an array of strings. That is not what you have. You would need a custom sort function to sort an array of DOM elements and then you would need to reinsert them into the DOM in the sorted order. That should be the subject of a new question, not this question.
comment on: http://stackoverflow.com/a/29721090

http://stackoverflow.com/q/29830254
type: Question
has comment: http://stackoverflow.com/comment/47787309
tagged with: javascript
has comment: http://stackoverflow.com/comment/47787296
score: 0
has answer: http://stackoverflow.com/a/29830413
has comment: http://stackoverflow.com/comment/47787320
answer count: 1
has comment: http://stackoverflow.com/comment/47787160
tagged with: nan
tagged with: operators
has comment: http://stackoverflow.com/comment/47787120
has comment: http://stackoverflow.com/comment/47787211
accepted answer: http://stackoverflow.com/a/29830413
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47787145
has comment: http://stackoverflow.com/comment/47787017
has title: Game Scoring returns NaN, No luck with +=
has comment: http://stackoverflow.com/comment/47787034
has body: I'm going to do my best to describe my problem here. My js code is supposed to assign a value to the hand and chip variable from an if statement. This is then passed to another function which applies a multiplier to it based off of a coin flip. At the end, it should write the results to the page, and keep the total count of the score while resetting the hand each time. I believe my problem is when i try to do var totalHand = (totalHand + handC);, which returns NaN. Im stuck as to where to go next, my teacher had mentioned using parseInt but I'm not sure that would solve the problem, or how to apply it. https://jsfiddle.net/armadadamra/swcL1d2m/7/ I appreciate any help and ask for some patience, i'm only in my first semester of learning js. Thanks Where I think the problem is: var totalHand = (totalHand + handC); var greenChipTotal = (greenChipTotal + greenCC); var redChipTotal = (redChipTotal + redCC); var purpleChipTotal = (purpleChipTotal + purpleCC); var blackChipTotal = (blackChipTotal + blackCC); All the js: // images var dice1 = [' '] var dice2 = [' '] var dice3 = [' '] var dice4 = [' '] var dice5 = [' '] var dice6 = [' '] var loader = [' '] var coin1 = [' '] var coin2 = [' '] // game vars var totalA = 0; var handA = 0; var greenC = 0; var redC = 0; var purpleC = 0; var blackC = 0; function myRandoms() { var ranA = Math.floor((Math.random() * 6) + 1); var ranB = Math.floor((Math.random() * 6) + 1); var ranC = Math.floor((Math.random() * 6) + 1); var ranD = Math.floor((Math.random() * 6) + 1); // dice display // dice a if (ranA==1){document.getElementById("tdDiceA").innerHTML = dice1;}; if (ranA==2){document.getElementById("tdDiceA").innerHTML = dice2;}; if (ranA==3){document.getElementById("tdDiceA").innerHTML = dice3;}; if (ranA==4){document.getElementById("tdDiceA").innerHTML = dice4;}; if (ranA==5){document.getElementById("tdDiceA").innerHTML = dice5;}; if (ranA==6){document.getElementById("tdDiceA").innerHTML = dice6;}; // dice b if (ranB==1){document.getE…

http://stackoverflow.com/a/29741152
answers question: http://stackoverflow.com/q/29740989
has body: Add a class to all inputs except the first one and set display to none. .vis { display: none; } Wrap all the divs in a wrapper div and assign an id container on click call var next_id = parseint($(this).attr('id')) + 1; $(this).closest('div').hide(); $(this).closest('.container').find('#' + next_id).show();
downvote count: 0
type: Answer
score: 1
upvote count: 1

angular-services
tags question: http://stackoverflow.com/q/29843523
tags question: http://stackoverflow.com/q/29767987
tag name: angular-services
type: Tag

http://stackoverflow.com/comment/47808076
comment on: http://stackoverflow.com/q/29840874
has text: You are probably wanting to localize your website..Take a look at http://stackoverflow.com/questions/754520/what-is-the-actual-differences-between-i18n-l10n-g11n-and-specifically-what-does
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29805390
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/29805198
type: Answer
answers question: http://stackoverflow.com/q/29805198
has body: You just need to put &lt;div&gt; around your slideshow and apply text-align:center to the div. &lt;div style="text-align:center;"&gt; &lt;img src="congo.jpg" name="slide" width="400" height="300"&gt; &lt;/div&gt; Quick and dirty example: https://jsfiddle.net/pbsz9spu/
has comment: http://stackoverflow.com/comment/47738809
has comment: http://stackoverflow.com/comment/47738885

http://stackoverflow.com/comment/47717249
type: QuestionComment
has text: Post your code please!!!
comment on: http://stackoverflow.com/q/29794334
score: 0
type: Comment

http://stackoverflow.com/comment/47720519
has text: Possible duplicate http://stackoverflow.com/questions/14106864/linking-jquery-in-html
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29796169

http://stackoverflow.com/a/29718255
type: Answer
has comment: http://stackoverflow.com/comment/47571377
score: 4
upvote count: 4
has body: .toggleClass('.boldClass') should be without the . like .toggleClass('boldClass'); Also your'e missing a closing (instead of ). Here's an example: $(document).ready(function(){ $('#bold').click(function(){ $('.textdoc').toggleClass('boldClass'); }); }); .boldClass{ font-weight:bold; } Bold TEST If you want to click on B and be able to write in Bold that you're interested in contenteditable attribute. (it cannot be done inside a textarea) $("[data-cmd]").click(function(evt){ evt.preventDefault(); var cmd = $(this).data().cmd; document.execCommand(cmd, false, null); }); #editable{ border:1px solid #ddd; min-height:100px; padding:5px; } B I U Write here
downvote count: 0
answers question: http://stackoverflow.com/q/29718212

http://stackoverflow.com/comment/47729768
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29799075
score: 0
has text: Hi @nirmal. I am sorry I tried my best here but it is falling somewhere. here is the [link](https://jsfiddle.net/rd5ugmy7/2/). I forked required js from Github and specified jquery 1.9.x version. This is my first time so I do apologize. Anyway, the whole think looks exactly like on my website before I drag the slider and trigger it to do animation. Thank you.

partial-application
type: Tag
tag name: partial-application
tags question: http://stackoverflow.com/q/29788813

http://stackoverflow.com/a/30165262
upvote count: 4
answers question: http://stackoverflow.com/q/29797533
has comment: http://stackoverflow.com/comment/48533078
accepted answer of: http://stackoverflow.com/q/29797533
downvote count: 0
has body: Make your model direct child of body like this. &lt;body&gt; &lt;ons-modal var="modal"&gt; &lt;ons-icon icon="ion-load-c" spin="true"&gt;&lt;/ons-icon&gt; &lt;br&gt;&lt;br&gt; Please wait.&lt;br&gt;Closing in 2 seconds. &lt;/ons-modal&gt; This way you'll be able to access modal anywhere in your any controller. Now your controller should be like this. module.controller('directoryControl', function($scope, $http) { //console.log($scope.username + ", " + $scope.password); modal.show(); var responsePromise = $http.get("http://www.mywebsitepadth.com/api/get_category_index/"); responsePromise.success(function(data, status, headers, config) { modal.hide(); }); responsePromise.error(function(data, status, headers, config) { alert("ajax didnt work"); }); });
type: AcceptedAnswer
score: 4
type: Answer

http://stackoverflow.com/q/29755848
type: UnansweredQuestion
tagged with: windows-phone-8.1
has comment: http://stackoverflow.com/comment/47644676
score: 2
has body: When I run below Javascript, all browsers including all versions of IE on desktop trigger the onload handler, but IE on Windows Phone 8.1 triggers onerror. Is this a bug? And if so is there a good fix for it? var image = new Image(); image.onload = function(){ alert('onload'); }; image.onerror = function(){ alert('error'); }; image.src = 'http://youtube.com/favicon.ico'; Link to test page: http://sandbox.saeidmohadjer.com/test_winphone_img_onerror.html
answer count: 0
tagged with: internet-explorer-11
has title: IE on Windows Phone triggers onerror when loading an image in Javascript
type: Question
has comment: http://stackoverflow.com/comment/47665924
tagged with: javascript
has comment: http://stackoverflow.com/comment/62322254
downvote count: 0
tagged with: dom-events
favorite count: 0
upvote count: 2

http://stackoverflow.com/comment/47610328
comment on: http://stackoverflow.com/a/29738573
has text: If *top* is `'10'` and *bottom* is `'1'`, then `1 + top - bottom` will be `109`, since the `-` operator implicitly converts strings to numbers. ;-)
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/a/29743887
upvote count: 0
type: Answer
has body: Here is how to send content with XmlHttpRequest: var http = new XMLHttpRequest(); var url = "get_data.php"; var params = "lorem=ipsum&amp;name=binny"; http.open("POST", url, true); //Send the proper header information along with the request http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.setRequestHeader("Content-length", params.length); http.setRequestHeader("Connection", "close"); http.onreadystatechange = function() {//Call a function when the state changes. if(http.readyState == 4 &amp;&amp; http.status == 200) { alert(http.responseText); } } http.send(params); From: Send POST data using XMLHttpRequest This post: http://www.tutorialspoint.com/php/php_get_post.htm explains how to get the values from PHP: &lt;?php if( $_POST["name"] || $_POST["age"] ) { echo "Welcome ". $_POST['name']. "&lt;br /&gt;"; echo "You are ". $_POST['age']. " years old."; exit(); } ?&gt; &lt;html&gt; &lt;body&gt; &lt;form action="&lt;?php $_PHP_SELF ?&gt;" method="POST"&gt; Name: &lt;input type="text" name="name" /&gt; Age: &lt;input type="text" name="age" /&gt; &lt;input type="submit" /&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;
downvote count: 1
answers question: http://stackoverflow.com/q/29743795
score: -1
has comment: http://stackoverflow.com/comment/47620943

http://stackoverflow.com/q/29760965
has comment: http://stackoverflow.com/comment/47654087
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/29760977
has body: I would like to validate an input of words separated by some delimiter. The delimiter in this case is the "|" sign, separated by space before and after Hello | There | Yes -----&gt; Match Hello -----&gt; Match hello|There -----&gt; No Match So far I've gotten to only the first word with the following rejex: ^[a-zA-Z]+ how do I separate the words or numbers with a space and a delimiter? PS Still working through the tutorials. Any help would be appreciated To Further clarify, i'm looking for regex for the above for a dojo dijit widget to validate the input properly. dojo.declare("some.class", dijit.form.ValidationTextBox, { regExp: "" }); dojo.addOnLoad(function() { var formString = new some.class({ }, "StringName"); } &lt;form id="myForm" name="myForm"&gt; String: &lt;input id="StringName" name="name" type="text"&gt; &lt;/form&gt;
has comment: http://stackoverflow.com/comment/47654189
has title: Javascript regex to match words separated by a spaced delimiter
has answer: http://stackoverflow.com/a/29760980
tagged with: regex
tagged with: dojo
has comment: http://stackoverflow.com/comment/47654149
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29760997
has answer: http://stackoverflow.com/a/29760997
type: Question
accepted answer: http://stackoverflow.com/a/29760980
tagged with: javascript
has comment: http://stackoverflow.com/comment/47654064

http://stackoverflow.com/q/29776116
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29776307
upvote count: 1
type: Question
score: 1
possible better answer: http://stackoverflow.com/a/29776306
has answer: http://stackoverflow.com/a/29776306
answer count: 2
accepted answer: http://stackoverflow.com/a/29776307
downvote count: 0
tagged with: javascript
has title: single action for component within a div
tagged with: jquery
tagged with: click
favorite count: 0
has body: I have one in which I will be having multiple components, at first if I click at any component, the corresponding action should be triggered and after that no other component click event within that div should not trigger unless otherwise the mouse moves out of the borderline and again comes back in. I have used .one() JQuery function , but that prevents further click Can anyone tell me some solution for this JSFiddle html Click Me Click Me Too script $(document).ready(function() { $("#myButton").one("click", function(){ console.log('button click....'); }); });
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/a/30010484
has body: You're really close. The 'tabs' object is only available in index.js - you need to think of the eval'd code you supply as the 'contentScript' property as a completely different environment. I've update the code, basically all that's different is I'm sending the yandex url back to index.js via postMessage so that I can open the tab in index.js: var contextMenu = require("sdk/context-menu"); var Request = require("sdk/request").Request; var self = require('sdk/self'); var tabs = require('sdk/tabs'); var translating = 'translating...'; var menuItem = contextMenu.Item({ label: translating, image: self.data.url('ico.png'), context: contextMenu.SelectionContext(), contentScript: 'self.on("context", function() {' + 'var selectionText = window.getSelection().toString();' + 'self.postMessage({name:"context",data:selectionText});' + 'return true;' + '});' + 'self.on("click", function() {' + 'var selectionText = window.getSelection().toString();' + 'self.postMessage({name:"click", data:"https://translate.yandex.by/?text=" + selectionText});' + '})', onMessage: function(message) { if (message.name === 'context') { // handle the context message menuItem.label = translating; Request({ url: "https://translate.yandex.net/api/v1.5/tr.json/translate?key=trnsl.1.1.20150402T173446Z.82a90fe78ca2aeaf.a3bd7c7a0f72b260e28f5d92e4f242cf6ba189d3&amp;lang=ru&amp;text="+selectionText, onComplete: function(response) { var translated = response.json.text[0]; menuItem.label = translated; } }).get(); } else if (message.name === 'click') { // handle the click message tabs.open(message.data); } } }); See the SDK's extensive documentation on how content scripts work for more info on this topic.
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29788706
answers question: http://stackoverflow.com/q/29788706

http://stackoverflow.com/a/29752372
answers question: http://stackoverflow.com/q/29750149
downvote count: 0
has body: A more concise way would be to use a watch group or a watch collection... $scope.$watchCollection('[selCountry, searchText]', function(n, o, scope) { //logic to determine what changed... }); You can view the plunk here: http://plnkr.co/edit/BXTGpNsGeqT9kVsGnEOg?p=preview You may also refer the following post: https://stackoverflow.com/a/17224886/145682 Ps: having some weird problem with the plunk...hopefully I can fix it... Edit: plunk fixed: see this post. Still feels there is a better way... Edit2: better more maintainable version Edit3: I am officially changing my answer (because of post pointed to in my 2nd edit). I think that that approach is better than watching two variables...it is simpler. Rather have a single ng-change function to execute. Pass an argument to that and handle logic accordingly $scope.onChange = function(src) { if(src === 'txt') { //from text box } else { //from dropdown } }; Set ng-change="onChange('txt')" and ng-change="onChange('drp')" to the textbox and dropdown respectively...
accepted answer of: http://stackoverflow.com/q/29750149
type: AcceptedAnswer
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47637240

http://stackoverflow.com/comment/47650713
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29759206
has text: possible duplication of http://stackoverflow.com/questions/26454655/convert-javascript-array-of-2-element-arrays-into-object-key-value-pairs
score: 0

http://stackoverflow.com/q/29793543
has comment: http://stackoverflow.com/comment/47717410
upvote count: 1
type: Question
answer count: 2
tagged with: canvas
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47715630
has answer: http://stackoverflow.com/a/29793592
has title: How to animate a cursor image when click in canvas area?
linked to: http://stackoverflow.com/q/9648131
tagged with: http://stackoverflow.com/tag/html
score: 1
tagged with: css
has body: I have changed my cursor to an own image, and I want to rotate the image -120deg when I click in the canvas area. here is the animation I want to have, but on my cursor instead of an image: img { -webkit-transition: -webkit-transform 0.05s ease-in; } img:hover{ -webkit-transform:rotate(-120deg) } My canvas: &lt;canvas id="gamemap" width="900" height="526" onclick="animateCursor()"&gt;&lt;/canvas&gt; JavaScript: function animateCursor() { } css: #gamemap { cursor: url('../Image/myimageup'), auto; } Is there any solution for this?
has answer: http://stackoverflow.com/a/29793923
type: UnansweredQuestion

http://stackoverflow.com/q/29815978
tagged with: javascript
has title: PHP Output Not Appearing in HTML
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29816205
tagged with: php
tagged with: css
answer count: 4
has answer: http://stackoverflow.com/a/29816369
has answer: http://stackoverflow.com/a/29816183
accepted answer: http://stackoverflow.com/a/29816183
has answer: http://stackoverflow.com/a/29816248
has comment: http://stackoverflow.com/comment/47759464
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29816248
has comment: http://stackoverflow.com/comment/47759499
has body: I have made some code to post the output of a PHP file showing the music I have been recently listening to on Spotify. The HTML, CSS and JS (for the spotify.php file) are included in this fiddle. The JS within my index.php file is: &lt;script type="text/javascript"&gt; function get_spotify() { $.ajax({ type: 'POST', url: 'https://theobearman.com/cv/modules/spotify.php', data: { request: 'true' }, success: function(reply) { $('.now-playing').html("" + reply + ""); } }); } window.onload = get_spotify; &lt;/script&gt; My issue is that the output of the .php file is not showing up under the 'Music' header on my website. This was working a few days ago, so I'm not sure why it is not working now. Thanks in advance for any help, Theo.
has comment: http://stackoverflow.com/comment/47759440
type: Question
score: 0
tagged with: spotify

http://stackoverflow.com/q/29801246
has comment: http://stackoverflow.com/comment/47730771
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29801469
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29801351
favorite count: 0
linked to: http://stackoverflow.com/q/364946
has comment: http://stackoverflow.com/comment/47730690
type: Question
possible better answer: http://stackoverflow.com/a/29801351
has comment: http://stackoverflow.com/comment/47730629
tagged with: php
linked to: http://stackoverflow.com/q/20080341
has comment: http://stackoverflow.com/comment/47730927
has body: We are developing web sit. We have button.In button action we placed PDF file downloading.Working fine.But We need How do I count download my PDF file from my website. We tried like this but We not get. &lt;?php //$Down=$_GET['Down']; $a="hello"; $i=0; ?&gt; &lt;script type="text/javascript"&gt; var i=0; function submitForm() { &lt;?php $i = @file_get_contents('count.txt'); // read the hit count from file echo $i; // display the hit count $i++; // increment the hit count by 1 @file_put_contents('count.txt', $i); // store the new hit count ?&gt; } &lt;/script&gt; &lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="button" onclick="submitForm()" value="submit 1" /&gt; &lt;/body&gt; &lt;/html&gt; We got nothing .We are new to PHP Please guide to us.
has comment: http://stackoverflow.com/comment/47730737
has comment: http://stackoverflow.com/comment/47730874
tagged with: onclick
has answer: http://stackoverflow.com/a/29801469
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/47730606
tagged with: file-put-contents
tagged with: file-get-contents
has title: how to pass number of hits count based on button action in php

http://stackoverflow.com/a/29786721
has body: you can look this https://api.jquery.com/jQuery.ajax/ use ajax to request
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47703516
answers question: http://stackoverflow.com/q/29786640

http://stackoverflow.com/comment/47733203
score: 0
comment on: http://stackoverflow.com/a/29802506
type: AnswerComment
type: Comment
has text: Add an `if(/list_row[1-9]\d?/.test(this.id))` in the event. And @JuanMendes's limitation is solved.

http://stackoverflow.com/q/29792324
has title: Multiple file upload with JQuery and MVC4
tagged with: multiple-file-upload
type: Question
tagged with: c#
has body: I am trying to upload multiple files along with normal form data. This thing i have formerly implemented in PHP now i am using to do this in ASP.NET MVC4 in C#. I have an html form &lt;form action="/controller/actionane" name="applicationform" class="upload-form" method="post" onsubmit="return false;" enctype="multipart/form-data" id="userform"&gt; &lt;input class="form-control" type="file" class="upload-file" data-max-size="12582912" multiple="multiple" name="attachment[]" value="documents"&gt; &lt;input class="btn btn-success" type="submit" name="submit" onclick="formSubmit()" /&gt; &lt;/form&gt; My Javascript Code with jquery-1.11.1 looks like this: function formSubmit() { var form = $("form[name='applicationform']"); var data = new FormData(form[0]); $.ajax( { method: "POST", url: form.attr("action"), processData: false, // Don't process the files contentType: false, cache: false, async: false, data: data, success: function (data) { alert(data); } }); } and my controller looks like this [HttpPost] public JsonResult submitApplication(HttpPostedFileBase[] attachment) { string fil= ""; foreach (HttpPostedFileBase file in attachment) { /*Geting the file name*/ string filename = System.IO.Path.GetFileName(file.FileName); fil += filename; /*Saving the file in server folder*/ file.SaveAs(Server.MapPath("~/Images/" + filename)); string filepathtosave = "Images/" + filename; /*HERE WILL BE YOUR CODE TO SAVE THE FILE DETAIL IN DATA BASE*/ } return this.Json(fil,JsonRequestBehavior.AllowGet); } But this is not passing files to the parameter Object reference null exception is thrown What should I do to get this running?
has comment: http://stackoverflow.com/comment/47713426
tagged with: javascript
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/47715091
has answer: http://stackoverflow.com/a/29794153
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47714640
type: UnansweredQuestion
tagged with: asp.net-mvc-4
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47714845

http://stackoverflow.com/comment/47518033
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29690724
score: 0
has text: hide the row of the deleted item

http://stackoverflow.com/comment/47688411
comment on: http://stackoverflow.com/a/29704541
has text: Oh you also need a `return` in front of that.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/a/29838558
type: Answer
answers question: http://stackoverflow.com/q/29837980
score: 0
has body: Thanks to @gp and his clarification as to where the js needed to be called from, I got it working. I put the following code in the page that was being loaded into the iframe and it works as desired. $(window).load(function() { function getAvatarSrc(){ var avatar_src = $('#temp_header_avatar img').attr('src'); window.parent.$('#header_avatar').html('&lt;img src="' + avatar_src + '" class="avatar user-1-avatar avatar-150 photo" width="150" height="150" alt="Profile Photo"&gt;').hide().fadeIn(1000); window.parent.$('#nav_avatar').html('&lt;img src="' + avatar_src + '" class="avatar img-circle user-1-avatar avatar-60 photo" width="60" height="60" alt="Profile Photo"&gt;').hide().fadeIn(1000); }; getAvatarSrc(); });
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29837980

http://stackoverflow.com/a/29805115
accepted answer of: http://stackoverflow.com/q/29782222
type: Answer
has body: I came across a jquery forum post that had some additional information regarding this issue. Based on what I found there, I added this to the $.ajax call: beforeSend: function (xhr) { xhr.setRequestHeader('Authorization', makeBaseAuth(user, pswd)); } where makeBaseAuth() uses the btoa() function like this: makeBaseAuth: function(user, pswd){ var token = user + ':' + pswd; var hash = ""; if (btoa) { hash = btoa(token); } return "Basic " + hash; } That appears to be working in Chrome now, I'm not getting a login prompt or a 401 response, the request is going through and I get the expected response. I also removed the option xhrFields: { withCredentials: true } as that didn't appear to be necessary. For some reason this isn't working in Firefox yet, and in the Firefox debugger I can't actually get at the javascript to do any decent debugging to see what the problem is, the way this script works is its loaded into a web page as an anonymous script and I don't have any control over that. I have a way to get at the script in IE and Chrome, but not Firefox for some reason. I'll consider this a win just getting it to work in Chrome, thanks to everyone for prodding me in the right direction!
upvote count: 7
score: 7
answers question: http://stackoverflow.com/q/29782222
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/29743119
upvote count: 3
has comment: http://stackoverflow.com/comment/47621447
answers question: http://stackoverflow.com/q/29742898
downvote count: 0
has comment: http://stackoverflow.com/comment/47624567
has comment: http://stackoverflow.com/comment/47622287
has comment: http://stackoverflow.com/comment/47620179
type: Answer
has comment: http://stackoverflow.com/comment/47621231
has body: You may write spyOn( Backbone.history, 'navigate' ); And then expect( Backbone.history.navigate ).toHaveBeenCalled(); A possible disadvantage to that could be, if you ever execute tests in parallel and Backbone.history.navigate is spied upon by one test and being used by another test, you may not have expected results.
score: 3

http://stackoverflow.com/comment/47777492
type: Comment
comment on: http://stackoverflow.com/a/29808878
score: 0
type: AnswerComment
has text: Some browser no longer allows javascript protocol in the Url bar :(

http://stackoverflow.com/comment/47771286
type: Comment
has text: I tried that, does not make any difference
type: QuestionComment
comment on: http://stackoverflow.com/q/29822434
score: 0

http://stackoverflow.com/a/29697222
has comment: http://stackoverflow.com/comment/47532446
has comment: http://stackoverflow.com/comment/47530510
has comment: http://stackoverflow.com/comment/47530537
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29697082
answers question: http://stackoverflow.com/q/29697082
has comment: http://stackoverflow.com/comment/47530775
has comment: http://stackoverflow.com/comment/47532617
upvote count: 1
has comment: http://stackoverflow.com/comment/47531938
type: Answer
has comment: http://stackoverflow.com/comment/47531854
has comment: http://stackoverflow.com/comment/47531739
has comment: http://stackoverflow.com/comment/47532245
downvote count: 0
has body: Use setinterval to set the time to 5s jQuery('body').on('click','#AddToCart', function(evt, cart) { timber.RightDrawer.open(); var myVar = setInterval(function(){ timber.RightDrawer.close(); clearInterval(myVar); }, 5000); });
score: 1

http://stackoverflow.com/comment/47735264
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29783004
has text: Also, please refer to think link for uri encoding. It'll help http://xkr.us/articles/javascript/encode-compare/

http://stackoverflow.com/a/29828808
has body: From the doc Include fastclick.js in your JavaScript bundle or add it to your HTML page like this: &lt;script type='application/javascript' src='/path/to/fastclick.js'&gt;&lt;/script&gt; The script must be loaded prior to instantiating FastClick on any element of the page. To instantiate FastClick on the body, which is the recommended method of use: if ('addEventListener' in document) { document.addEventListener('DOMContentLoaded', function() { FastClick.attach(document.body); }, false); } Or, if you're using jQuery: $(function() { FastClick.attach(document.body); });
answers question: http://stackoverflow.com/q/29828469
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29828469
type: Answer
has comment: http://stackoverflow.com/comment/47785217
upvote count: 3
score: 3

http://stackoverflow.com/a/67256291
type: Answer
upvote count: 2
score: 2
has body: Convert millis to DD(days):HH:MM:SS function formatTime(timeMS) { const [MS_IN_SEC, SEC_IN_DAY, SEC_IN_HOUR, SEC_IN_MIN] = [1000, 86400, 3600, 60]; let seconds = Math.round(Math.abs(timeMS) / MS_IN_SEC); const days = Math.floor(seconds / SEC_IN_DAY); seconds = Math.floor(seconds % SEC_IN_DAY); const hours = Math.floor(seconds / SEC_IN_HOUR); seconds = Math.floor(seconds % SEC_IN_HOUR); const minutes = Math.floor(seconds / SEC_IN_MIN); seconds = Math.floor(seconds % SEC_IN_MIN); const [dd, hh, mm, ss] = [days, hours, minutes, seconds] .map(item =&gt; item &lt; 10 ? '0' + item : item.toString()); return dd + ':' + hh + ':' + mm + ':' + ss; }
answers question: http://stackoverflow.com/q/29816872
downvote count: 0

http://stackoverflow.com/comment/47624858
comment on: http://stackoverflow.com/q/29745821
has text: @sitilge yes we need to count number of hits
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47700350
comment on: http://stackoverflow.com/a/29784773
type: Comment
has text: Any event is fine, as long as the logic is within your directive code and not in that shared `dismiss` function.
score: 0
type: AnswerComment

http://stackoverflow.com/a/32668535
type: Answer
upvote count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/54828349
answers question: http://stackoverflow.com/q/29805704
has comment: http://stackoverflow.com/comment/62854973
has body: I had the same problem spend a few hours before I found out that I could do it like this: const GOOGLE_FEED_API_URL = "https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&amp;num=-1&amp;q=" let url = GOOGLE_FEED_API_URL + encodeURIComponent(&lt;yoururl&gt;); fetch(url).then((res) =&gt; res.json()); Hope it helps!
score: 0

http://stackoverflow.com/q/29718746
answer count: 1
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/xml
score: 2
upvote count: 2
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/30383234
tagged with: gojs
has title: from gojs convert json model to xml
tagged with: javascript
has body: I am using gojs to create a class diagram and get the json model data, i understand you can read it from xml, is there a way of writing it to xml with XML DOM? Thank you jQuery.ajax({ url: "class.xml", success: load, dataType: "xml" }); function load(x) { var xml = jQuery(x.xml ? x.xml : x); classd.model = new go.GraphLinksModel(xml.find("node").toArray(), xml.find("link").toArray()); }

http://stackoverflow.com/a/29830414
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29827705
accepted answer of: http://stackoverflow.com/q/29827705
type: Answer
has comment: http://stackoverflow.com/comment/47789248
upvote count: 2
has body: Those callbacks are not properties of the events. They are top level fullcalendar options. Each section of the docs represents one FC top level option. Some options can also be specific to certain events, but they are mentioned as such in the docs. If you look at event object you see that there is no eventResize property, for example. So the fix is to just move the callbacks to the top level: $('#calendar').fullCalendar({ /*...other options*/ eventResizeStop: function (event, jsEvent, ui, view) { alert('end'); }, // * no callback eventClick: function (calEvent, jsEvent, view) { alert('clicked'); }, // * no callback eventDrop: function (event, delta, revertFunc, jsEvent, ui, view) { alert('dropped'); }, // * no callback eventResize: function (event, delta, revertFunc, jsEvent, ui, view) { alert(event.title + ' end is now ' + event.end.format()); }, events: [{ title: '', /*... etc*/ Here's a JSFiddle with it working.
score: 2

http://stackoverflow.com/q/29778735
tagged with: javascript
tagged with: jquery
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47687723
has answer: http://stackoverflow.com/a/29779266
has comment: http://stackoverflow.com/comment/47714002
score: 0
answer count: 2
has body: I am a complete new bee to HTML and i need some help with writing HTML code to populate the JSON array mentioned below in a table format. I know how to iterate the JSON object but not sure on the HTML code. One item per column. For eg: -------------------------------------------------------------------------------- | Created:sss Network Name | Address:sss | Owner:sss | Network Id:sss -------------------------------------------------------------------------------- | Created:sss Network Name | Address:sss | Owner:sss | Network Id:sss -------------------------------------------------------------------------------- JSON array: { "Items": [ { "Created": { "N": "1429635086877" }, "NetworkName": { "S": "cloud_sensor" }, "Address": { "S": " " }, "Owner": { "S": "sss" }, "Active": { "S": "TRUE" }, "InstanceID": { "S": " " }, "NetworkID": { "S": "1234" }, "Status": { "S": "CREATING" }, "QueueID": { "S": "sss" } }, { "Created": { "N": "sss" }, "NetworkName": { "S": "cloud_sensor" }, "Address": { "S": " " }, "Owner": { "S": "ss" }, "Active": { "S": "TRUE" }, "InstanceID": { "S": " " }, "NetworkID": { "S": "123" }, "Status": { "S": "CREATING" }, "QueueID": { "S": "ss" } } ] }
accepted answer: http://stackoverflow.com/a/29779266
possible better answer: http://stackoverflow.com/a/29779662
has title: HTML code to iterate JSON array and populate UI
has answer: http://stackoverflow.com/a/29779662
has comment: http://stackoverflow.com/comment/47687858
type: AnsweredQuestion

http://stackoverflow.com/q/29689804
tagged with: javascript
has comment: http://stackoverflow.com/comment/47517882
has body: I've been using KnockoutJS for some time now, mainly on small-to-medium sized projects. However, I'm now working on a very large project with many different views of the same data. For example, a product may be displayed to the customer, allowing them to add products to their shopping cart, and also to an administrator, allowing them to edit the product name, price and available stock. I want to be able to use the same model in both cases, but designing a solution with KnockoutJS is proving difficult. Specifically, I am having two issues: I want to be able to re-use certain "view" functionality without repeating myself. For example, in both the customer- and administrator- view of products, clicking the product thumbnail displays the product image in fullscreen. Instead of each view containing the same verbose binding code (e.g., &lt;img data-bind="event:{click:function codeToZoom(){}}"/&gt; in both views), I can move the binding information to the model itself. So the above becomes &lt;img data-bind="event:imageEvents()"/&gt;. However, doing the above forces me to include code that responds to user input in my model, which violates the single-responsibility principle - e.g., the model is reponsible for business logic, not responding to user input. If I decided I wanted an administrator clicking the thumbnail to open an "Upload New Image" dialog, then I'd need to implement a imageEventsForAdministrator() function. I've asked people how they deal with the above, and their answer has been "Write two different models." This sounds good until you realise that a product has a lot of embedded logic, and writing two different models forces you to duplicate that logic. So: According to KnockoutJS, what is the recommended approach for separating business logic from responding to events/user-input?
has title: Can event-handling be removed from KnockoutJS models and views?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47517806
favorite count: 0
linked to: http://stackoverflow.com/q/18990244
type: UnansweredQuestion
tagged with: mvvm
tagged with: web-applications
upvote count: 1
score: 1
tagged with: knockout.js
has answer: http://stackoverflow.com/a/29691885
type: Question
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/47789793
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29831070
has text: You need to define a `RouteController` that returns posts having a tag value corresponding to the route URL tag value parameter.
type: Comment

http://stackoverflow.com/comment/47799937
has text: Not all computer programs are GUI-based. In particular, web servers. Why would a web server have a GUI? It's job is to listen on net sockets and respond on net sockets. Nothing graphical about it. If you haven't learned how to use a command line, then you haven't learned how to use a computer.
score: 0
comment on: http://stackoverflow.com/q/29836498
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47785121
comment on: http://stackoverflow.com/q/29829116
has text: your `clearInterval()` clears the interval only when it has run for 20 times, independently from the fact that anything (a move) has happened.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47760197
has text: This condition: "RewriteCond %{REQUEST_FILENAME} !-f" must be protecting you from redirecting the files.
score: 0
comment on: http://stackoverflow.com/q/29816276
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29794051
linked to: http://stackoverflow.com/q/1584370
type: Question
has comment: http://stackoverflow.com/comment/47716337
tagged with: arrays
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29794744
has comment: http://stackoverflow.com/comment/47716440
answer count: 4
has comment: http://stackoverflow.com/comment/47716376
has answer: http://stackoverflow.com/a/29795223
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29794889
has title: Merge arrays in JS
downvote count: 1
has answer: http://stackoverflow.com/a/29794544
score: 1
has body: Suppose I have the following arrays: var first = [ { id: 1, name: 'first' }, { id: 2, name: 'second' }, { id: 3, name: 'third' } ] var second = [ { id: 2, field: 'foo2' }, { id: 3, field: 'foo3' }, { id: 4, field: 'foo4' } ] var third = [ { id: 2, data: 'some2' }, { id: 5, data: 'some5' }, { id: 6, data: 'some6' } ] I want to merge them to get the following result: var result = [ { id: 1, name: 'first', field: undefined, data: undefined }, { id: 2, name: 'second', field: 'foo2', data: 'some2' }, { id: 3, name: 'third', field: 'foo3', data: undefined }, { id: 4, name: undefined, field: 'foo4', data: undefined }, { id: 5, name: undefined, field: undefined, data: 'some5' }, { id: 6, name: undefined, field: undefined, data: 'some6' } ] How could I do it with JavaScript?
linked to: http://stackoverflow.com/q/16433605
has comment: http://stackoverflow.com/comment/47717277

http://stackoverflow.com/q/29815595
tagged with: ajax
has comment: http://stackoverflow.com/comment/47759728
score: 0
has answer: http://stackoverflow.com/a/29816273
type: UnansweredQuestion
type: Question
has body: I need to start the pace loader on when it enters a function and complete it when it exits the same function. I used the below code, which is not starting the loader. pace.start();
has comment: http://stackoverflow.com/comment/47760059
has title: Pacejs: Start the minify loader when it enters a function
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/47609022
type: Comment
has text: Sorry. StageTwo. Which called resetframe2 which called.... the problem is that broke everything as well. I've been trying to read on "closings" which sounds like it might be my issue but it's still a little above me
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29737918

http://stackoverflow.com/q/29795212
linked to: http://stackoverflow.com/q/24446281
tagged with: javascript
upvote count: 2
has title: AJAX Upload Web App
answer count: 1
has body: I need some assistance please. I am trying to create an ajax upload web app from scratch as a personal hobby. I was able to get the files to upload to my uploads folder successfully, but I just can't seem to get the uploaded links to appear under the upload box and stay there permanently even after refreshing the web page. I keep getting this error message in the google chrome browser console: Uncaught TypeError: Cannot read property 'length' of undefined and it is pointing me to this line in the index.php: for(x = 0; x < data.succeeded.length; x = x + 1) { Also the google chrome console is marking this as (anonymous function) in the upload.js file: o.options.finished(uploaded); I had used some youtube videos as a guide, but I just can't seem to figure it out. Kindly Help Me Please This is the index.php code and below is the upload.php code also the upload.js code. Uploader Upload files Uploaded file links will appear here. Upload.php code <?php header('Content-Type: application/json'); $uploaded = ''; $allowed = ''; $succedeed = ''; $failed = ''; if(!empty($_FILES['file'])) { foreach($_FILES['file']['name'] as $key => $name) { if($_FILES['file']['error'][$key] === 0) { $temp = $_FILES['file']['tmp_name'][$key]; $ext = explode('.', $name); $ext = strtolower(end($ext)); $file = md5_file($temp) . time() . '.' . $ext; if(move_uploaded_file($temp, "uploads/{$file}") === true) { $succedeed[] = array( 'name' => $name, 'file' => $file ); } else { $failed[] = array( 'name' => $name ); } } } if(!empty($_POST['ajax'])) { echo json_encode(array( 'succedeed' => $succedeed, 'failed' => $failed )); } } This is the upload.js code var app = app || {}; (function(o) { "use strict"; //Private methods var ajax, getFormData, setProgress; ajax = function(data) { var xmlhttp = new XMLHttpRequest(), uploaded; xmlhttp.addEventListener('readystatechange', function() { if(this.readyState === 4) { if(this.status === 200) { uploaded = JSON.parse(this.response); if(typeof o.options.finished === …
has comment: http://stackoverflow.com/comment/47720795
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47719907
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29796641
tagged with: php
has comment: http://stackoverflow.com/comment/47720460
has comment: http://stackoverflow.com/comment/47720653
score: 2
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/29796641
has comment: http://stackoverflow.com/comment/47719656
type: Question
has comment: http://stackoverflow.com/comment/47723501
has comment: http://stackoverflow.com/comment/47723049

http://stackoverflow.com/comment/47784046
has text: Yes they do have js enabled
score: 0
comment on: http://stackoverflow.com/q/29828831
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47585389
comment on: http://stackoverflow.com/q/29725377
has text: You have to put you code that uses `dataset` inside the csv callback function... where you have `console.log(rows)`
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/29792846
type: Question
tagged with: jqgrid
tagged with: javascript
has body: I am new to backgrid (and stackoverflow) and I am curious if there is any column chooser for backgrid so that user can choose what columns are to be visible in my grid. I know there is one for jqgrid which can be seen in action here: http://www.ok-soft-gmbh.com/jqGrid/SimpleLocalGridWithColumnChooser5.htm If there isn't any for backgrid, any ideas on how to implement this without reloading the grid again? One way it could be done but it requires a reload of grid like so, make the columns :renderable option as false , and not show the columns on initial load. User selects the columns which he wants to see , then reload the Grid with new column attributes for the selected columns with renderable:true like so: var grid = new Backgrid.Grid(columns: new Columns([{..renderable:true}, {...}], { })); But as you can see , I will be reloading the entire grid with the new columns though we already have this data in the DOM. I am looking forward to any ideas where in we can implement this without new Grid call
accepted answer: http://stackoverflow.com/a/29862042
score: 0
has title: Column Chooser in Backgrid
answer count: 1
tagged with: jquery
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/47718059
tagged with: backgrid
has answer: http://stackoverflow.com/a/29862042
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47716357

search-engine
type: Tag
tag name: search-engine
tags question: http://stackoverflow.com/q/29729473

http://stackoverflow.com/a/29737880
score: 0
type: Answer
has body: Bloodhound's datumTokenizer is configured wrong. It should be something like this datumTokenizer: Bloodhound.tokenizers.obj.whitespace("item_name"), datumTokenizer – A function with the signature (datum) that transforms a datum into an array of string tokens. Here is the reference and here is a DEMO Hope this helps
answers question: http://stackoverflow.com/q/29737777
accepted answer of: http://stackoverflow.com/q/29737777
type: AcceptedAnswer

http://stackoverflow.com/a/29743213
score: 0
answers question: http://stackoverflow.com/q/29743152
has body: yes you can do with the help of jQuery, by adding jQuery newClass if specified condition is true, and use jQuery removeClass vice-versa.
type: Answer

http://stackoverflow.com/a/29692196
downvote count: 0
type: Answer
upvote count: 1
score: 1
has body: Use QuerySelectorAll for that: document.querySelectorAll('[id^="view_"]').id; This will get all views that start with view_ See: Javascript getElementById base on partial string
has comment: http://stackoverflow.com/comment/47521678
answers question: http://stackoverflow.com/q/29692127

http://stackoverflow.com/q/29718660
type: UnansweredQuestion
score: 3
answer count: 0
upvote count: 3
type: Question
tagged with: firefox
tagged with: javascript
has body: I just started to work with meteor (1.1.0.2) and try to implement some drag and drop functionality. Basically what it should do: The user can drag video element from a sidebar to a contenteditable div. My problem is now that it is not working in firefox (v 37, OSX) but it is working in Chrome. Here is some Code: Template.single_video.events( { 'dragstart video': function(event) { var dt = event.originalEvent.dataTransfer; dt.effectAllowed = "copy"; dt.setData('text/html', event.currentTarget.outerHTML); return false; } }) &lt;template name="single_video"&gt; &lt;div class="col-xs-12"&gt; {{title}} &lt;video controls="" class="video-drag" draggable="true"&gt; {{#each sources}} &lt;source src="{{src}}" type="{{type}}"&gt; {{/each}} &lt;/video&gt; &lt;/div&gt; &lt;/template&gt; I always get the error: Error: Permission denied to access property "effectAllowed" So my question is: Is it a bug in FF or did I miss something? Thanks in advance for any help.
has title: dragstart event gives error: Permission denied to access property "effectAllowed"
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
tagged with: meteor
has comment: http://stackoverflow.com/comment/48297309
favorite count: 0
tagged with: drag-and-drop

http://stackoverflow.com/comment/47629860
score: 3
comment on: http://stackoverflow.com/q/29748722
has text: Create a factory to create instances which enables you track all instances that are created? http://en.wikipedia.org/wiki/Factory_method_pattern
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47668045
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29768587
has text: cross your fingers and give it a try :) I don't know your system but it looks like someone put raw php values in there.

http://stackoverflow.com/comment/47713391
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29792199
has text: @Roco The `Y` seems correct. See my update on the question.

http://stackoverflow.com/comment/47774559
comment on: http://stackoverflow.com/q/29824120
has text: [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) or iframes/frames
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/29807297
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29806276
answers question: http://stackoverflow.com/q/29806276
has comment: http://stackoverflow.com/comment/47743552
has body: The way I understand it, the V8 JavaScript engine compiles to machine code anyway so why not just do it beforehand? According to the W3C HTML5 Scripting specification, there's no standards-based reason why a browser couldn't support machine code with special type attributes (as Chrome does with the Dart language): The following lists the MIME type strings that user agents must recognize, and the languages to which they refer: "application/ecmascript" "application/javascript" ... User agents may support other MIME types for other languages... Currently, no browser has implemented such a feature. I suspect the primary shortcoming of such an approach is that each chip architecture would require a machine-code version of the script compiled for it specifically. This means that in order to support three architectures, a page would need to include a compiled script three times. (And it should be included a fourth time, as plain JavaScript, as a fallback for architectures that you didn't include, or for browsers that can't/don't support compiled code.) This could significantly bloat the size of the page with data that is mostly useless. The increase in load time would seem to significantly offset or completely outweigh whatever time you save on compilation. An architecture-independent compromise solution like bytecode seems pretty poor: you still need to include the script twice (once for the bytecode, once normally for scripts that don't support it) and you need to do some kind of run-time processing on the bytecode to turn it into machine code. The multiple-includes-with-fallback problem is exactly why other scripting languages have not made it into the Web environment: they would need coordinated cross-vendor support to be useful. Google is trying with Dart, but it remain to be seen what degree of success they see. Note that Chrome does cache compiled versions of scripts so a script only needs to be compiled once and then the compiled code is cached for reuse when the u…
score: 5
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47743495
upvote count: 5

http://stackoverflow.com/comment/47593677
has text: http://jsfiddle.net/mvx9dbyu/5/ - I am not sure scope.$apply failing or not, because I cannot open developer console on my ie 11.
score: 2
comment on: http://stackoverflow.com/q/29698836
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/138326984
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29815306
has text: [How can I scrape pages with dynamic content using node.js?](https://stackoverflow.com/questions/28739098/how-can-i-scrape-pages-with-dynamic-content-using-node-js)
type: Comment

http://stackoverflow.com/comment/47518505
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29690890
score: 0

http://stackoverflow.com/a/29779600
type: Answer
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29779546
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29779546
downvote count: 0
has body: You are pretty close, just refer to the element itself in the function. $("div").on("click", function(){ $(this).css("background-color","#DDDDDD"); } );

http://stackoverflow.com/a/30003470
has comment: http://stackoverflow.com/comment/96815655
type: AcceptedAnswer
downvote count: 0
has body: I can't claim credit for this, but incase you've stumbled upon this question and are looking for the answer here it is. Declare io as a global in the bootstrap: // test/boostrap.test.js var client = require('../assets/js/dependencies/sails.io.js'); global.io = new client(require('socket.io-client')); io.sails.url = 'http://localhost:1337/'; Then call them use them like so. //test/callbacks.test.js describe('socket request', function () { it ('passport-local authentication should succeed if email and password valid', function (done) { io.socket.post('/auth/local', { identifier: 'existing.user@email.com', password: 'admin1234' }, function (data, jwres) { assert.equal(jwres.statusCode, 200); done(); }); });
has comment: http://stackoverflow.com/comment/90075638
accepted answer of: http://stackoverflow.com/q/29810287
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29810287
score: 1
has comment: http://stackoverflow.com/comment/96783124

zingchart
type: Tag
tag name: zingchart
tags question: http://stackoverflow.com/q/29820671

http://stackoverflow.com/comment/107796744
type: AnswerComment
comment on: http://stackoverflow.com/a/56564489
score: 0
type: Comment
has text: There is a warning syntax error at or near \"\"7d\"\""

http://stackoverflow.com/comment/47813879
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29843847
has text: Is all this code really relevant to question?
score: 2

http://stackoverflow.com/a/45697974
upvote count: 4
downvote count: 0
has body: On Datatables 1.10 and up it's: $('#example').dataTable( { "language": { "info": "Showing page _PAGE_ of _PAGES_" } }); Here's the full documentation. As a bonus, if you want to tweak the length menu wording (i.e. show x entries) you do that like this: $('#example').dataTable( { "language": { "lengthMenu": "Display _MENU_ records" } }); and here's the documentation for that.
answers question: http://stackoverflow.com/q/29693127
score: 4
type: Answer

http://stackoverflow.com/comment/47659236
has text: Yes you can add any number of products, $product1 and $product2 were just examples, again you can use another array of products, i.e product = array(); and use array_push in every insertion of the product. And I have also used the delimiter "|" to separate each and every values in a product, you can use explode() function. i.e explode("|",$product);
comment on: http://stackoverflow.com/a/29763477
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47786046
comment on: http://stackoverflow.com/q/29829529
type: Comment
type: QuestionComment
score: 1
has text: Have you looked at using virtual scrolling? It would remove the rendering limitation and watch count issue. One example of an implementation can be found here: https://github.com/EnzeyNet/VirtualScroll

http://stackoverflow.com/comment/47755674
comment on: http://stackoverflow.com/q/29813830
score: 0
has text: So do you want it to display `'2015-04-22 19:18.43'` (i.e. UTC without the time zone) or `'2015-04-23 02:18:43'` (i.e. system time without the time zone)?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29787549
type: Question
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47721107
has comment: http://stackoverflow.com/comment/47709059
tagged with: google-chrome-extension
has body: I'm writing a chrome extension, and I need to get certain timeslices of a user's browsing history (the past week, month, and year). However, some unexpected history items are showing up, namely those that are older than the specified start date. For example, the definition I'm using of a week ago (ms since epoch) is: var microsecondsPerWeek = 1000 * 60 * 60 * 24 * 7; searchDepth = (new Date).getTime() - microsecondsPerWeek; I then perform the search like so: chrome.history.search({ 'text': '', // Return every history item... 'startTime': searchDepth // accessed less than x time ago. }, ... Console logging for the time values returned by this search shows some unexpected results. Namely, messages like this: Tue Apr 14 2015 21:31:52 GMT-0700 (PDT) Tue Apr 14 2015 21:30:26 GMT-0700 (PDT) Tue Jan 27 2015 12:55:15 GMT-0800 (PST) Fri Mar 20 2015 12:17:55 GMT-0700 (PDT) Sat Apr 11 2015 19:50:27 GMT-0700 (PDT) As of the time of this question, one week ago was April 14th. So my question is, why am I seeing returned results for January 27th, March 20th, and April 11th? It seems strange, since most of the search code I'm using is pulled from a Google example of the History API. Any ideas? I'm probably missing something obvious, but I can't make it out.
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: google-chrome
has title: Chrome history Api returning unexpected results
score: 2
has comment: http://stackoverflow.com/comment/47730063

http://stackoverflow.com/comment/47618083
type: QuestionComment
has text: The classic case of loop variable under closure.
comment on: http://stackoverflow.com/q/29742508
score: 4
type: Comment

http://stackoverflow.com/comment/47590925
type: AnswerComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/75632/discussion-between-redrif-and-gops-ab).
type: Comment
comment on: http://stackoverflow.com/a/29728362
score: 0

http://stackoverflow.com/a/36632152
score: 0
has body: Typescript version of this is: beforeEach(this.module(function ($urlRouterProvider: angular.ui.IUrlRouterProvider) { $urlRouterProvider.deferIntercept(); })); The "this." in front of moduleis required. It also must come before any beforeEach(inject( lines.
type: Answer
answers question: http://stackoverflow.com/q/29809436

http://stackoverflow.com/comment/47531310
score: 7
comment on: http://stackoverflow.com/q/29697654
type: Comment
type: QuestionComment
has text: `i am saving due date to db by varchar(50)` Why not save it as a date?

http://stackoverflow.com/q/29788364
has answer: http://stackoverflow.com/a/29788431
tagged with: java
has answer: http://stackoverflow.com/a/29788471
has answer: http://stackoverflow.com/a/29788418
type: Question
possible better answer: http://stackoverflow.com/a/29788431
has body: I am trying to make a button link to a View class that i have made called drawing view the only problem is the app crashes and i get errors in logcat. If anyone has any helpful information on this problem i would appreciate it. Here is my code for the Main.class public class Main extends Activity { DrawingView v; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //this.requestWindowFeature(Window.FEATURE_NO_TITLE); //this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); //LinearLayout layout1 = new LinearLayout (this); //FrameLayout game = new FrameLayout(this); //final DrawingView s = new DrawingView (this); //TextView myText = new TextView(this); Button startButton = (Button) findViewById(R.id.startbutton); //redCircle.setWidth(300); //redCircle.setText("niggers"); setContentView(R.layout.main); //layout1.addView(myText); //layout1.addView(redCircle); //redCircle.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); //game.addView(myText); //game.addView(v); //game.addView(layout1); //setContentView(R.layout.main); //setContentView(v); startButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Intent i = new Intent(Main.this, DrawingView.class); startActivity(i); } }); } @Override public boolean onCreateOptionsMenu(Menu menu){ getMenuInflater().inflate(R.menu.main, menu); return true; } } and here is the logcat errors 04-22 05:12:21.693: E/AndroidRuntime(1921): FATAL EXCEPTION: main 04-22 05:12:21.693: E/AndroidRuntime(1921): Process: com.Tripps.thesimplegame, PID: 1921 04-22 05:12:21.693: E/AndroidRuntime(1921): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.Tripps.thesimplegame/com.Tripps.thesimplegame.Main}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(and…
tagged with: button
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
tagged with: android
has comment: http://stackoverflow.com/comment/47706048
accepted answer: http://stackoverflow.com/a/29788418
has title: Getting a setOnClickListener error when I try to run this app
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47706699

http://stackoverflow.com/a/29852226
has body: SOLVED The clue is in the error: XMLHttpRequest cannot load localhost:4000/fighters.json. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.b In your Angular, the line return $resource("localhost:4000/fighters/:fighterId", thinks you're referring to a URL with protocol "localhost:". It should be an absolute HTTP URL: return $resource("http://localhost:4000/fighters/:fighterId", With the correct CORS support you already have, that works.
answers question: http://stackoverflow.com/q/29839622
upvote count: 9
score: 9
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47828101
score: 0
type: AnswerComment
type: Comment
has text: Great analysis! Thank you for your time (Y)
comment on: http://stackoverflow.com/a/29846070

ajax
tags question: http://stackoverflow.com/q/29794118
tags question: http://stackoverflow.com/q/29705649
tags question: http://stackoverflow.com/q/29718750
tags question: http://stackoverflow.com/q/29833901
tags question: http://stackoverflow.com/q/29688347
tags question: http://stackoverflow.com/q/29793793
tags question: http://stackoverflow.com/q/29690726
tags question: http://stackoverflow.com/q/29844976
tags question: http://stackoverflow.com/q/29843807
tags question: http://stackoverflow.com/q/29751272
tags question: http://stackoverflow.com/q/29744200
tags question: http://stackoverflow.com/q/29805916
tags question: http://stackoverflow.com/q/29708075
tags question: http://stackoverflow.com/q/29700287
tags question: http://stackoverflow.com/q/29688459
tags question: http://stackoverflow.com/q/29829865
tags question: http://stackoverflow.com/q/29784975
tags question: http://stackoverflow.com/q/29817111
tags question: http://stackoverflow.com/q/29736603
tags question: http://stackoverflow.com/q/29804178
tags question: http://stackoverflow.com/q/29764767
tags question: http://stackoverflow.com/q/29743459
tags question: http://stackoverflow.com/q/29836385
tags question: http://stackoverflow.com/q/29844941
tags question: http://stackoverflow.com/q/29707818
tags question: http://stackoverflow.com/q/29764254
tags question: http://stackoverflow.com/q/29696746
tags question: http://stackoverflow.com/q/29701819
tags question: http://stackoverflow.com/q/29718849
tags question: http://stackoverflow.com/q/29717023
tags question: http://stackoverflow.com/q/29732746
tags question: http://stackoverflow.com/q/29697082
tags question: http://stackoverflow.com/q/29775303
tags question: http://stackoverflow.com/q/29813209
tags question: http://stackoverflow.com/q/29797359
tags question: http://stackoverflow.com/q/29816459
tags question: http://stackoverflow.com/q/29736683
tags question: http://stackoverflow.com/q/29754977
tags question: http://stackoverflow.com/q/29739671
tags question: http://stackoverflow.com/q/29694300
tags question: http://stackoverflow.com/q/29733308
tags question: http://stackoverflow.com/q/29775348
tags question: http://stackoverflow.com/q/29810100
tags question: http://stackoverflow.com/q/29731956
tags question: http://stackoverflow.com/q/29763199
tags question: http://stackoverflow.com/q/29844796
tags question: http://stackoverflow.com/q/29727039
tags question: http://stackoverflow.com/q/29813879
tags question: http://stackoverflow.com/q/29768413
tags question: http://stackoverflow.com/q/29808484
tags question: http://stackoverflow.com/q/29734036
tags question: http://stackoverflow.com/q/29725545
tags question: http://stackoverflow.com/q/29775748
tags question: http://stackoverflow.com/q/29814614
tags question: http://stackoverflow.com/q/29794536
tags question: http://stackoverflow.com/q/29752530
tags question: http://stackoverflow.com/q/29716227
tags question: http://stackoverflow.com/q/29807346
tags question: http://stackoverflow.com/q/29762709
tags question: http://stackoverflow.com/q/29724443
tags question: http://stackoverflow.com/q/29816137
tags question: http://stackoverflow.com/q/29715696
tags question: http://stackoverflow.com/q/29759591
tags question: http://stackoverflow.com/q/29723201
tags question: http://stackoverflow.com/q/29764712
tags question: http://stackoverflow.com/q/29785622
type: Tag
tags question: http://stackoverflow.com/q/29725687
tags question: http://stackoverflow.com/q/29723322
tags question: http://stackoverflow.com/q/29694571
tags question: http://stackoverflow.com/q/29830121
tags question: http://stackoverflow.com/q/29722215
tags question: http://stackoverflow.com/q/29710266
tags question: http://stackoverflow.com/q/29797316
tags question: http://stackoverflow.com/q/29780264
tags question: http://stackoverflow.com/q/29771030
tags question: http://stackoverflow.com/q/29830098
tags question: http://stackoverflow.com/q/29706336
tags question: http://stackoverflow.com/q/29812980
tags question: http://stackoverflow.com/q/29747118

http://stackoverflow.com/a/29811245
has comment: http://stackoverflow.com/comment/47750693
has comment: http://stackoverflow.com/comment/47750634
has comment: http://stackoverflow.com/comment/47750583
has comment: http://stackoverflow.com/comment/47750802
has comment: http://stackoverflow.com/comment/47750513
score: 0
has comment: http://stackoverflow.com/comment/47750745
answers question: http://stackoverflow.com/q/29811178
has body: You can write a CSS rule that looks for the role attribute, for example: [role=alter] { color: red; } I am altered I am not altered Reference: http://www.w3.org/TR/css3-selectors/#attribute-selectors
type: Answer

http://stackoverflow.com/a/29806546
has comment: http://stackoverflow.com/comment/47743160
downvote count: 0
has comment: http://stackoverflow.com/comment/47741504
has body: You can make it even slower, 'mouseout #dropdown_library_menu': function(ev){ ev.preventDefault(); $('#dropdown_library_menu').slideUp(3000); // Slide up in 3 seconds, }
has comment: http://stackoverflow.com/comment/47741125
score: 3
answers question: http://stackoverflow.com/q/29806453
upvote count: 3
has comment: http://stackoverflow.com/comment/47743034
type: Answer

http://stackoverflow.com/q/29730361
has comment: http://stackoverflow.com/comment/47598373
has title: Angular controller as vm not available in $resource.$save callback function, only $scope
downvote count: 0
answer count: 0
score: 1
tagged with: angularjs-controller
tagged with: angularjs-resource
type: Question
tagged with: javascript
tagged with: angularjs-scope
upvote count: 1
has comment: http://stackoverflow.com/comment/47599310
favorite count: 0
tagged with: angularjs
has body: I am having an issue in AngularJS when not wanting to use $scope but a controller instead in a callback function passed to $resource.$save() as parameter. The controller code is shown below. This code won't work as vm is undefined in the $save function's anonymous callback function. This is what I don't understand. As you can see, there are 3 lines commented out which start with $scope.groupuploader... If I uncomment these lines and comment out the 3 lines starting with vm.groupuploader... then it does work as intended. The flow object, by the way, stems from ng-flow, an image upload library we are using. Obviously, using $scope instead of vm works. But as we are trying not to use $scope anywhere we are trying to use vm instead also here. Anyone any explanation of proposal how to solve this? Thanks very much in advance and best regards Sebastian Angular Controller code: angular.module('xyz') .controller('CreategroupController', CreategroupController); function CreategroupController($scope, $location, BaseUrl, UserService, GroupResource) { var vm = this; vm.groupName = ''; vm.groupDescription = ''; vm.groupImageUrl = 'http://localhost:3000/assets/images/add_group_image_wide.png'; // this does not work vm.groupuploader = {}; // this does work //$scope.groupuploader = {}; vm.create = function () { if (!vm.groupName) { return; } var newGroup = new GroupResource({name: vm.groupName, description: vm.groupDescription}); newGroup.$save(function(newGroup) { // this does not work vm.groupuploader.flow.opts.target = BaseUrl.url + '/service/group/' + newGroup.id + '/image' + '?X-AUTH-TOKEN=' + UserService.retrieve(); vm.groupuploader.flow.upload(); // this does work //$scope.groupuploader.flow.opts.target = BaseUrl.url + '/service/group/' + newGroup.id + '/image' + '?X-AUTH-TOKEN=' + UserService.retrieve(); //$scope.groupuploader.flow.upload(); $location.path('/group/' + newGroup.id + '/addmembers'); }); }; }
type: UnansweredQuestion

http://stackoverflow.com/q/29805476
answer count: 3
has body: I'm trying to write a new plugin that can be initialized on multiple elements within the same page, each time with different options, ex: $('#id').plugin({ option:true }); $('#id2').plugin({ option:false }); I'm using the boilerplate from jqueryboilerplate.com (https://github.com/jquery-boilerplate/jquery-boilerplate). I understand (at least I think I do!) that the problem is that within the scope of the anonymous function (here, within setTimeout) 'this' refers to the window. So in the following, the output is logged the first time, but not the second: // Avoid Plugin.prototype conflicts $.extend(Plugin.prototype, { init: function () { console.log(this.settings.propertyName); setTimeout(function(){ console.log(this.settings.propertyName); }, 1000); } }); Elsewhere this.settings.propertyName is set to 'value'. Console.log result is: value Uncaught TypeError: Cannot read property 'propertyName' of undefined If for example I set window.prop = this.settings.propertyName and console.log window.prop instead, that works, but the problem is that there may be many instances running at the same time. I've read through lots of questions related to this subject, but none seem to actually address this particular situation. I would be grateful if someone could give me a clear example of how to do this within the context of a jQuery plugin using the boilerplate, or something like it. Please excuse my noobness, thank you!!
tagged with: javascript
tagged with: jquery
tagged with: jquery-plugins
has answer: http://stackoverflow.com/a/29805700
type: AnsweredQuestion
has title: jQuery multiple instance plugin using "this" in setTimeout
has answer: http://stackoverflow.com/a/29805637
possible better answer: http://stackoverflow.com/a/29805700
type: Question
has answer: http://stackoverflow.com/a/29805723
score: 0
accepted answer: http://stackoverflow.com/a/29805637

http://stackoverflow.com/a/29769932
type: Answer
has body: This will work, Just copy paste the complete code.
answers question: http://stackoverflow.com/q/29769681
score: 0

http://stackoverflow.com/q/29731448
has answer: http://stackoverflow.com/a/29731585
type: Question
possible better answer: http://stackoverflow.com/a/29731535
has comment: http://stackoverflow.com/comment/47597683
has answer: http://stackoverflow.com/a/29734957
tagged with: javascript
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47596104
accepted answer: http://stackoverflow.com/a/29734957
has body: I have the following code (Javascript and HTML): Welcome! What's your name? How are you today, ? Basically in the first form, the user enters there name, then hits submit and a Javascript confirmation appears, saying 'How are you today, ' + name + '?' When they click ok to that prompt, how do I make the form 'welcomehowareyou' appear (not in an alert)? One more thing, where it says 'How are you today, ?' how do I make the name appear there which the user entered in the form 'welcomename'?
has title: Javascript Make Form Appear
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29731535

http://stackoverflow.com/q/29820240
has body: Am trying to detect the pinch event using Hammer.js and the touch emulator in Chrome on desktop. Can detect pan and tap no problem but pinch doesn't seem to be responding. Have modified sample code on codepen here: http://codepen.io/anon/pen/NqWymK In case you aren't familiar with the touch-emulator the pinch event should be simulated by holding shift and clicking and dragging mouse. (HTML) &lt;script src="http://cdn.rawgit.com/hammerjs/touchemulator/master/touch-emulator.js"&gt;&lt;/script&gt; &lt;script&gt; TouchEmulator(); &lt;/script&gt; &lt;script src="https://hammerjs.github.io/dist/hammer.js"&gt;&lt;/script&gt; &lt;div id="myElement"&gt;&lt;/div&gt; (CSS) #myElement { background: silver; height: 300px; text-align: center; font: 30px/300px Helvetica, Arial, sans-serif; } (JS) var myElement = document.getElementById('myElement'); // create a simple instance // by default, it only adds horizontal recognizers var mc = new Hammer(myElement); // listen to events... mc.on("pinch pan tap", function(ev) { myElement.textContent = ev.type +" gesture detected."; }); Any ideas? Thanks
has answer: http://stackoverflow.com/a/29821060
type: Question
accepted answer: http://stackoverflow.com/a/29821060
tagged with: javascript
score: 4
possible better answer: http://stackoverflow.com/a/40908502
tagged with: hammer.js
answer count: 2
has answer: http://stackoverflow.com/a/40908502
favorite count: 0
has title: Pinch event with Hammer.js and touch-emulator
tagged with: multi-touch
upvote count: 4
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/47634594
type: AnswerComment
has text: Thank you but i must use back ground image instead of image tag because in the wrapper, i use other plugin that can only run perfectly with wrapper background image. On the other hand, fadeIn and fadeOut function of jquery does not suit the request of my mentor. He want something like this: http://www.aaronvanderzwan.com/maximage/examples/basic.html (no white flash after fadeOut)
type: Comment
comment on: http://stackoverflow.com/a/29750718
score: 0

http://stackoverflow.com/a/29704701
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29704637
type: Answer
answers question: http://stackoverflow.com/q/29704637
score: 1
upvote count: 1
has body: If you can't add a specific id or class to the link, you can use nth-child: .containerclass a:nth-child(5) { background-color: green; }

http://stackoverflow.com/q/29753641
favorite count: 0
upvote count: 1
has title: Make Meteor Reactive to Specific Subitem of Meteor.user()
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29753793
has answer: http://stackoverflow.com/a/29753954
type: Question
tagged with: mongodb
has answer: http://stackoverflow.com/a/76970956
possible better answer: http://stackoverflow.com/a/29753954
tagged with: javascript
has body: What I'm Trying to Do... I need to use some subproperties which are stored in the user's Meteor.user() object, such as Meteor.user().profile.preferences.preference_one, Meteor.user().profile.preferences.preference_two, et cetera. These subproperties are being used inside reactive autorun blocks because there are recalculations that must be done anytime they change. My Problem Is... I've discovered that when I refer to the value of these subproperties from within a reactive block, then the autorun is fired for any change to the Meteor.user() object, including changes which do not affect in any way the data that I am explicitly referencing. For example, if Meteor.user().profile.name is updated, then any autorun that includes Meteor.user().profile.preferences.preference_one or Meteor.user().profile.preferences.preference_two gets fired as well, because they all have a common parent. I have seen a similar question dealing with limiting the scope of Meteor's reactivity, but it deals with a custom collection, not the Meteor.users collection. I cannot see how the solution there could be made applicable because they are specifying fields in subscriptions to limit what subproperties are published to the client, and in my case, I need all the subproperties of Meteor.user(). But I need to be able to choose which subproperties I am reacting to! Storing subproperty values locally and then comparing on every change would of course work, but it is a brute force solution solution in that it requires extra logic and that the autoruns will all be firing anyway.
accepted answer: http://stackoverflow.com/a/29753793
answer count: 3
downvote count: 0
linked to: http://stackoverflow.com/q/15324350
tagged with: meteor

http://stackoverflow.com/a/29759742
type: Answer
score: 0
has body: There are many reasons why your page is slow to load. You should first investigate what causes the slowness, before finding a workaround. Based on just your code, I would speculate that the number of movimentacoes may be too large to show on a single page. If that is true, you can solve it by reading only a small page of the available data (enough to show on a single screen) and use paging to page through the data.
accepted answer of: http://stackoverflow.com/q/29759239
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29759239

http://stackoverflow.com/q/29744608
has answer: http://stackoverflow.com/a/29744682
has answer: http://stackoverflow.com/a/29744725
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29745029
accepted answer: http://stackoverflow.com/a/29745029
has comment: http://stackoverflow.com/comment/47621857
has comment: http://stackoverflow.com/comment/47622220
linked to: http://stackoverflow.com/q/10503606
type: Question
has body: I want to be able to keep chat text to be always scrolled to the bottom of the chat. I have looked at many tutorials and tried many examples from stack overflow but none of them worked. Currently my chat text keeps on going out of the textarea when there is too many lines, even so i have overflow:hidden. I also want the textarea to only load last 50 entries from the database so that when users join they will not have to load everything that is said in the chat. Any Idea how to do those 2 things? home <?php session_start(); ?> Chat Home Welcome <?php echo $_SESSION['UserName'] ; ?> Css #ChatBig { width: 60%; height: 600px; margin: auto; background-color: white; overflow:hidden; resize:none; } #ChatMessages{ width: 100%; height: 548px; border: 1px solid #000; font-size: 16px; font-weight: normal; overflow:hidden; resize:none; } #ChatText{ width: 100%; height: 50px; border: 1px solid #000; overflow:hidden; resize:none; } #ChatText:focus{outline: none;} body { background-color: lightgray; } #Holder { width: 100%; } .UserNameS{ color: #7CB9E8; } .UserNameS:hover{text-decoration:underline; cursor: pointer;} Image of how the site looks http://gyazo.com/fe71d7d9699b9784fda5ba1c862fad53
has title: Chat text auto scroll down and information load from database
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29744682
tagged with: css

http://stackoverflow.com/q/29724270
downvote count: 0
answer count: 0
has comment: http://stackoverflow.com/comment/47653541
type: UnansweredQuestion
tagged with: php
type: Question
score: 3
has comment: http://stackoverflow.com/comment/74068818
tagged with: behat
linked to: http://stackoverflow.com/q/24930276
has title: How can I test file downloads with Behat 3 when using FileSaver.js?
has body: I'm developing some Behat 3 (with Selenium 2) tests for a site that uses FileSaver.js to convert some DOM elements into an XML file for download. (I can't change that bit, so don't ask.) When I click a button, JavaScript fires that passes the data blob into FileSaver.js, which converts that to an actual file and activates your browser's usual file download dialog. From there, the user clicks ok and says where to save the file. I would like to test this process, but I can't figure out how to actually click that OK button or select where to save the file. I'm fairly new to Behat, but the closest I could find to this is another SO question that deals with a file download (How to test file download in Behat), but because this blob file is created on the fly, I can't just use Guzzle to pull the file from the server. Any suggestions?
tagged with: javascript
favorite count: 0
upvote count: 3
has comment: http://stackoverflow.com/comment/74162790
has comment: http://stackoverflow.com/comment/47583621
tagged with: selenium-webdriver

http://stackoverflow.com/q/29743932
has body: I am trying to add two classes to the body element using jQuery. The first would take the URL and add it to the body element. The code I have truncates the class to the first 5 characters. However, I would like it to be the entire url (not including the extension) such that a file named new_page.html would add class="new_page"and this-is-another-new_page.php would add class="this-is-another-new_page". var newClass = window.location.href; newClass = newClass.substring(newClass.lastIndexOf('/')+1, 5); $('body').addClass(newClass); The second class I would like to add is a detection of the viewport height that would add a class of short or tall based on the viewport height. In this case, I want to add a class that detects is the viewport height is less than 768 and adds the class short or greater than or equal to 768 and add a class of tall. Any advice would be appreciated.
tagged with: viewport
has comment: http://stackoverflow.com/comment/47620675
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29743988
upvote count: 2
tagged with: css
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/29743988
type: Question
has title: Add class to body element based on viewport height
tagged with: javascript

http://stackoverflow.com/q/29762086
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29770999
has body: I have a page which lists numerous types of 'tiles' (&lt;div&gt;'s) in a main content area and a header which has a list of links which acts as filters. E.g. In the header area, click the 'pdf' filter link - only tiles which have ng-show="showFiles['pdf'] will be shown. If 'video' is clicked, tiles with ng-show="showFiles['video'] will show and so on.. The header template is controlled by hdrController and the tiles by pageController. Initially, when the view loads the $scope variable showFiles in pageController receives an object from a service Tweaks which sets all items to true (thus showing all tiles at start up): testApp.controller('pageController', ['$scope', 'Tweaks', function($scope, Tweaks){ $scope.showFiles = Tweaks.tagFilters('all'); }]); testApp.factory('Tweaks', function(){ var tweaksFactory = {}; var obj = {}; tweaksFactory.tagFilters = function(filter) { if(filter == 'all') { obj = { 'video' : true, 'pdf' : true, 'doc' : true }; } else { obj = { 'video' : false, 'pdf' : false, 'doc' : false }; } return obj; }; return tweaksFactory; }); Question: When clicking the filter links, a directive is applied which detects clicks - this then needs to update $scope.showFiles to show only tiles which are of the specific filter type. See Plunkr - The $scope of pageController which contains the showFiles object doesn't update, so the changes aren't reflected. Can someone offer any suggestions? I'm new to Angular - is this approach the best way to achieve the result?
type: AnsweredQuestion
has title: Updating $scope from another controller using a directive
type: Question
has answer: http://stackoverflow.com/a/29767157
tagged with: javascript
has answer: http://stackoverflow.com/a/29770999
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/29767157

http://stackoverflow.com/q/29718833
has comment: http://stackoverflow.com/comment/97149871
has comment: http://stackoverflow.com/comment/47572487
has answer: http://stackoverflow.com/a/70422781
has comment: http://stackoverflow.com/comment/47572232
has body: I want to execute the window onscroll event, but I don't know why it doesn't work on all browsers(firefox, chrome, etc), and there is no errors occurred. Full code: var elem = document.getElementById('repeat'); var show = document.getElementById('show'); for (i = 1; i <= 300; i++) { elem.innerHTML += i + " "; } window.onscroll = function () { show.innerHTML = document.body.scrollTop; }; #show { display:block; position:fixed; top:0px; left:300px; } x Also jsfiddle: http://jsfiddle.net/sqo0140j What is the problem ?
favorite count: 0
has comment: http://stackoverflow.com/comment/47572731
has comment: http://stackoverflow.com/comment/47572718
has answer: http://stackoverflow.com/a/29719278
has comment: http://stackoverflow.com/comment/47572140
tagged with: events
has comment: http://stackoverflow.com/comment/47572630
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/61341078
has answer: http://stackoverflow.com/a/70184766
has comment: http://stackoverflow.com/comment/47572454
has title: Why window onscroll event does not work?
has comment: http://stackoverflow.com/comment/47572339
score: 11
has answer: http://stackoverflow.com/a/46479155
downvote count: 1
has answer: http://stackoverflow.com/a/42060140
has comment: http://stackoverflow.com/comment/47572578
type: Question
tagged with: onscroll
accepted answer: http://stackoverflow.com/a/29719278
upvote count: 12
tagged with: javascript
possible better answer: http://stackoverflow.com/a/42060140
answer count: 6
has comment: http://stackoverflow.com/comment/47572701

http://stackoverflow.com/comment/47705912
comment on: http://stackoverflow.com/a/29788169
score: 0
type: Comment
has text: syms solutions seems to be simplest one I guess, what you say
type: AnswerComment

http://stackoverflow.com/a/29822777
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29822707
type: Answer
answers question: http://stackoverflow.com/q/29822707
has body: Replace $(".product_class_entry_"+this.commentId).remove(); By $(".product_class_entry_"+id).remove(); Explanation: this.commentId does not make any sense. You might be referring it from the AJAX request. But, we have it as function argument, so, rather than making it complex, simply use id.
score: 0

http://stackoverflow.com/a/74094146
score: 9
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29775797
upvote count: 9
has body: **//POST a request** const createTodo = async (todo) => { let options = { method: "POST", headers: { "Content-Type":"application/json", }, body: JSON.stringify(todo) } let p = await fetch("https://jsonplaceholder.typicode.com/posts", options); let response = await p.json(); return response; } **//GET request** const getTodo = async (id) => { let response = await fetch('https://jsonplaceholder.typicode.com/posts/' + id); let r = await response.json(); return r; } const mainFunc = async () => { let todo = { title: "milan7", body: "dai7", userID: 101 } let todor = await createTodo(todo); console.log(todor); console.log(await getTodo(5)); } mainFunc()

http://stackoverflow.com/comment/47922203
has text: Thanks Ethan, but unfortunately I can't. I'm still working on this
score: 0
comment on: http://stackoverflow.com/q/29809511
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47811206
type: Comment
comment on: http://stackoverflow.com/a/29842506
has text: The logic is correct, but `{{id}}` should hold a prefix and not a number alone, the risk of conflict will be high otherwise.
type: AnswerComment
score: 0

http://stackoverflow.com/a/29688850
downvote count: 0
has comment: http://stackoverflow.com/comment/47514830
has comment: http://stackoverflow.com/comment/47514864
type: Answer
answers question: http://stackoverflow.com/q/29688718
has comment: http://stackoverflow.com/comment/47514757
score: 1
has body: Try using the Math.random() command. It generates a random number. Using the Math.Random command, a random number will display when the button is clicked! Try it To make it between 1 and 25 just multiply the result of myFunction() by 25.
upvote count: 1

http://stackoverflow.com/q/29702511
linked to: http://stackoverflow.com/q/9468055
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47540789
score: 0
accepted answer: http://stackoverflow.com/a/29702968
has comment: http://stackoverflow.com/comment/47540932
has comment: http://stackoverflow.com/comment/47541388
type: Question
has comment: http://stackoverflow.com/comment/47541394
tagged with: javascript
has comment: http://stackoverflow.com/comment/47541499
has comment: http://stackoverflow.com/comment/47541953
has comment: http://stackoverflow.com/comment/47541132
has comment: http://stackoverflow.com/comment/47541929
answer count: 1
has body: I have a javascript function that loos like this : var usedNums= new Array(76); function setSquare(thisSquare) { var currSquare = "square"+ thisSquare; var colPlace = new Array(0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4); var colBasis = colPlace[thisSquare] * 15; var newNum; do{ newNum = colBasis + getNewNum() + 1; }while(usedNums[newNum]); //UnCaught TypeError here usedNums[newNum] = true; document.getElementById(currSquare).innerHTML = newNum; } The error says: Can not read property '5' of undefined. I have checked using console.log statement and all the variables above are getting expected values . I understand what Type Error is but not sure where is it breaking. **Edit:**Here is the complete Script: window.onload = new newCard; var usedNums= new Array(76); function newCard() { if(document.getElementById){ for(var i =0; i&lt;24;i++) { console.log("Value of I is " + i); setSquare(i); } }else{ alert("Sorry, your browser does not support this script"); } } function setSquare(thisSquare) { console.log("thissquare" + thisSquare); var currSquare = "square"+ thisSquare; console.log("currsquare" + currSquare); var colPlace = new Array(0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4); console.log("colplace" + colPlace); var colBasis = colPlace[thisSquare] * 15; console.log("colbasis"+ colBasis); var newNum; do{ newNum = colBasis + getNewNum() + 1; console.log("new nUM" + newNum); }while(usedNums[newNum]); usedNums[newNum] = true; document.getElementById(currSquare).innerHTML = newNum; } function getNewNum() { var a = Math.floor(Math.random() * 15); console.log("random number" + a); return a; }
has answer: http://stackoverflow.com/a/29702968
has comment: http://stackoverflow.com/comment/47541251
has comment: http://stackoverflow.com/comment/47541410
has title: Type Error in javascript: Cannot read Property of undefined
has comment: http://stackoverflow.com/comment/47541233

http://stackoverflow.com/comment/47631884
type: Comment
has text: If you copied my code literally, it's because I left it out as it wasn't really relevant to the question and would have made the example less clear. If you didn't, then I don't know; is there an error? What does your code look like?...
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29739615

http://stackoverflow.com/a/57301820
has body: Note that PaperJS has three different kinds of Rectangles: Rectangle — This is the basic type (data structure) that defines a rectangle. Basically, top-left point, width, and height. (Nothing is displayed on the screen.) This kind of rectangle can be resized by setting its size property, for instance: let rect; const originalSize = [50, 50]; const newSize = [100, 100]; rect = new Rectangle([10, 50], originalSize); rect.size = newSize; Path.Rectangle — This is a method for generating a list of Segments that make up a rectangular-shaped Path. This does get displayed, but a Path lacks methods associated with a rectangle. For instance, a Path.Rectangle has no size property (so trying to modify it has no effect). To resize a Path you can use the scale() method as another answer proposes, or modify its Segments: rect = new Path.Rectangle([210, 50], originalSize); rect.strokeColor = "red"; rect.strokeWidth = 3; rect.segments[0].point = rect.segments[0].point.add([-25, 25]); // lower left point rect.segments[1].point = rect.segments[1].point.add([-25, -25]); // upper left point rect.segments[2].point = rect.segments[2].point.add([25, -25]); // upper right point rect.segments[3].point = rect.segments[3].point.add([25, 25]); // lower right point Shape.Rectangle — This kind of rectangle gets displayed and exposes properties about its shape, such as size. To resize a Shape.Rectangle you can modify its size property directly: rect = new Shape.Rectangle([410, 50], originalSize) rect.strokeColor = "blue" rect.strokeWidth = 3 rect.size = newSize Most likely, if you want to draw a rectangle and modify its properties after the fact, the rectangle you are looking for is Shape.Rectangle. Here is a <a href="http://sketch.paperjs.org/#V/0.12.3/S/fVRdb6MwEPwrK989gEQoOM1LTml1uj9wuj7cA0Sqg5cPhdrIEEW9KP/91hYtEEjzgJLd8czOesiFKfGGbMtejthlJQtYpqX9nZ9U1lVagTTi/AezzjP0CCDTtTY+XFIF9DGwA4Vn+C26MrQooYoaHdTvEWHbGX3EX/Ycod35aetvJbuSWuuPshRt+dMY8U7FJI4CeNz/SNU1VanSpioqJeqX6h/22varl2wIton2PgGpOGvHEfXp4Q…
has comment: http://stackoverflow.com/comment/103501059
upvote count: 18
type: Answer
answers question: http://stackoverflow.com/q/29761368
downvote count: 0
score: 18

http://stackoverflow.com/comment/47738342
has text: Could you log the name and post what the output is?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29805277

http://stackoverflow.com/q/29751272
accepted answer: http://stackoverflow.com/a/29751689
tagged with: javascript
tagged with: forms
score: 5
answer count: 1
has answer: http://stackoverflow.com/a/29751689
tagged with: jquery
favorite count: 0
tagged with: ajax
upvote count: 5
tagged with: php
has body: I am using Jquery validation plugin to validate form, I need to display success/error message after submission without reloading page. But everytime I submit form, page reloads. Also even when data appears on database, "error" alert keeps coming. index.php &lt;?php function register() { $name = $_POST['name']; $mail = $_POST['email']; $query = "INSERT INTO table_name (name,email) VALUES ('$name','$email')"; $data = mysql_query($query)or die(mysql_error()); echo json_encode($data); } if(isset($_POST['submit'])) { register(); } ?&gt; Javascript code: $("#myform").validate({ //rules, messages go here submitHandler: function(event) { $.ajax({ url: "index.php", type: "POST", data: $(#myform).serialize(), dataType: 'json', success: function() { alert("Thank you!"); }, error: function() { alert("Error. Try again please!"); } }); event.preventDefault(); } });
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47634763
downvote count: 0
has comment: http://stackoverflow.com/comment/47635066
has comment: http://stackoverflow.com/comment/47635289
has title: Ajax form submission with Jquery validation plugin is not working
type: Question

http://stackoverflow.com/comment/47646384
type: Comment
type: QuestionComment
has text: http://jsfiddle.net/naaarcnk/1/ it has to be a post, and it has to have data such as in the mootools example.
score: 1
comment on: http://stackoverflow.com/q/29757000

http://stackoverflow.com/comment/47650422
comment on: http://stackoverflow.com/a/29754507
score: 0
type: AnswerComment
type: Comment
has text: Perhaps i misunderstood your question, what do you mean by "an object that doesn't even have time information" and what time calculation issues are you trying to avoid? i thought you just wanted to display the client's localDate, with timezone consideration, and that's done by the moment() function by default

http://stackoverflow.com/q/29785294
linked to: http://stackoverflow.com/q/6212305
has comment: http://stackoverflow.com/comment/47700504
has answer: http://stackoverflow.com/a/29785510
linked to: http://stackoverflow.com/q/1322732
type: UnansweredQuestion
downvote count: 3
has comment: http://stackoverflow.com/comment/47700429
upvote count: 21
type: Question
has body: I have two variables called 'startTime' and 'endTime'. I need to know whether current time falls between startTime and EndTime. How would I do this using JavaScript only? var startTime = '15:10:10'; var endTime = '22:30:00'; var currentDateTime = new Date(); //is current Time between startTime and endTime ??? UPDATE 1: I was able to get this using following code. You can check out the code at: https://jsfiddle.net/sun21170/d3sdxwpb/1/ var dt = new Date();//current Date that gives us current Time also var startTime = '03:30:20'; var endTime = '23:50:10'; var s = startTime.split(':'); var dt1 = new Date(dt.getFullYear(), dt.getMonth(), dt.getDate(), parseInt(s[0]), parseInt(s[1]), parseInt(s[2])); var e = endTime.split(':'); var dt2 = new Date(dt.getFullYear(), dt.getMonth(), dt.getDate(),parseInt(e[0]), parseInt(e[1]), parseInt(e[2])); alert( (dt &gt;= dt1 &amp;&amp; dt &lt;= dt2) ? 'Current time is between startTime and endTime' : 'Current time is NOT between startTime and endTime'); alert ('dt = ' + dt + ', dt1 = ' + dt1 + ', dt2 =' + dt2)
has answer: http://stackoverflow.com/a/29785486
has answer: http://stackoverflow.com/a/64264859
score: 18
tagged with: javascript
has answer: http://stackoverflow.com/a/50823084
tagged with: date
has answer: http://stackoverflow.com/a/78042099
has answer: http://stackoverflow.com/a/77490912
has comment: http://stackoverflow.com/comment/47700720
answer count: 7
favorite count: 0
has title: Check if current time is between two given times in JavaScript
has answer: http://stackoverflow.com/a/29785564

http://stackoverflow.com/comment/47673180
has text: Thanks ! i have a small problem here http://jsfiddle.net/kcGZJ/49/ When i navigate over 2, it expands 3's li as it slides up!!
comment on: http://stackoverflow.com/a/29771409
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47549383
type: Comment
type: QuestionComment
has text: My js knowledge is poor, what I found is translate3d("+e.x+"px, "+e.y+"px, 0)"}else if(m==="csstransforms"){e.transform="translate("+e.x+"px, "+e.y+"px)"} but I don't know how to play with this:)
comment on: http://stackoverflow.com/q/29706596
score: 0

http://stackoverflow.com/q/29792633
has body: i have a little problem with upload images. Sometimes, someone, upload photos in a wrong orientation. Whant i want to do is rotate images before send it to my server. Is this possible? I know that i can use the function imagerotate() from php but i can use it after the image has been uploaded. Is there any way via javascript (or Jquery) to rotate the image and then pass the information to the server through php? Now i made something like this: I use jQueryRotate.js HTML <- counter 90 clockwise -> save image Jquery $(document).ready(function() { $('.row').click(function(){ var a = $('img').getRotateAngle(); var d = Math.abs($('#degree').val()); if($(this).attr('id') == 'counter'){ //d = -Math.abs(+a - +d); d = a - d; } else{d = +a + +d;} $('img').rotate({animateTo:d}); }); /* image preview */ $('#file').change(function(){ var oFReader = new FileReader(); oFReader.readAsDataURL(this.files[0]); console.log(this.files[0]); oFReader.onload = function (oFREvent) { $('#preview').html(' '); }; }); }); But i can't transfer the 'rotation' to upload file, i think.... Thank you very much!
type: Question
has comment: http://stackoverflow.com/comment/47714018
score: 3
has answer: http://stackoverflow.com/a/44972943
has title: Rotate an image before upload it on the server
accepted answer: http://stackoverflow.com/a/44972943
tagged with: image
upvote count: 3
answer count: 2
has comment: http://stackoverflow.com/comment/47714171
tagged with: upload
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47713946
favorite count: 0
linked to: http://stackoverflow.com/q/38734035
has comment: http://stackoverflow.com/comment/67925305
possible better answer: http://stackoverflow.com/a/67097091
has answer: http://stackoverflow.com/a/67097091
type: AnsweredQuestion
downvote count: 0
tagged with: php

http://stackoverflow.com/a/29769915
type: Answer
answers question: http://stackoverflow.com/q/29769719
has comment: http://stackoverflow.com/comment/47670587
has comment: http://stackoverflow.com/comment/47671237
has comment: http://stackoverflow.com/comment/47675729
has body: Just done it, simple really, you just do: this.listenTo(this.fields &amp;&amp; this.operators,'populated',function(){ this.render(); }); UPDATE Don't use this, see comments below, I'll be accepting the correct answer.
score: 0
has comment: http://stackoverflow.com/comment/47671649
has comment: http://stackoverflow.com/comment/47671567
has comment: http://stackoverflow.com/comment/47670548
has comment: http://stackoverflow.com/comment/47672333
has comment: http://stackoverflow.com/comment/47676069

http://stackoverflow.com/a/29816773
answers question: http://stackoverflow.com/q/29816318
downvote count: 0
score: 1
has body: This allows you to construct a RegExp from your input, and replace matches that are between spaces, or at the beginning or end of the string. RegExp.escape = function(s) { return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&amp;'); }; var value = 'c+ c++ c+ c+c c+ c', $word = RegExp.escape('c+'), regex = new RegExp('(?:^|\\s+)' + $word + '(?:\\s+|$)', 'g'); $('input').val(value); $('input').val($('input').val().replace(regex, ' ')); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input&gt;&lt;/input&gt;
type: Answer
upvote count: 1

http://stackoverflow.com/comment/47513976
comment on: http://stackoverflow.com/q/29688429
has text: Correction: echo" ";
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/29774172
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29774139
downvote count: 0
type: AcceptedAnswer
has body: Return result from function MyAccountsPage.prototype.getAccountNumberArray = function() { return element.all(by.repeater('currentUserAccount in currentUserAccounts').column('currentUserAccount.accountNumber')).map(function(accounts) { return accounts.getText(); }); };
type: Answer
answers question: http://stackoverflow.com/q/29774139
score: 1

http://stackoverflow.com/q/29828571
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/47783729
has body: I don't know if what I am trying to do is possible so I will explain the whole scenario and what I am attempting to do that way if there is a better way you bright people can let me know! Here is the scenario, I have a view and a PartialView. In the PartialView I have a dropdown list that gets populated via javascript from in the View. This works fine, in the PartialView I have a div that calls a Controller to return results based on a value in the Model passed to it. What I need are the results to be based on the value from the Model AND the dropdown list. Here is the code that works just based on the model value and a hardcoded loc which is what I want to get from the dropdown. &lt;div id="catalogue-view-action-view-ct" class="async-partial" data-url='@Url.Content("~/Catalogue_Items/ItemsActionViewPartial/")@Model.CatalogueItemID?loc=6&amp;AsyncUpdateID=catalogue-view'&gt; @if (noJs) { &lt;span&gt; @{ Html.RenderAction("ItemsActionViewPartial", "Catalogue_Items", new { id = Model.CatalogueItemID, location = 6, AsyncUpdateID = "catalogue-view-action-view-ct" }); } &lt;/span&gt; } else { &lt;img src="@Url.Content("~/assets/images/busy.gif")" /&gt;&lt;span&gt; Loading...&lt;/span&gt; } &lt;/div&gt; This div in the PartialView works great, in the View I have been able to set the data-url attribute no problem with javascript but the page is already loaded so it doesn't update. Is there a way to "refresh" or "reload" just a div not the whole PartialView? If I do the whole PartialView I am just back in the same situation with the html being loaded before the javascript sets the data-url attribute. Here is the javascript in the view: var myDiv = document.getElementById('catalogue-view-action-view-ct'); url = '~/Catalogue_Items/ItemsActionViewPartial/20144?loc=' + $('#LocationID').val() + '&amp;AsyncUpdateID=catalogue-view-action-view-ct'; myDiv.setAttribute('data-url', url); $('#catalogue-view-action-view-ct').load(url); Any help would be greatly appreciated. UPDATE: When…
has comment: http://stackoverflow.com/comment/47787511
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29832393
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
tagged with: razor
has comment: http://stackoverflow.com/comment/47789198
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47787554
has comment: http://stackoverflow.com/comment/47787333
score: 0
has title: Reload Div Section Only
accepted answer: http://stackoverflow.com/a/29832393
type: Question
has comment: http://stackoverflow.com/comment/47785944

http://stackoverflow.com/a/29755561
has comment: http://stackoverflow.com/comment/47644419
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47649118
answers question: http://stackoverflow.com/q/29755304
type: Answer
has comment: http://stackoverflow.com/comment/47649349
has body: Here is a full, working example of how you can override push on your property. function Foo() { this._bar = []; var oldPush = this._bar.push; this._bar.push = function(){ for(var i = 0; i < arguments.length; i++){ //do something with each element if needed $('body').append(" INSERTING VALUE: " + arguments[i] + " "); } oldPush.apply(this, arguments); }; } Object.defineProperty(Foo.prototype, 'bar', { get: function () { return this._bar; } }); Check this out for a demo: JSFiddle UPDATE: Edited the code to be able to call push with a list of params, e.g. foo.bar.push(1, 2, 3).
accepted answer of: http://stackoverflow.com/q/29755304

http://stackoverflow.com/q/29750593
has comment: http://stackoverflow.com/comment/47636936
tagged with: javascript
score: 0
has body: Maybe it is a bit of a silly question, but I am wondering if it is possible to prevent an iframe from reloading when a whole page reloads. I have made an application in ASP.NET. I have one page, and on that page there is a form, a tabel and a section with an iframe. In that section I can "upload" an pdf file, and this pdf file is shown in an iframe. like this: &lt;section class="invoice_file"&gt; &lt;div class="invoice_file_header"&gt; &lt;input id="upload_button" type='file' onchange="readURL(this);" /&gt; &lt;/div&gt; &lt;iframe id="upload_factuur" type="application/pdf" width="696" height="433"&gt;&lt;/iframe&gt; &lt;/section&gt; With my javascript code, the pdf file displays in my iframe (most of the times): function readURL(input) { if (input.files &amp;&amp; input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#upload_factuur') .attr('src', e.target.result) }; reader.readAsDataURL(input.files[0]); } } The idea is that on that pdf file, there is information. This information will be taken over and put into the form. When I submit the form, the data will show in the tabel. But to do this, the page reloads (redirect). And so does my section with the pdf. Thereby the pdf file disapears and I should upload the file once again So is there a way to prevent a section or iframe to reload when the whole page reloads.
has comment: http://stackoverflow.com/comment/47638896
answer count: 1
has comment: http://stackoverflow.com/comment/47633843
has comment: http://stackoverflow.com/comment/47634158
tagged with: asp.net
has comment: http://stackoverflow.com/comment/47633400
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Prevent iframe / section from reloading when whole page reloads
has comment: http://stackoverflow.com/comment/47633425
has comment: http://stackoverflow.com/comment/47633675
has comment: http://stackoverflow.com/comment/47633782
has answer: http://stackoverflow.com/a/29753775
type: Question

http://stackoverflow.com/comment/47665176
score: 0
has text: I've question, how to determine the unit of vw & vh from my PSD ? according to what ? after searching I found equation 1px = (100 / document.documentElement.clientWidth)vw .. but it's not clear enough for me ! @sumeet
comment on: http://stackoverflow.com/a/29765547
type: Comment
type: AnswerComment

http://stackoverflow.com/q/29807517
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29807638
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/29807614
has answer: http://stackoverflow.com/a/29807614
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47743222
tagged with: css
has title: clear a link's css properties in html
upvote count: 2
downvote count: 1
has answer: http://stackoverflow.com/a/29807638
type: AnsweredQuestion
score: 1
has body: I have bought a html+css template from a website and I am having a problem with a link. I am trying to add a link and link gets a lot of css properties by default. How can I clear those css properties for that specific link? here is the code below... Test asd asd zxc zxc zxc zxc zxc zxc zxc zxc zxc zxc zxc Fiyat Listesi******* The link with the PDf, I want it to be downloaded when it is clicked, but it opens it as a popup modal. I have used target="_blank" but it didn't work. How can I make it downloadable?
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47743278

http://stackoverflow.com/q/29805098
has answer: http://stackoverflow.com/a/29805796
has comment: http://stackoverflow.com/comment/47737931
possible better answer: http://stackoverflow.com/a/29805191
linked to: http://stackoverflow.com/q/8638621
has body: I have somehow a technical question. I would like to know if there is a possibility to style a d3 element with jQuery. For instance a "Collatz Graph" example from the d3 site http://www.jasondavies.com/collatz-graph/ is producing a circle - like nodes with small labels. In that case the numbers 1, 2, 3 and so on. The number is nothing more than a piece of code e.g. 32 How could I style this element with jQuery? e.g. adding a red border by clicking it? Obviously I would need a class or id in the and proceed as follows: $(".nome_class").click(function() { $(this).css( "border", "3px solid red" ); }); In my code, both d3 is working (I can see a graph) and jQuery is working (I can for instance style or do something else with the regular HTML elements). BUT when I try style d3 element I get no result. I will be very grateful for any hint or advice.
tagged with: d3.js
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29805191
has answer: http://stackoverflow.com/a/29805189
type: Question
accepted answer: http://stackoverflow.com/a/29805796
has title: Style a d3 element with jQuery and CSS
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3

http://stackoverflow.com/a/29817330
upvote count: 1
downvote count: 1
has body: You can put your logo in header and position with : .your-logo-class { position: relative; top: 100px; // Adjust this value }
score: 0
answers question: http://stackoverflow.com/q/29817246
type: Answer

http://stackoverflow.com/q/29688459
has answer: http://stackoverflow.com/a/29688521
answer count: 3
has answer: http://stackoverflow.com/a/29688502
has title: Jquery/ajax : wait untill the first function finish and execute the second
has comment: http://stackoverflow.com/comment/47514072
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47514114
has answer: http://stackoverflow.com/a/29688476
has body: i have more than 3 functions and i want to execute the first function and when it finish i will execute the second one and so on . this is the code im trying to use but it execute all functions in the some time . var categoriesReady = $.Deferred(); var linksReady = $.Deferred(); var dataReady = $.Deferred(); function getCategories(){ $.getJSON(serviceURL + 'get_categories', function(data) { cats = data.categories; $.each(cats, function(index, cat) { $("#menuIcons").append(' '+cat.title+' '); }); }); categoriesReady.resolve(); } function getLinks(){ $.getJSON(serviceURL + 'get_links', function(data) { links = data.links; $.each(links, function(index, link) { $("#menuIcons").append(' '+link.title+' '); }); }); linksReady.resolve(); } function getLinks(){ $.getJSON(serviceURL + 'get_links', function(data) { cats = data.categories; $.each(cats, function(index, cat) { $("#menuIcons").append(' '+cat.title+' '); }); }); linksReady.resolve(); } function getData(){ $.getJSON(serviceURL + 'get_links', function(data) { posts = data.posts; $.each(cats, function(index, post) { $("#menuIcons").append('A : '+post.content); }); }); dataReady.resolve(); } function init(){ $("body").append("3 function are done!"); } $.when(getCategories(),getLinks(),getData()).then(init); whats the problem ?
has comment: http://stackoverflow.com/comment/47514052
linked to: http://stackoverflow.com/q/3709597
linked to: http://stackoverflow.com/q/23065907
linked to: http://stackoverflow.com/q/2765411
has comment: http://stackoverflow.com/comment/47514084
has comment: http://stackoverflow.com/comment/47514026
type: Question
score: 0
has comment: http://stackoverflow.com/comment/47514082
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/87163765
has comment: http://stackoverflow.com/comment/47514022

http://stackoverflow.com/q/29810345
type: Question
score: 3
has comment: http://stackoverflow.com/comment/47749687
tagged with: javascript
tagged with: google-maps-api-3
has answer: http://stackoverflow.com/a/29811473
linked to: http://stackoverflow.com/q/25529966
answer count: 2
tagged with: google-maps
downvote count: 0
has title: Using google maps polyline to draw bezier curve
favorite count: 0
has body: I'm trying to draw a bezier curve in google maps by using a SVG path in a Polyline. At first I used a Marker instead similar to Curved line between two near points in google maps, which gave the results that I'm after. However, since it's not possible to drag the map under the marker, I can't use this method. So I switched to a Polyline instead of a marker. Now I get the same good results when I zoom out, but when I zoom in the curve becomes "cropped". Here is the code: function initialize() { var mapOptions = { mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var coord1 = new google.maps.LatLng(49.165876, -123.152446); var coord2 = new google.maps.LatLng(25.786328, -80.193694); var bounds = new google.maps.LatLngBounds(); bounds.extend(coord1); bounds.extend(coord2); map.fitBounds(bounds); pLineOpt = { path: [coord1, coord2], strokeWeight: 4, strokeOpacity: 0, map: map, } pLine = new google.maps.Polyline(pLineOpt); var markers = [ new google.maps.Marker({ position: coord1, map: map }), new google.maps.Marker({ position: coord2, map: map }) ]; google.maps.event.addListener(map, 'zoom_changed', function () { //points var p1 = map.getProjection().fromLatLngToPoint(coord1); var p2 = map.getProjection().fromLatLngToPoint(coord2); //distance between points var d = new google.maps.Point(p2.x - p1.x, p2.y - p1.y); var lengthSqr = d.x * d.x + d.y * d.y; //middle point var m = new google.maps.Point(d.x / 2, d.y / 2); //slope of perpendicular line var perpK = -d.x / d.y; //distance to control point var ratioDistanceControlLengthSqr = 9; var controlDSqr = lengthSqr / ratioDistanceControlLengthSqr; var p3dX = Math.sqrt(controlDSqr / (Math.pow(perpK, 2) + 1)); var p3dY = perpK * p3dX; //control point var p3 = new google.maps.Point(m.x - p3dX, m.y - p3dY); //curve path var path = "M 0 0 q " + p3.x + " " + p3.y + " " + d.x + " " + d.y; //calc scale var zoom = map.getZoom(); var scale = 1 / (Math.pow(2, -z…
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29810808
upvote count: 3
linked to: http://stackoverflow.com/q/20321006

http://stackoverflow.com/q/29740989
answer count: 5
accepted answer: http://stackoverflow.com/a/29741078
has comment: http://stackoverflow.com/comment/47615099
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47615137
has title: JQuery to hide the current div and show the next one
upvote count: 1
type: Question
has body: I have a page that creates 7 div sections and I hide them all except for the first one. Each div has 4 questions in it. Once they answer all the four questions and click the next button I want to hide that div and show the next one. In the final one I will have the submit button. I can't seem to figure it out. My latest attempt is below. JQuery call here $(document).ready(function() { $('#1').show(); $('#2').hide(); $('#3').hide(); $('#4').hide(); $('#5').hide(); $('#6').hide(); $('#7').hide(); $('.article').click(function() { $(this).parent('div').hide(); $(this).next('div').show(); return false; }); }); Example of first two HTML divs here with a lot of guts cut out to save space: Chapter 1 1. According to this training etc? 1. 2. 3. 4. Next Chapter 2 5. question here Next
possible better answer: http://stackoverflow.com/a/29741152
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29741152
has answer: http://stackoverflow.com/a/29741078
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47615179
downvote count: 0
has answer: http://stackoverflow.com/a/29741187
favorite count: 0
has answer: http://stackoverflow.com/a/29741210
has answer: http://stackoverflow.com/a/29742021

http://stackoverflow.com/comment/84071913
comment on: http://stackoverflow.com/a/29790735
type: Comment
has text: @LincesMarques : I have edited my code. You can refer :)
score: 1
type: AnswerComment

http://stackoverflow.com/a/29820045
accepted answer of: http://stackoverflow.com/q/29818858
has comment: http://stackoverflow.com/comment/47770053
has body: Based on the answer you found as well, I put together a jsfiddle for testing purposes. (note that I'm using a predefined XML string in the fiddle since I can't access the RSS feed on the domain) Here's the code explanation Simple HTML: &lt;ul id="feed"&gt; &lt;/ul&gt; Javascript: $(document).ready(function(){ var x=10; // your X iteration limit // load the xml data. it is parsed by jquery $.get("http://www.flatpanels.dk/rss/nyhed.xml", function(data) { var $xml = $(data); $xml.find("item").each(function(i, val) { // find the items in the rss and loop // create an item object with all the necessary information out of the xml var $this = $(this), item = { title: $this.find("title").text(), link: $this.find("link").text(), description: $this.find("description").text(), pubDate: $this.find("pubDate").text(), author: $this.find("author").text(), guid: $this.find("guid").text() }; // replace the CDATA in the item title item.title = item.title.replace("&lt;![CDATA[", "").replace("]]&gt;", ""); // #feed selects the ul element with the id feed // and append() appends a newly created li element // to the ul $('#feed').append($('&lt;li&gt;&lt;a href="' +item.guid +'"&gt;' +item.title +'&lt;/a&gt;&lt;/li&gt;')); return i&lt;(x-1); // (stop after x iterations) }); }); });
answers question: http://stackoverflow.com/q/29818858
type: Answer
has comment: http://stackoverflow.com/comment/47767840
has comment: http://stackoverflow.com/comment/47770445
downvote count: 0
has comment: http://stackoverflow.com/comment/47768353
has comment: http://stackoverflow.com/comment/47771180
score: 1
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47768157

http://stackoverflow.com/a/29838923
downvote count: 1
has comment: http://stackoverflow.com/comment/48205136
has comment: http://stackoverflow.com/comment/48218689
type: Answer
has comment: http://stackoverflow.com/comment/48225951
has body: RegExp var num = '2'; "1:A;2:B;3:A;4:c;5:D".match((new RegExp(num+"\\:([\\S\\s]+?)\\;", "")))[1]; Fiddle This uses RegExp (Regular Expressions) What this does is it will look for a '2' in the string, then get the option associated with it Substring I couldn't think of a better word so forgive me. You can use substring and .indexOf() var num = '2', string = "1:A;2:B;3:A;4:c;5:D", index = string.indexOf(num+':'); string.substring(index+num.length+1,index+num.length+2); Fiddle Similar The substring answer is a little easier to understand but the following does the sameish var num = '2', string = "1:A;2:B;3:A;4:c;5:D"; string[string.indexOf(num+':')+num.length+1]; Fiddle Foolproof This should work in most situations. This will also get the option if it is more than one letter long var string = "1:A;2:B;3:A;4:c;5:D", num = '2', result; if (string.indexOf(';'+num+':') < 0) { result = string.match(new RegExp(num+"\\:([\\S\\s]+?)\\;", ""))[1]; } else { result = string.match((new RegExp('\\;'+num+"\\:([\\S\\s]+?)\\;", "")))[1]; } Shorter: var string = "1:A;2:B;3:A;4:c;5:D", num = '2', result = string.indexOf(";"+num+":") < 0? string.match(new RegExp(num+"\\:([\\S\\s]+?)\\;",""))[1] : string.match(new RegExp("\\;"+num+"\\:([\\S\\s]+?)\\;",""))[1]; alert(result); Fiddle (I have made it a one-liner)
answers question: http://stackoverflow.com/q/29838803
has comment: http://stackoverflow.com/comment/48205083
score: 0
upvote count: 1

http://stackoverflow.com/a/29823481
answers question: http://stackoverflow.com/q/29822923
type: Answer
has body: Try this type of approach : $('*:not(.scrollable)').on('scroll touchmove', function(e){ e.preventDefault(); }); not tested but should be a start to find the correct way to do what you want.
score: 0

http://stackoverflow.com/q/29705499
has title: Slow performance in Firefox for D3 force layout
tagged with: d3.js
has comment: http://stackoverflow.com/comment/47572925
has body: I've created a force-layout using D3 (see image below). However, it runs very slowly in Firefox, whereas it works perfectly fine in Chrome. I'm debugging it using a local server and browsing at http://localhost:8888/. It's might be due to the following message in the Firefox console, but accordingly to the comments that's unlikely. Can someone pinpoint the performance issue and give me a hint on how to resolve it? mutating the Prototype of an object will cause your code to run very slowly; instead create the object with the correct initial Prototype value using Object.create Data and code in zip: https://www.dropbox.com/s/ksh2qk1b5s9lfq5/Network%20View.zip?dl=0 Visualization: Index.html networkview.js var line_diff = 0.5; // increase from zero if you want space between the call/text lines var mark_offset = 10; // how many percent of the mark lines in each end are not used for the relationship between incoming/outgoing? var mark_size = 5; // size of the mark on the line var legendRectSize = 9; // 18 var legendSpacing = 4; // 4 var recordTypes = []; var legend; var text_links_data, call_links_data; // colors for the different parts of the visualization recordTypes.push({ text : "call", color : "#438DCA" }); recordTypes.push({ text : "text", color : "#70C05A" }); recordTypes.push({ text : "balance", color : "#245A76" }); // Function for grabbing a specific property from an array pluck = function (ary, prop) { return ary.map(function (x) { return x[prop] }); } // Sums an array sum = function (ary) { return ary.reduce(function (a, b) { return a + b }, 0); } maxArray = function (ary) { return ary.reduce(function (a, b) { return Math.max(a, b) }, -Infinity); } minArray = function (ary) { return ary.reduce(function (a, b) { return Math.min(a, b) }, Infinity); } var data_links; var data_nodes; var results = Papa.parse("links.csv", { header : true, download : true, dynamicTyping : true, delimiter : ",", skipEmptyLines : true, complete : function (results) { data_links…
has answer: http://stackoverflow.com/a/29731908
type: AnsweredQuestion
tagged with: performance
has comment: http://stackoverflow.com/comment/47549519
accepted answer: http://stackoverflow.com/a/29731908
type: Question
has comment: http://stackoverflow.com/comment/47554454
tagged with: firefox
tagged with: javascript
has comment: http://stackoverflow.com/comment/47577883
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47550138
has comment: http://stackoverflow.com/comment/47577640

http://stackoverflow.com/comment/116153185
has text: The problem with this answer is that (from outward appearance) `item.toIdString()` computes the id string independent of the contents of the instance of the GeneralSet into which it will be inserted. That precludes the possibility of a hash function - therefore validating your statement about being "memory expensive". Passing the GeneralSet as a parameter - `item.toIdString(gs:GeneralSet)` enables hashes to be used. Practically speaking that's the only way to do it in the "general" case (due to memory limitations) although it is obviously more work to manage the hashing.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29783624
type: AnswerComment

http://stackoverflow.com/comment/47547262
score: 0
comment on: http://stackoverflow.com/q/29705755
has text: check `promise` function this https://api.jquery.com/promise/
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29784473
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29791569
tagged with: http://stackoverflow.com/tag/q
favorite count: 0
tagged with: promise
has title: Linting Promises in Javascript
has comment: http://stackoverflow.com/comment/47700051
has comment: http://stackoverflow.com/comment/47737004
tagged with: coding-style
linked to: http://stackoverflow.com/q/24662289
has body: I am looking to standardize the use of Q promises in my team's codebase. Are there any good jscs extensions (or other linters) to help enforce style when it comes to promises? We would like our promises to follow this form: promise() .then() .catch() .done(); And would like a linter to catch any .then() in our code that is missing a .catch() Advice for other stylistic tips when it comes to promises is welcome too.
has comment: http://stackoverflow.com/comment/47718518
has comment: http://stackoverflow.com/comment/47718538
upvote count: 7
type: AnsweredQuestion
tagged with: jscs
score: 7
has comment: http://stackoverflow.com/comment/47735919
accepted answer: http://stackoverflow.com/a/29791569
type: Question

http://stackoverflow.com/comment/47543140
has text: @MisterFrank Updated, hope that helps.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29703618
type: Comment

http://stackoverflow.com/comment/47726478
has text: So a vendor could in theory create a JavaScript runtime not following the "standard" event loop with async IO behavior?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29799133

http://stackoverflow.com/a/29799654
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29799316
has comment: http://stackoverflow.com/comment/47801964
has comment: http://stackoverflow.com/comment/47727599
upvote count: 2
has comment: http://stackoverflow.com/comment/47727425
type: AcceptedAnswer
has body: The event loop predates javascript.. but just by a tiny bit. The event loop was introduced to support progressive download of pictures in Netscape. And almost immediately it was also used to support early rendering where DOM elements are displayed on screen before all images are downloaded. At the time, other browsers displayed blank white screen while images are downloaded. The net effect is that Netscape appears to be faster even though it takes the same amount of time to download and render the complete page. Once the event loop is there (initially to handle network code for downloading images) javascript processing was simply added into the loop.
type: Answer
answers question: http://stackoverflow.com/q/29799316
score: 2

http://stackoverflow.com/comment/47676770
comment on: http://stackoverflow.com/a/29771409
score: 0
type: AnswerComment
has text: Hey thanks but i am facing issues with second level menu !! http://jsfiddle.net/kcGZJ/56/
type: Comment

http://stackoverflow.com/comment/47604064
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29735100
has text: You can return to your local page using a simple javascript redirect, window.location.href = "file://your_file.html?FBID=xxx&FBUSERNAME=yyyy".
score: 0

http://stackoverflow.com/comment/47811921
has text: @UTKARSHVISHNOI His point is to put something inside the `if` to make sure you're getting there. You can also set a breakpoint in the Javascript debugger.
comment on: http://stackoverflow.com/q/29842802
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29719329
answer count: 15
has body: I have an array that I want to change to upper case but I can´t make it work. Please help me. var array2 = ["melon","banana","apple","orange","lemon"]; array2.toUpperCase() I have also tried the below but it doesn´t work neither. array2.map(toUpperCase); Thanks in advance!
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/49124770
downvote count: 0
has comment: http://stackoverflow.com/comment/47573187
has answer: http://stackoverflow.com/a/53974631
has answer: http://stackoverflow.com/a/29719381
has answer: http://stackoverflow.com/a/29719375
type: Question
has answer: http://stackoverflow.com/a/65786329
upvote count: 38
linked to: http://stackoverflow.com/q/9939803
tagged with: arrays
possible better answer: http://stackoverflow.com/a/29719380
tagged with: javascript
has answer: http://stackoverflow.com/a/73426681
has answer: http://stackoverflow.com/a/67641149
has answer: http://stackoverflow.com/a/72082764
has comment: http://stackoverflow.com/comment/47573444
has comment: http://stackoverflow.com/comment/125317932
has answer: http://stackoverflow.com/a/45269781
has answer: http://stackoverflow.com/a/44063946
favorite count: 0
has answer: http://stackoverflow.com/a/70887641
score: 38
has answer: http://stackoverflow.com/a/29719347
accepted answer: http://stackoverflow.com/a/29719347
has answer: http://stackoverflow.com/a/29719380
has answer: http://stackoverflow.com/a/52026065
has title: Convert array into upper case
has answer: http://stackoverflow.com/a/39060263

http://stackoverflow.com/comment/47538331
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29700489
has text: Yeah, I guess saying "better" is subjective, but for those of us who hate programatically dealing with strings (which actually is what this question is about) as it hides functionality, `.hasOwnProperty` is preferable. IDE's will additionally help prevent you getting a typo in that too. :p
type: AnswerComment

http://stackoverflow.com/comment/48277858
comment on: http://stackoverflow.com/q/29740464
type: Comment
type: QuestionComment
has text: You may want to do ajax query synchronously.
score: 1

http://stackoverflow.com/comment/47650201
comment on: http://stackoverflow.com/a/29755352
has text: AFAIK, Photoshop doesn't have protocol requests, so it still wouldn't work.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29777251
accepted answer: http://stackoverflow.com/a/29778953
type: Question
has comment: http://stackoverflow.com/comment/47699341
tagged with: javascript
upvote count: 3
has title: How to write factory functions that adhere to the 'open closed principle'
answer count: 1
has body: I've been researching the use of factory functions as an alternative to constructors in JavaScript. Most of my research has stemmed from the information provided by Eric Elliot in his blog posts such as: http://ericleads.com/2012/09/stop-using-constructor-functions-in-javascript Whilst I agree with most of what's said here I do miss having the automatic initialization aspect of constructors so I wanted to implement something similar within my factory function: var myFactory = function (options) { var inst = _.create({ initialize : function (options) { var allowedProps = ['name', 'type']; this.options = options; _.extend(this, _.pick(options, allowedProps)); }, test : function () { if(this.type === 'alpha') { return true; } return false; } }) inst.initialize.call(inst, options); return inst; }; var x = myFactory({ name : 'shiny', type : 'alpha' }); var y = myFactory({ name : 'happy', type : 'beta' }); 1) Is this behavior itself just re-introducing some of the problems that come with constructors? 2) Am I violating the Open/Closed principle by extending the instance with 'options' within the initialize method? It's open for extension (it can be used as a prototype) but I can also modify the prototype itself through 'options'. I've got a bad feeling about this pattern and feel like I should be giving ultimate control of initialization to the consumer. It's heavily inspired by Backbone's method of extension which relies on constructors. Further reading: https://tsherif.wordpress.com/2013/08/04/constructors-are-bad-for-javascript/
favorite count: 0
has comment: http://stackoverflow.com/comment/47707032
type: AnsweredQuestion
score: 3
downvote count: 0
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/47688037
has comment: http://stackoverflow.com/comment/47688652
has answer: http://stackoverflow.com/a/29778953

http://stackoverflow.com/a/29820101
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/29819738
answers question: http://stackoverflow.com/q/29819738
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You could use a sort function like var $tbody = $('.configurable-product-table tbody'); var trs = $tbody.children().slice(1).get(); trs.sort(function (a, b) { var $atds = $(a).find('td'), $btds = $(b).find('td'); var c = $atds.eq(1).text().localeCompare($btds.eq(1).text()); if (c == 0) { c = sizeFormat($atds.eq(0).text()).localeCompare(sizeFormat($btds.eq(0).text())); } return c; }) function sizeFormat(size) { return size.replace(/\d+/g, function (v) { return +v &lt; 10 ? '0' + v : v }) } $tbody.append(trs) Demo: Fiddle

http://stackoverflow.com/q/29773511
answer count: 1
tagged with: xpath
has answer: http://stackoverflow.com/a/29774322
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47678547
accepted answer: http://stackoverflow.com/a/29774322
tagged with: javascript
tagged with: jquery
score: 0
has body: I'm trying to convert the following jQuery into XPath: $(".change_language_div span.k-dropdown:nth-of-type(2)") This is what I have but it is not working: $x("//div[@class='change_language_div']/span[@class='k-dropdown'][1]") The first part: //div[@class='change_language_div'] is working but if I include the second part I get an empty array.
has title: Convert Javascript/jQuery Query into XPath

http://stackoverflow.com/q/29742473
has comment: http://stackoverflow.com/comment/47617931
upvote count: 1
favorite count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/38965324
tagged with: datatable
has comment: http://stackoverflow.com/comment/47618169
tagged with: twitter-bootstrap-3
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47618393
has comment: http://stackoverflow.com/comment/47618014
has title: Button label jQuery DataTable
type: Question
has comment: http://stackoverflow.com/comment/47618170
answer count: 2
has comment: http://stackoverflow.com/comment/49157731
has answer: http://stackoverflow.com/a/32760343
has body: I want to change button label in jQuery DataTable. That's my code (not working) $('#data-table').dataTable({ "language": { "paginate": { "next": "Next page" } } }); I'm still have Next label.
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29755824
score: 0
answers question: http://stackoverflow.com/q/29755460
type: Answer
has body: Try something like this: $('#answerCard a').click(function(event) { var loc = $(this).attr('href'); event.preventDefault(); answerCardInnerLinkReportingCall(loc, this); }); function answerCardInnerLinkReportingCall(loc, that){ // your code to do stuff here window.open(loc, '_blank'); } See this demo fiddle

http://stackoverflow.com/comment/47765176
has text: Changing from bgColor to document.style.backgroundColor worked perfectly. Thank you very much
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29792468
type: QuestionComment

http://stackoverflow.com/q/29721792
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47578263
tagged with: php
score: 2
answer count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/47578183
tagged with: mysql
type: Question
has comment: http://stackoverflow.com/comment/47578179
has body: I am trying to get a variable from session storage and use it in my PHP MySQL query, but it keeps returning no values. My JavaScript to get variables from session storage: var myEmail = sessionStorage.getItem('myEmail'); Assigning a JavaScript variable to a PHP variable: <?php $emailAddress = " "; ?> And once connected to the database: <?php $query = mysql_query("SELECT * FROM myTable WHERE emailaddress='$emailAddress'; ?> Can anyone see any problems? When I output the result it is just blank. Just before I make the query I echoed the email address and it output fine. Not sure when I put it in the query it just returns nothing. If i change the $emailAddress in the query for "someone@gmail.com" for example it works fine, just not with the variable.
tagged with: javascript
has comment: http://stackoverflow.com/comment/47578186
has comment: http://stackoverflow.com/comment/47578270
linked to: http://stackoverflow.com/q/1917576
has title: Get variable from session storage and use in PHP query
downvote count: 0
tagged with: variables

http://stackoverflow.com/comment/47547184
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29702881
has text: Ugh. Are you sure there isn't any trick using bind, extend or bindAll that can help keep the syntax similar?
score: 0

http://stackoverflow.com/q/29780777
has answer: http://stackoverflow.com/a/29781002
type: UnansweredQuestion
has title: HTTP form submit callback
type: Question
linked to: http://stackoverflow.com/q/1524639
tagged with: javascript
has body: I'm posting a form that causes a file to be downloaded. So my browser page does not change. My form is e.g. form action="/download/file.txt". I'm aware that I could use JQuery and download the file with AJAX and use the JQuery callback mechanisms. However, I don't want to use JQuery because this is a learning experience. Is there any way to call a Javascript function when my file has downloaded?
has answer: http://stackoverflow.com/a/29780918
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29781004

http://stackoverflow.com/comment/47649022
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29757604
score: 0
has text: @redbmk hmm, I was definitely getting a blocked popup for the ESPN site without that, but yours seems like the better alternative. I can't tell from [jQuery's documentation](https://api.jquery.com/trigger/) whether the parameter is actually required or optional.

http://stackoverflow.com/a/29775171
accepted answer of: http://stackoverflow.com/q/29771652
has body: An example where I am passing CustomerID as QueryString to another page Step 1 - Create an ItemTemplate in your page like this. &lt;ItemTemplate&gt; &lt;asp:HyperLink ID="DetailsLink" runat="server" CssClass="my_link" Text="View Details" ToolTip='&lt;%# Eval("CustomerID") %&gt;' NavigateUrl="#"&gt; &lt;/asp:HyperLink&gt; &lt;/ItemTemplate&gt; Step 2 - Place a div outside the GridView like this. &lt;div id="dialog"&gt; &lt;iframe id="myIframe" src=""&gt;&lt;/iframe&gt; &lt;/div&gt; Step 3 - JS $(document).ready(function () { $("#dialog").dialog({ autoOpen: false, modal: true, height: 600, open: function (ev, ui) { $('#myIframe').attr('src', 'Popup.aspx?id=' + selectedID); } }); var selectedID = "0"; $('.my_link').click(function (event) { selectedID = this.title; event.preventDefault(); $('#dialog').dialog('open'); }); }); The code is self explanatory. Hope this helps.
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29771652

http://stackoverflow.com/q/29745889
type: Question
has title: Indication whether the content is changed
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
tagged with: twitter-bootstrap
has body: I am new in front-end and have following problem. First input on page(class="form-control") is prepared for some system ID. After click on button it should fill others disabled inputs with properties like name, address,... It works fine, now I would like to delete content of disabled inputs in case that content of first ID input has changed. All I have is something like this. CSS: &lt;div class="idWrap"&gt; @Html.LabeledEditorFor(o =&gt; o.Id) &lt;/div&gt; //BUTTON HERE &lt;fieldset disabled&gt; @Html.LabeledEditorFor(o =&gt; o.FirstName) @Html.LabeledEditorFor(o =&gt; o.LastName) @Html.LabeledEditorFor(o =&gt; o.Address1) &lt;/fieldset&gt; Razor: @Html.TextBoxFor(model =&gt; model, new Dictionary&lt;string, object&gt; { {"placeholder", "XXXXXX"}, {"class", "form-control"} }) Javascript: $(document).ready(function() { $('.idWrap, .form-control').focus(function() { var input = $(this); //GOT STUCK HERE }); });
has comment: http://stackoverflow.com/comment/47624382
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29746487
accepted answer: http://stackoverflow.com/a/29746487

http://stackoverflow.com/q/29762812
has answer: http://stackoverflow.com/a/29763463
type: Question
possible better answer: http://stackoverflow.com/a/29780586
tagged with: javascript
has answer: http://stackoverflow.com/a/29780586
score: 0
answer count: 3
has title: Data from Json manipulation in AngularJS
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47657614
accepted answer: http://stackoverflow.com/a/29763463
type: AnsweredQuestion
has body: I'm trying to draw a line graph using Angular JS and stuck on manipulating a json file. I have aapl.json looks like: { "date":"2009-07-23", "numOfTweet":13, "oldScore":1, "newScore":0, "percentage1":-100, "appleClosePrice":21.27, "percentage2":0 }, { "date":"2009-07-24", "numOfTweet":32, "oldScore":2, "newScore":0, "percentage1":-100, "appleClosePrice":21.56, "percentage2":68.17113305 }, and I have accessed this data from the json file in Javascript app.controller('LineCtrl', ['$scope', '$http', function($scope, $http) { $http.get('stock/aapl.json').success(function(data) { $scope.series = ['Stock Market', 'Tweet Mood']; $scope.stocks = data; }); }]); I can draw the two line graphs with this code in HTML. If $scope.data = [[28, 48, 40, 19, 86, 27, 90],[65, 59, 80, 81, 56, 55, 40]]; &lt;canvas id="line" class="chart chart-line chart-xl" data="data" labels="labels" legend="true" click="onClick" series="series"&gt;&lt;/canvas&gt; My question is how to use 'percentage1' and 'percentage2' in the json as the data to draw line graphs.
tagged with: linegraph
has answer: http://stackoverflow.com/a/29763031

http://stackoverflow.com/a/30760972
score: 12
downvote count: 8
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/108555037
upvote count: 20
has comment: http://stackoverflow.com/comment/85252591
accepted answer of: http://stackoverflow.com/q/29802481
has comment: http://stackoverflow.com/comment/88374437
has body: I have since discovered that IE spits out this generic error if it doesn't like a piece of Javascript code. I don't remember specifically what the Javascript issue was for this question, but I do remember that once I resolved it, this error went away. EDIT: I seem to keep getting downvotes on this, so let me clarify what I'm talking about. What I'm saying is that a Javascript error -- ANY Javascript error, not something specific -- will cause the SCRIPT16389 error to appear. If you resolve the error -- whatever it is you're getting -- then the SCRIPT16389 should disappear.
answers question: http://stackoverflow.com/q/29802481

http://stackoverflow.com/q/29801739
tagged with: angularjs
type: UnansweredQuestion
has title: AngularJS + RoR: call controller's function from HTML
score: 1
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29801859
has body: I need to call function from AngularJS controller in my HTML template. My HTML (Slim) code looks like that: - if !flash.empty? p true | {{ onLoginClicked() }} When if statement is true I need to call function onLoginClicked() while page is loading (when login error occurs), so only once per refresh.
tagged with: ruby-on-rails-4
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
tagged with: ruby

http://stackoverflow.com/a/29793144
has comment: http://stackoverflow.com/comment/47714966
has body: You can try css @page @page { size: auto; margin: 0; }
score: 4
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/50136595
type: Answer
accepted answer of: http://stackoverflow.com/q/29793102
answers question: http://stackoverflow.com/q/29793102
upvote count: 4

http://stackoverflow.com/a/29737190
type: Answer
upvote count: 5
downvote count: 0
score: 5
answers question: http://stackoverflow.com/q/29737024
has body: Drake's answer would be my personal choice, because the code clearly expresses the intent. But to show an alternative: var strung = JSON.stringify(dataArray); console.log(strung.substring(1,strung.length-1));

http://stackoverflow.com/q/29750358
tagged with: browser-sync
downvote count: 0
has title: Browser Sync Gulp setup not working with .NET MVC
has answer: http://stackoverflow.com/a/29750473
tagged with: gulp
favorite count: 0
has answer: http://stackoverflow.com/a/29750495
score: 5
answer count: 4
possible better answer: http://stackoverflow.com/a/29750606
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29750606
accepted answer: http://stackoverflow.com/a/29750473
has answer: http://stackoverflow.com/a/35585346
type: Question
has body: I am trying to setup a gulp browser-sync build system for a .NET MVC application, everything work except for the live reload with browser sync whenever a change is made. This is my first attempt ever, so I could be doing something simple wrong. Here's my gulpfile.js var gulp = require('gulp'), uglify = require('gulp-uglify'), jshint = require('gulp-jshint'), watch = require('gulp-watch'), livereload = require('gulp-livereload'), browserSync = require('browser-sync'), concat = require('gulp-concat'); //minify js gulp.task('minifyJS', function () { gulp.src('Scripts/**/*.js') .pipe(concat('app.js')) .pipe(gulp.dest('Scripts')) }); gulp.task('minifyCSS', function () { gulp.src('Content/**/*.css') .pipe(concat('app.css')) .pipe(gulp.dest('Content')) }); //browsersync gulp.task('browserSync', function () { var files = [ 'Scripts/**/*.js', 'Content/**/*.css', 'Views/**/*.cshtml' ]; browserSync.init(files, { proxy: "http://localhost:55783/" }); }); //default task wraps the two gulp.task('default', ['minifyJS', 'minifyCSS', 'watch', 'browserSync']); //watch tasks gulp.task('watch', function () { var jsWatcher = gulp.watch('Scripts/**/*.js', ['minifyJS']); var cssWatcher = gulp.watch('Content/**/*.css', ['minifyCSS']); jsWatcher.on('change', function (event) { console.log('Event type: ' + event.type); // added, changed, or deleted console.log('Event path: ' + event.path); // The path of the modified file }); cssWatcher.on('change', function (event) { console.log('Event type: ' + event.type); // added, changed, or deleted console.log('Event path: ' + event.path); // The path of the modified file }); }); when I run gulp watch works just fine as the lines are logged to the console, just no live reload. Ive soured quite a few blog posts to no avail, any ideas? EDIT: Browser-Sync launches the site from the proxy, just whenever I change a CSS or JS file in the listed directories, gulp watch picks up on it but Browser-Sync does not. I have to manually refresh
upvote count: 5
tagged with: javascript

http://stackoverflow.com/comment/47569525
type: Comment
type: QuestionComment
has text: @Godwin I'm using UISegmentedControl, and there is no code beside the one i mentioned above. Don't know if that helps :)
comment on: http://stackoverflow.com/q/29717380
score: 0

http://stackoverflow.com/comment/47677429
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29773422
has text: Maybe can I write .on("focus blur") then check event type inside event handler? But i dont know its better way to write this...

http://stackoverflow.com/q/29771401
has comment: http://stackoverflow.com/comment/47674106
has answer: http://stackoverflow.com/a/29801215
type: Question
has title: How could i optimize my codeigniter application?
tagged with: javascript
has comment: http://stackoverflow.com/comment/47673215
has answer: http://stackoverflow.com/a/29799059
answer count: 2
upvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
downvote count: 8
score: -8
tagged with: php
has body: Is there any way to optimize the codeigniter application? I need to optimize as per coding standards as well as loading purpose. My Webpage takes 6 to 8 sec to load the complete page. but i need it to load in between 2 to 4 sec, So how many ways to compress the code and make faster execution of the page.
has comment: http://stackoverflow.com/comment/47690260
tagged with: codeigniter

http://stackoverflow.com/a/29688309
score: 0
answers question: http://stackoverflow.com/q/29688280
type: Answer
accepted answer of: http://stackoverflow.com/q/29688280
has comment: http://stackoverflow.com/comment/47514282
has comment: http://stackoverflow.com/comment/47515095
has comment: http://stackoverflow.com/comment/47514312
has comment: http://stackoverflow.com/comment/47514469
has body: If you want to use loops: $('div.item').each(function(){ var images = $(this).find('img'); //this will create an array of img objects $(this).remove();//we do not need this div anymore, we will re-create it below for(i=0;i &lt; images.length;i++){ var divOuter = $('&lt;div class="outer"&gt;'); var divInner = $('&lt;div class="item"&gt;'); divInner.append(images[i] ); divOuter.append(divInner); $("#content").append( divOuter); } });
has comment: http://stackoverflow.com/comment/47514818
has comment: http://stackoverflow.com/comment/47514462
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47514040

http://stackoverflow.com/a/29793856
has body: Please have a look at foreverjs https://github.com/foreverjs/forever I found it very flexible and reliable.
has comment: http://stackoverflow.com/comment/47716343
answers question: http://stackoverflow.com/q/29793683
has comment: http://stackoverflow.com/comment/47716081
score: 0
type: Answer

http://stackoverflow.com/comment/47600694
has text: @sitilge Well in the case of the login scripts, the results should be the number of rows that match the entered username and a md5 hash of the entered password. But the problem is that there are no results.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29733308
score: 0

http://stackoverflow.com/comment/47723327
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29796483
has text: Every few seconds? No, not possible, I would use a combination of onEdit and newTrigger, that reaches your service with URLFetch, the newTrigger would fire in XX seconds after the last edit, and no more than 1 trigger would be active at the same time, so you won't reach a cap. I assume you have quite the coding knowledge, it's quite a task to accomplish.
type: Comment

google-oauth
type: Tag
tags question: http://stackoverflow.com/q/29693375
tags question: http://stackoverflow.com/q/29755539
tags question: http://stackoverflow.com/q/29783824
tags question: http://stackoverflow.com/q/29815409
tags question: http://stackoverflow.com/q/29765905
tags question: http://stackoverflow.com/q/29764672
tag name: google-oauth
tags question: http://stackoverflow.com/q/29837431

http://stackoverflow.com/q/29723369
has answer: http://stackoverflow.com/a/29723422
type: Question
accepted answer: http://stackoverflow.com/a/29723399
score: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29723433
has answer: http://stackoverflow.com/a/29723407
has title: jQuery Array of Elements' Strings
tagged with: http://stackoverflow.com/tag/html
has body: From the given HTML, I am trying to extract the pText array, so that I end up with two items (in this case), from which I can extract the two text strings "link test1" and "link test2", and pop an alert for each of them. Why doesn't the below script work? HTML: link test1 link test2 Javascript: var pText = $('div').find('p'); for (i = 0; i < pText.length; i++) { alert(pText[i].text()); }
answer count: 4
possible better answer: http://stackoverflow.com/a/29723407
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/47581087
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29723399

http://stackoverflow.com/a/29708556
has body: A general rule of thumb is as follows: Remove events on teardown. Since you are not removing the DOM element, the listener should persist, performance wise there is no drawback unless you have hundreds of thousands of listeners. The time it takes to micromanage hidden elements listeners aren't enough to outweigh any perceived performance gains. Remove listeners when you remove elements (teardown). Listen to a generic class applied to multiple elements instead of individual elements, use data attributes to identify them if required. Listen to things that need to be listened to. You can also use event delegation (bubbling) for when you have a large number of children that require listening to by listening on the parent: $('div').on('click', function (e) { // check e.target for specific child node you require listening on })
accepted answer of: http://stackoverflow.com/q/29708499
has comment: http://stackoverflow.com/comment/47552901
answers question: http://stackoverflow.com/q/29708499
type: AcceptedAnswer
downvote count: 0
upvote count: 8
has comment: http://stackoverflow.com/comment/47552793
type: Answer
score: 8

http://stackoverflow.com/comment/47613715
type: Comment
type: QuestionComment
has text: @Piwwoli You should post that as an answer... :)
comment on: http://stackoverflow.com/q/29740274
score: 0

http://stackoverflow.com/a/31402500
has comment: http://stackoverflow.com/comment/99407804
has comment: http://stackoverflow.com/comment/84774198
has body: Just a variation on the theme already provided in the answer, but how about this: In a Thing, export default function ThingA () {} In things/index.js, export {default as ThingA} from './ThingA' export {default as ThingB} from './ThingB' export {default as ThingC} from './ThingC' Then to consume all the things elsewhere, import * as things from './things' things.ThingA() Or to consume just some of things, import {ThingA,ThingB} from './things'
has comment: http://stackoverflow.com/comment/56816124
downvote count: 1
has comment: http://stackoverflow.com/comment/60362760
answers question: http://stackoverflow.com/q/29722270
has comment: http://stackoverflow.com/comment/51566733
has comment: http://stackoverflow.com/comment/84761198
has comment: http://stackoverflow.com/comment/60384972
has comment: http://stackoverflow.com/comment/129803502
score: 174
upvote count: 175
has comment: http://stackoverflow.com/comment/131481516
has comment: http://stackoverflow.com/comment/66249229
type: Answer
has comment: http://stackoverflow.com/comment/51594762

http://stackoverflow.com/comment/47549771
type: Comment
has text: Could you give an example of what you want the expected output to look like.
comment on: http://stackoverflow.com/q/29706570
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47804725
has text: @Ravinder is absolutely right you need get it in same connection session also if insert takes place you can get it by _stmt.executeUpdate(query, Statement.RETURN_GENERATED_KEYS);_ so that you dont need explicitly select it..
type: Comment
comment on: http://stackoverflow.com/q/29838773
score: 0
type: QuestionComment

http://stackoverflow.com/a/29727670
score: 0
has body: I believie your issue comes from cached request (in Browser on in ajax itself) please try to disable ajax caching : $(document).ready(function() { setInterval(function() { $.ajax({ url: "plugins/notice/n_notice_invoice.php", cache: false }) .done(function( data ) { $('#rtnotice').html(data).fadeIn("slow"); }); }, 5000) });
has comment: http://stackoverflow.com/comment/47589231
type: Answer
answers question: http://stackoverflow.com/q/29727499

http://stackoverflow.com/q/29734573
has comment: http://stackoverflow.com/comment/47602474
has comment: http://stackoverflow.com/comment/47602615
has body: On keyup on price, I am calculating the total price of (quantity * unit price) individual products and at the end I have field which will auto generate the grand total of all individual totals. I was able to auto calculate the individual totals but I am stuck on the grand total. It shows NaN. How can I fix it ? code: $('.prc').on('keydown keyup', function(){ // total_array = []; flag = $(this).attr('flag'); prc = $(this).val(); qntty = $('.qntty_'+flag).val(); mul = prc * qntty; total = 0; total = total + parseFloat($('.total_'+flag).val(mul)); $('#total').val(total); })
favorite count: 0
type: Question
downvote count: 2
score: -2
has title: jQuery Sum show NaN
answer count: 1
has answer: http://stackoverflow.com/a/29735410
tagged with: onkeyup
has comment: http://stackoverflow.com/comment/47602307
has comment: http://stackoverflow.com/comment/47602368
has comment: http://stackoverflow.com/comment/47602422
upvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47602383

http://stackoverflow.com/a/29790901
accepted answer of: http://stackoverflow.com/q/29790784
has comment: http://stackoverflow.com/comment/47710825
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/47711401
has comment: http://stackoverflow.com/comment/47751375
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47714764
type: Answer
has comment: http://stackoverflow.com/comment/47711221
has body: A data channel is indeed bi-directional; you only need to create one data channel for two peers to communicate over. Just as the initial RTC connection needs* to be created by one peer sending an offer and the other responding, a data channel needs to be opened by one peer and the other can latch onto it in ondatachannel. Then both will use send and on message of that data channel to communicate. * Note that you can create "negotiated" data channels. Each data channel has an id; you can simply manually assign an id to your data channel. If both peers open a data channel with the same id, they do not need to "negotiate" it and can simply assume the other end is listening to the same channel. In practice I have found this to be flaky though.
has comment: http://stackoverflow.com/comment/47710731
answers question: http://stackoverflow.com/q/29790784

canvas
tags question: http://stackoverflow.com/q/29742350
tags question: http://stackoverflow.com/q/29739380
tags question: http://stackoverflow.com/q/29734636
tags question: http://stackoverflow.com/q/29761368
tags question: http://stackoverflow.com/q/29699311
tags question: http://stackoverflow.com/q/29759717
tags question: http://stackoverflow.com/q/29794424
tags question: http://stackoverflow.com/q/29824031
tags question: http://stackoverflow.com/q/29795899
tags question: http://stackoverflow.com/q/29836686
tags question: http://stackoverflow.com/q/29766346
tags question: http://stackoverflow.com/q/29795255
tags question: http://stackoverflow.com/q/29736289
tags question: http://stackoverflow.com/q/29754737
tags question: http://stackoverflow.com/q/29780446
tags question: http://stackoverflow.com/q/29689522
tags question: http://stackoverflow.com/q/29731191
tags question: http://stackoverflow.com/q/29812524
tags question: http://stackoverflow.com/q/29845018
tags question: http://stackoverflow.com/q/29792199
tags question: http://stackoverflow.com/q/29702552
tags question: http://stackoverflow.com/q/29768561
tags question: http://stackoverflow.com/q/29751617
tags question: http://stackoverflow.com/q/29769906
tags question: http://stackoverflow.com/q/29775712
tag name: canvas
tags question: http://stackoverflow.com/q/29726315
tags question: http://stackoverflow.com/q/29732995
tags question: http://stackoverflow.com/q/29719246
tags question: http://stackoverflow.com/q/29734590
tags question: http://stackoverflow.com/q/29803489
tags question: http://stackoverflow.com/q/29817923
tags question: http://stackoverflow.com/q/29770093
tags question: http://stackoverflow.com/q/29774572
tags question: http://stackoverflow.com/q/29722882
tags question: http://stackoverflow.com/q/29739914
tags question: http://stackoverflow.com/q/29728631
tags question: http://stackoverflow.com/q/29833182
tags question: http://stackoverflow.com/q/29741772
type: Tag
tags question: http://stackoverflow.com/q/29741297
tags question: http://stackoverflow.com/q/29692134
tags question: http://stackoverflow.com/q/29718829
tags question: http://stackoverflow.com/q/29825933
tags question: http://stackoverflow.com/q/29741075
tags question: http://stackoverflow.com/q/29814895
tags question: http://stackoverflow.com/q/29766083
tags question: http://stackoverflow.com/q/29793543
tags question: http://stackoverflow.com/q/29807957
tags question: http://stackoverflow.com/q/29711487
tags question: http://stackoverflow.com/q/29813222
tags question: http://stackoverflow.com/q/29835274
tags question: http://stackoverflow.com/q/29724858
tags question: http://stackoverflow.com/q/29745562
tags question: http://stackoverflow.com/q/29732805
tags question: http://stackoverflow.com/q/29838206
tags question: http://stackoverflow.com/q/29785566
tags question: http://stackoverflow.com/q/29823285
tags question: http://stackoverflow.com/q/29793689
tags question: http://stackoverflow.com/q/29691481
tags question: http://stackoverflow.com/q/29829106

http://stackoverflow.com/comment/47696692
score: 0
comment on: http://stackoverflow.com/q/29783339
type: QuestionComment
has text: Do you have error reporting turned on for your code ?
type: Comment

http://stackoverflow.com/comment/47742097
type: AnswerComment
comment on: http://stackoverflow.com/a/29806309
type: Comment
has text: Pretty sure it's meant to be *visibility* and not *visible*.
score: 0

http://stackoverflow.com/comment/47763738
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29811007
has text: @Redrif Well the string can potentially be anything unsafe possible (it's user generated) and i want to swap specific word in this unsafe string for inline-block element. Yes HTML tags is the problem, replace only words is pretty straight forward. How it must look on display you can see in question itself. this ASCII rectangle is inline-block element displayed as HTML, div's on the sides are escaped to plain text unsafe divs. Again i know how to find and replace, i do not know how to make old parts plain text and new part - HTML

http://stackoverflow.com/comment/47751075
has text: Okay so this enables the field BUT how do I proceed to submit right after enabling?
comment on: http://stackoverflow.com/a/29792441
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47722383
score: 1
type: AnswerComment
has text: @3000 Then, the last part of my answer should be applicable :D
comment on: http://stackoverflow.com/a/29796192
type: Comment

http://stackoverflow.com/q/29821038
score: 1
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29821309
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has title: Fetch contenteditable=true data
has comment: http://stackoverflow.com/comment/47768536
has body: I want to fetch data from div tag which set contenteditable=true I have used autosuggestion in that..Data is successfully fetched but when I write item which is written in autosuggestion field then it wont be fetched because it add HTML tag and it wont save into database My code if data is changed: var timeoutID; $('[contenteditable]').bind('DOMCharacterDataModified', function () { clearTimeout(timeoutID); $that = $(this); timeoutID = setTimeout(function () { $that.trigger('change') }, 50) }); $('[contentEditable]').bind('change', function () { getTextChangeContent(); }); UPDATE function getTextChangeContent() { var ma = document.getElementById('myAudio'); var remove = ma.src.slice(0, -4); var path = remove.substring(remove.lastIndexOf("/") + 1); var newPath = path.concat('.wav'); var text_id = document.getElementById('textbox'); var textdata = text_id.innerHTML; $.ajax( { type: "POST", url: '@Url.Action("getChangeContent")', dataType: "json", mtype: "post", data: { arg: varid, content: textdata, path: newPath }, async: true, success: function (data) { alert(data + " DATA"); } }); } when I changed data and use autosuggestion then it will show data as The door is blacl &lt;span class="atwho-inserted"&gt;Ceilings&lt;/span&gt;&amp;nbsp; How to ignore html tag and take only values of that? Plz suggest me
accepted answer: http://stackoverflow.com/a/29821309
has comment: http://stackoverflow.com/comment/47768396
type: AnsweredQuestion

http://stackoverflow.com/q/29766164
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29766238
tagged with: ionic-framework
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29766238
score: 0
answer count: 1
favorite count: 0
has title: How to load login page as first page
tagged with: angularjs
has body: I am using ionic framework. I am trying to load login page as first page but cant see its just getting an empty page. My code looks like app.js: app.config(function ($stateProvider, $urlRouterProvider) { $stateProvider .state('app', { url: "/app", abstract: true, templateUrl: "templates/menu.html", controller: 'AppCtrl' }) and controller: .controller('AppCtrl', function ($scope, $state, $ionicModal) { $ionicModal.fromTemplateUrl('templates/login.html', function(modal) { $scope.loginModal = modal; }, { scope: $scope, animation: 'slide-in-up', focusFirstInput: true } ); //Be sure to cleanup the modal by removing it from the DOM $scope.$on('$destroy', function() { $scope.loginModal.remove(); }); .controller('LoginCtrl', function ($scope, $state, AuthenticationService) { $scope.message = ""; $scope.user = { username: null, password: null }; $scope.login = function () { AuthenticationService.login($scope.user); }; $scope.$on('event:auth-loginRequired', function (e, rejection) { console.log('handling login required'); $scope.loginModal.show(); }); $scope.$on('event:auth-loginConfirmed', function () { $scope.username = null; $scope.password = null; $scope.loginModal.hide(); }); But still cant see it. my app looks like https://github.com/keithdmoore/ionic-http-auth but without the home page. Thnx!
linked to: http://stackoverflow.com/q/29770861
upvote count: 1

http://stackoverflow.com/a/29770633
type: Answer
downvote count: 6
upvote count: 46
score: 40
has comment: http://stackoverflow.com/comment/70025610
has comment: http://stackoverflow.com/comment/67006498
accepted answer of: http://stackoverflow.com/q/29770191
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29770191
has body: Thargor pointed me out in the right direction: gulp.task('doSomething', function() { var fileContent = fs.readFileSync("path/to/file.something", "utf8"); return gulp.src(dirs.src + '/templates/*.html') .pipe(myFunction(fileContent)) .pipe(gulp.dest('destination/path')); });

http://stackoverflow.com/q/29779962
tagged with: angularjs-service
has body: Say I have a webapplication which has 4 components. As in there's a left navigation/sidebar with links to those 4 components, and whenever I click on one of them the main content div gets updated with the view of that component (ui-view). Now I'd like to update the titlebar on top of the page whenever I change to another component. The titlebar is part of the following module (which is the module that's being used at the tag / it loads all the other modules): 'use strict'; angular.module('sycf', [ 'ngResource', 'ui.router', 'sycf.booksModule', 'sycf.gamesModule', 'sycf.moviesModule', 'sycf.tvModule', 'sycf.appRoutes' ]); angular.module('sycf').controller('sycfCtrl', function ($scope,titleService){ $scope.title = titleService.get(); }); angular.module('sycf').factory('titleService', function () { var title = ''; return { set: function (newTitle) { console.log("Setting new title."); title = newTitle; }, get: function () { console.log("Getting new title."); return title; } } }); And as you can see I've tried solving it with a service. In another controller (in a different module) I use titleService.set("something") whenever the controller for a component gets loaded. 'use strict'; angular.module('sycf.booksModule', ['ngResource', 'ui.router', 'sycf']); angular.module('sycf.booksModule').controller('bookCtrl', function ($scope, titleService) { $scope.book = "Brave New World"; //testvalue titleService.set("Books"); }); Now I don't know how I can make it so the titleService.get(); in the sycfCtrl gets called everytime I move to another view (click on another component in the sidebar/navigation menu). Or there might just be an entirely different way which might make this a lot easier.
has answer: http://stackoverflow.com/a/29780419
tagged with: angularjs
has title: Update $scope on controller from a module when a function is called on another controller in another module
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47690188
has answer: http://stackoverflow.com/a/29780691
has comment: http://stackoverflow.com/comment/47690277
type: Question
has answer: http://stackoverflow.com/a/29780458
tagged with: javascript
tagged with: angularjs-scope
score: 0
answer count: 3

http://stackoverflow.com/comment/47529468
type: Comment
type: QuestionComment
has text: @Doodlebunch that will work fine. Because the `data` values are stored in an object you can use any type you like, not just a string.
comment on: http://stackoverflow.com/q/29696709
score: 0

http://stackoverflow.com/comment/47605829
comment on: http://stackoverflow.com/q/29704872
has text: Curious to know what problem you're trying to solve there.. seems like this would be prone to failures.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/29694909
downvote count: 0
has body: We have some collections inside MongoDB which are dynamic, they follow a pattern like "XX_YY" but there can be hundreds of collections like theese. We can get the pattern by querying inside db.patterns collection, but I don't know how can we find thoose patterns inside db.patterns and then query thoose we want inside MongoDB, an example in MongoDB would be something like this var collections = db.patterns.find(); db.getCollection(collections[0]).find(); How can I achieve this in MeteorJS?
type: Question
tagged with: mongodb
has title: Meteor dynamic MongoDB Collections
has comment: http://stackoverflow.com/comment/47529226
tagged with: javascript
has answer: http://stackoverflow.com/a/29697412
upvote count: 2
has comment: http://stackoverflow.com/comment/47601196
answer count: 1
tagged with: meteor
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
score: 2

http://stackoverflow.com/a/29789283
answers question: http://stackoverflow.com/q/29789089
has body: You need to loop through the array to compare. Second thing your condition is not written in desired way. if(Hash.indexOf(arr)) .indexOf() gives -1 for not found else &gt; -1. In js 0 is false and other numbers are true hence you always get the true alert. var Hash = 'http://example.com/place/england', arr = ['/place/']; var i = arr.length; while (i--) if (-1 &lt; Hash.indexOf(arr[i])) alert('found, ' + arr[i]); else alert('not found, ' + arr[i]);
type: Answer
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29789089

http://stackoverflow.com/comment/47601447
has text: A session is not going to help. If you want to find out, in JavaScript, whether there are new rows available without refreshing the page, you need AJAX.
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29733383

http://stackoverflow.com/a/29728520
downvote count: 0
has comment: http://stackoverflow.com/comment/76745773
has comment: http://stackoverflow.com/comment/50751753
upvote count: 8
type: Answer
score: 8
has comment: http://stackoverflow.com/comment/50751845
accepted answer of: http://stackoverflow.com/q/29728254
has body: Event delegation is the right way to do it and @Tushar has the answer for you. But, if you were after something like this: $('&lt;div /&gt;', { class: 'something', id: 'btnHome' onClick: 'return true' }) Then, you may do: $('&lt;div/&gt;', { 'text': 'new', 'class': 'something', 'id': 'btnHome' }).on({ 'click': function() { alert ("clicked") } }); Demo@Fiddle As squint suggests in one of the comments below, you could also use click as an attribue just like text or id as the following. $('&lt;div/&gt;', { 'text': 'new', 'class': 'something', 'id': 'btnHome', 'click': function() { alert ("clicked") } });
has comment: http://stackoverflow.com/comment/47618684
answers question: http://stackoverflow.com/q/29728254
has comment: http://stackoverflow.com/comment/50751893
type: AcceptedAnswer

http://stackoverflow.com/q/29813330
favorite count: 0
tagged with: vertical-scrolling
tagged with: fullpage.js
type: UnansweredQuestion
tagged with: scroll
tagged with: horizontal-scrolling
has answer: http://stackoverflow.com/a/29822757
score: 2
downvote count: 0
type: Question
upvote count: 2
has body: I am hoping someone can help me with my issue below. I am using Fullpage.js (https://github.com/alvarotrigo/fullPage.js/) plugin to create a site where pages move horizontally. The plugin is designed to create full page sites where it vertically scrolls through each section, by scrolling or pressing down the keys, just like a parallax site. In my file, I am only using the one section with left and right arrows to contain my multiple pages for horizontal scrolling. Like the example on http://alvarotrigo.com/fullPage/examples/scrolling.html Since I don't have multiple sections, when I hit the up/down keys it doesn't scroll the content at all. Any suggestions would be greatly appreciated. Thanks in advance!
answer count: 1
tagged with: javascript
has title: Fullpage.js - Vertical Scroll with Keyboard

http://stackoverflow.com/comment/47913846
comment on: http://stackoverflow.com/a/29748606
type: AnswerComment
has text: Better yet, load the html page yourself in a browser. Then paste the current section in your original question for me please.
type: Comment
score: 0

http://stackoverflow.com/q/29739671
tagged with: jquery
tagged with: asynchronous
has answer: http://stackoverflow.com/a/29740431
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47613321
has title: How to wait until the async function is done and then continue the cycle?
has body: Can you guys help me? I need to wait until the async function is done in cycle and then continue the cycle. I want to get url of attachment file, and then insert it into html. function getProjects(){ $.ajax({ url: "/_api/web/lists/getbytitle('Projects')/items?$orderby=Title asc", method: "GET", headers: { "accept": "application/json;odata=verbose" }, success: function (data){ var items = data.d.results; var result = ''; for (var i = 0; i < items.length; i++) { result += ' '; result += ' '+items[i].Organization+' '; result += ' '+items[i].Title+' '; result += ' '+items[i].Contact+' '; result += ' '+items[i].Description+' '; result += ' '+items[i].Manager+' '; result += ' '+items[i].Participates+' '; getAttachments(items[i].Id).done(function(url){ console.log('1'); }); console.log('2'); result += ' '; } $('#tableProjects').html(result); }, error: function (err) { alert(JSON.stringify(err)); } }); }
downvote count: 1
has comment: http://stackoverflow.com/comment/47612516
type: Question
has answer: http://stackoverflow.com/a/29739986
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/29739742
tagged with: sharepoint
has comment: http://stackoverflow.com/comment/47612509
answer count: 3
upvote count: 0

http://stackoverflow.com/comment/47722467
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29797170
type: Comment
has text: I already know where to do. I just want to know how re-bind all Bootstrap controls at once. Since loaded HTML is dynamic it may contain any Bootstrap javascript control.

http://stackoverflow.com/comment/47676685
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29773007
has text: possible duplicate of [Smooth scroll to div id jQuery](http://stackoverflow.com/questions/19012495/smooth-scroll-to-div-id-jquery)

http://stackoverflow.com/comment/47807414
type: Comment
comment on: http://stackoverflow.com/a/29840586
score: 0
type: AnswerComment
has text: Is JSON.parse the only way out?

http://stackoverflow.com/comment/47516746
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29689981
has text: you asked same question yesterday then delete . i have created demo of that . do you have yesterdays fiddle link ?? my demo also working

http://stackoverflow.com/a/29690981
has body: That return statement in the forEach callback function will not return a value from the $scope.cardCategories, it returns something from the callback you provided to forEach (and angular happily ignores it). Try something like this: $scope.cardCategories = function(id) { var i = $scope.categoryFilter.length; // assuming it's an array while(i--) { if($scope.categoryFilter[i].id === id) { return $scope.categoryFilter[i].name; } } }; Also -- there's no way to break (stop early) an angular.forEach loop, so for performance reasons it's better to avoid it if you're locating something inside an array/object.
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47542280
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29689826
answers question: http://stackoverflow.com/q/29689826

http://stackoverflow.com/a/29698165
answers question: http://stackoverflow.com/q/29697872
has body: var yourJSON = {"prey": [ { "distance": 8.686924173343307, "signal": "-59", "frequency": 2447, "mac": "00:00:00:00:00:00", "ip": "192.168.43.27" } ] }; var newDistance = 8.69; if (yourJSON["prey"][0]["mac"] &amp;&amp; yourJSON["prey"][0]["ip"]) { yourJSON["prey"][0]["distance"] = newDistance; } If the values for "mac" and "ip" exist i.e. they are not an empty string, false, 0, null, undefined, the condition is satisfied. In the condition block you can assign a new value. This is just a very simple example. You have to adapt it and expand it according to your needs.
type: Answer
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29697872

http://stackoverflow.com/q/29725424
type: Question
downvote count: 0
tagged with: javascript
has title: Youtube API User History (Playlistitems) without Authorization
answer count: 1
has answer: http://stackoverflow.com/a/29725530
favorite count: 0
has comment: http://stackoverflow.com/comment/47585123
tagged with: youtube-api
tagged with: youtube
type: AnsweredQuestion
has body: I'm trying to retrieve the watch history data of my own Youtube account using the Youtube Javascript API. I am using the auth.js listed here. I have made everything work, but it requires authorization (website asks you to login with a Google account so other people cannot view what i'm displaying without logging into my Youtube account). I'm looking for a way for a website to display my Youtube history data without authorization. Reading similar questions here and googling seems to suggest that it's not possible with just Google Client API. If anyone knows a way to do this or where I should look for, please let me know. I'm new to web stuff so any help will be appreciated! Thanks
score: 1
accepted answer: http://stackoverflow.com/a/29725530
upvote count: 1

http://stackoverflow.com/q/29839259
accepted answer: http://stackoverflow.com/a/29839338
type: Question
has answer: http://stackoverflow.com/a/29839550
has title: How to load page only once
has answer: http://stackoverflow.com/a/29839338
has answer: http://stackoverflow.com/a/29839320
has answer: http://stackoverflow.com/a/29839330
downvote count: 2
has comment: http://stackoverflow.com/comment/47804856
tagged with: javascript
favorite count: 0
answer count: 5
upvote count: 4
has body: Below is my code but page load continuously,i want to load only once window.onload = function () { window.location.reload(); }
score: 2
possible better answer: http://stackoverflow.com/a/29839330
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29839557
has comment: http://stackoverflow.com/comment/47804797

http://stackoverflow.com/q/29694908
type: AnsweredQuestion
tagged with: knockout-components
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47526222
tagged with: knockout.js
type: Question
has comment: http://stackoverflow.com/comment/47526198
has body: I'm trying to create a page using knockout components, and I'm having some trouble trying to bind multiple components in a page if they aren't added at the same time. As far as I can see I have no way to directly access the viewmodel of the component, to bind it to the specific element. ko.applyBindings(viewModel, document.getElementById("component1")); My problem is that, since I thus have to use the more general ko.applyBindings() if I add another component to the page at a later time, and want to bind it, I receive the "You cannot apply bindings multiple times to the same element." error. Is there any way for me to access a components view model and apply it directly? $('body').append('&lt;div id="compoent1" data-bind=\'component: { name:"someComponent"\}'&gt;&lt;/div&gt;') ko.applyBindings(viewModel/*How do I get this?*/, document.getElementById("component1")); I've tried just using ko.applyBindings(document.getElementById("component1")); My explanations is perhaps somewhat hard to understand, here is pseudo code of what I am trying to do: Add a knockout component Apply bindings for the knockout component .... some time later in my single page application Add another knockout component Apply bindings for the new knockout component
has title: Knockout Components - Cannot apply bindings more than once
tagged with: javascript
has answer: http://stackoverflow.com/a/29695098
has comment: http://stackoverflow.com/comment/47526181
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/29695098
favorite count: 0

http://stackoverflow.com/q/29824312
type: Question
has comment: http://stackoverflow.com/comment/47776138
score: 0
tagged with: activexobject
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47775417
has body: i was using ActiveXObject in my code is for IE. Now i would like run my application in browser independence. I found in google that ActiveX is not a requirement for browser independence and also that many functions already works in IE if i eliminate the activeX coding and uses the chrome and firefox coding. But i have no idea to how to remove. can any one help me. Here is my code snippet if (typeof (xmlDoc.transformNode) != "undefined") { // IE6, IE7, IE8 return xmlDoc.transformNode(xsltDoc); } else { try { // IE9 and greater if (window.ActiveXObject) { var xslt = new ActiveXObject("Msxml2.XSLTemplate"); var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument"); xslDoc.loadXML(xsltDoc.xml); xslt.stylesheet = xslDoc; var xslProc = xslt.createProcessor(); xslProc.input = xmlDoc; xslProc.transform(); return xslProc.output; } Regards
has comment: http://stackoverflow.com/comment/47776254
has title: how to run browser independence in java script without using ActiveXObject
answer count: 0

http://stackoverflow.com/q/29817694
downvote count: 1
type: Question
tagged with: javascript
has body: I'm looking for a good process of authentication in a SPA. I think that the process what dewastator describes in this question seems good but the process of the article what thierry templier presentes in his answer seems more complex as it uses 'mac_key', 'refresh_token' and so on. Is it not enough just to use login ID, password and access token for authentication? I'm not thinking to make APIs enable cross origin requests
score: 0
has answer: http://stackoverflow.com/a/29974653
tagged with: single-page-application
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29974653
has title: The secure enough and simplest way of authentication for SPA
tagged with: oauth
type: AnsweredQuestion
tagged with: oauth-2.0
linked to: http://stackoverflow.com/q/28951509
tagged with: authentication
upvote count: 1

http://stackoverflow.com/comment/47536042
has text: The reason it is failing is exactly as I said, he is quitting the original browser not the forked one. Although he can explicitly quit the forkNewDriverInstance that isnt actually the best solution for what he wants to achieve and why he forked it (from the comment). A better solution is to use a single driver instance and switch frames (to avoid call conflicts) and quit the frames he no longer requires.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29697631

http://stackoverflow.com/a/29719363
type: Answer
has comment: http://stackoverflow.com/comment/47574310
upvote count: 6
has comment: http://stackoverflow.com/comment/47574169
downvote count: 1
has comment: http://stackoverflow.com/comment/47574509
has comment: http://stackoverflow.com/comment/47574673
has comment: http://stackoverflow.com/comment/47582256
has body: Ok. I have made a fiddle fo you because it was fun and nice practise (and something I will keep for any future necesity) and because you may use it to achieve what you want. First the HTML which is quite basic: X and easy to understand. Basically on a relative container You place your triangles (one each div) with position absolute. I have used css shapes for the triangles but I DO recomend for your example, specially as you may use images inside the shapes to better use plain images with transparent background on a normal shape div. then position the elements till you get what you want. so I have use the comun class shape to get the comon css properties: shape { width: 0; height: 0; border-left: 58px solid transparent; border-right: 58px solid transparent; border-bottom: 100px solid red; position:absolute; transform-origin: center; } and then the "x" classes to position the elements in place as this one: .x1 { transform: rotate(90deg); left:0; top:50px; } If You use triangular images, obviously you ignore the rotation. and I've placed the button in the middle. Then it's time for this very simple jquery: $(document).ready(function () { $('.button').click(function () { $('.x1').toggleClass("trans1"); $('.x2').toggleClass("trans2"); $('.x3').toggleClass("trans3"); $('.x4').toggleClass("trans4"); $('.x5').toggleClass("trans5"); $('.x6').toggleClass("trans6"); $('.button').toggleClass("button2") }); }); which basically adds and removes a class to every element when you click the button. Now you just have to use the new classes to reposition the elements and create the effect you want... use the button new class to (for example) change the background image of your button (burger for cross) and just add a simple transition like: transition: all 1s linear; Here you have the FIDDLE. I hope this could help you in your project. Edited: If you want your elements to "close" with transition, add the property to the original classes and not to one created by the jquery. (I just l…
score: 5
has comment: http://stackoverflow.com/comment/47582351
answers question: http://stackoverflow.com/q/29717765

http://stackoverflow.com/comment/47691801
comment on: http://stackoverflow.com/q/29780131
score: 0
type: Comment
has text: That's really strange, I wonder why it works on other times that I've done it that exact way previously. Is it because in other cases I'm using the function only with values obtained in the object itself? but when access a global variable it needs to have a different name?
type: QuestionComment

http://stackoverflow.com/comment/47607239
has text: getCanvasCoordinates, takeSnapshot and restoreSnapshot are not defined. Did you forget to include those?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29734590

http://stackoverflow.com/comment/125573957
comment on: http://stackoverflow.com/a/66736212
type: AnswerComment
type: Comment
score: 0
has text: @MarcesEngel Depends on what you pass to the useCallback's array.

http://stackoverflow.com/a/29812404
score: -1
has comment: http://stackoverflow.com/comment/47752928
answers question: http://stackoverflow.com/q/29812338
type: Answer
downvote count: 1
upvote count: 0
has comment: http://stackoverflow.com/comment/47752820
has body: would JSON.stringify({datasize: '1024'}) do the trick? just a guess

http://stackoverflow.com/a/29819277
type: Answer
accepted answer of: http://stackoverflow.com/q/29818935
answers question: http://stackoverflow.com/q/29818935
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has body: The W3C validator is complaining about the contents of

http://stackoverflow.com/q/29702943
has comment: http://stackoverflow.com/comment/47541607
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47541744
has comment: http://stackoverflow.com/comment/47541720
has comment: http://stackoverflow.com/comment/47541588
type: Question
has comment: http://stackoverflow.com/comment/47541737
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29703027
has comment: http://stackoverflow.com/comment/47541681
has body: In my webpage from donain A I show another website from domain B in an iframe. I think website B can choose some fresh colors so I want to edit the background color of the body and change it to blue. If I try this with javascript by getting the DOM of the iframe, and then editing the body's background color, I get a security error because website B is on another domain. If open up the developer tools (F12) and I just edit the dom there it works fine. So I'm really confused: why would a browser allow me to edit the dom by hand, but not by javascript? Obviously any kind of security measures this cross domain policy is supposed to imply is compromised by anybody who can press F12, thus it makes no sense for the browser to block access. Alternatively, I could just scrape website B with my server, and put the (illegally) retrieved HTML inside my own website (with a nicer color). Again I bypassed the cross domain policy and thus did what the cross domain policy forbids me to do. As a related question, is there anyway to change the color of an element with javascript inside an iframe without getting a cross domain error?
tagged with: javascript
tagged with: xss
linked to: http://stackoverflow.com/q/21692646
possible better answer: http://stackoverflow.com/a/29703027
has comment: http://stackoverflow.com/comment/47541763
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47541691
has answer: http://stackoverflow.com/a/29703057
has title: Why can javascript not alter the dom of an iframe, but the browser tools can?
tagged with: iframe
linked to: http://stackoverflow.com/q/3076414
has comment: http://stackoverflow.com/comment/47541605
accepted answer: http://stackoverflow.com/a/29703057
has comment: http://stackoverflow.com/comment/47541786

http://stackoverflow.com/a/62818682
answers question: http://stackoverflow.com/q/29745586
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/111090045
score: 4
has body: For mm:ss to seconds myVar = moment.duration(`00:${'02:00'}`).asSeconds()//mm:ss to seconds
upvote count: 5

http://stackoverflow.com/q/29692781
tagged with: javascript
has body: I have a simple upload box: &lt;input type="file" id="signature" /&gt; And use this jQuery: $('#save').click(function() { var element = $('#signature'); if (element.files &amp;&amp; element.files[0]) { console.log("Can read image"); } else { console.log("Failure"); } } It always hits "Failure". What am I doing wrong?
upvote count: 1
answer count: 1
tagged with: jquery
has title: Read file upload - jQuery or Javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47522215
has comment: http://stackoverflow.com/comment/47522275
accepted answer: http://stackoverflow.com/a/29692920
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29692920
type: Question

http://stackoverflow.com/comment/47668195
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29767951
has text: Thanks! This not only answers my question, but it also clears up a misconception that I had about hoisting. Very helpful
type: AnswerComment

http://stackoverflow.com/a/35383967
type: Answer
upvote count: 9
score: 9
answers question: http://stackoverflow.com/q/29800058
downvote count: 0
has body: You need to create a custom binder for that: rivets.binders['style-*'] = function(el, value){ el.style.setProperty(this.args[0], value); }; ... then ... &lt;p rv-style-left="item.x" rv-style-top="item.top"&gt;

http://stackoverflow.com/comment/47814081
type: AnswerComment
score: 0
type: Comment
has text: @JohannesReuter: a CSRF token could not be forged by the cracker using cURL.
comment on: http://stackoverflow.com/a/29842333

http://stackoverflow.com/comment/47680213
has text: @formix it depends on how the URL gets to the "href" property of the DOM node. In the OP, it's getting there via HTML markup, so the HTML parser will interpret the entity notation while it's *parsing* the `` tag. There will be no HTML entity notation in the value of the "href" attribute after the parse is completed.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29774336
type: AnswerComment

http://stackoverflow.com/comment/47608169
comment on: http://stackoverflow.com/q/29737502
score: 1
type: Comment
type: QuestionComment
has text: @DanielA.White first line?

http://stackoverflow.com/a/29816248
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29815978
type: Answer
upvote count: 1
has body: Try using a $(document).ready() to call your function instead of window.onload = ... this ensures that jQuery has correctly been loaded. Example: $(document).ready(get_spotify);

http://stackoverflow.com/comment/47809989
comment on: http://stackoverflow.com/q/29841884
has text: Why are you trying to reinvent the wheel? :-s The task is not that simple that it sounds..
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47782151
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29825011
has text: @kannanrbk If you want to use JSLint, you have to change the return value. If you're dying to use that return value, you can either use JSHint (or another linter) or create your own fork of JSLint that ignores `!0` usage with (as an example) a `/*jslint microOpt:true */` option you've coded up. I think those are your only real options.

http://stackoverflow.com/q/29688433
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I am making a simple web game where can use arrow keys to move a div around the page with the goal of colliding it with another div. The second div will then be randomly placed somewhere else on the page. My question is, how can I change to following code to relocate the second div apon collision? I have code that does this when the div is clicked $('#test').click(function() { var docHeight = $(document).height(), docWidth = $(document).width(), $div = $('#test'), divWidth = $div.width(), divHeight = $div.height(), heightMax = docHeight - divHeight, widthMax = docWidth - divWidth; $div.css({ left: Math.floor( Math.random() * widthMax ), top: Math.floor( Math.random() * heightMax ) }); }); I am looking to do this in jquery, js, or angular. Any help is appreciated.
has answer: http://stackoverflow.com/a/29688658
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47513978
has title: Randomly re-place a div element when an animated div crosses coordinates
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/47513973

http://stackoverflow.com/q/29729040
possible better answer: http://stackoverflow.com/a/29729064
type: AnsweredQuestion
has body: I am making an object. I have to assign key and value from html fields. But when I am doing that. It is giving an error "missing formal parameter". fiddle one var a= {$('[name="slt"]:checked').val():$('.key').val()} console.log(a)
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29729064
score: 0
answer count: 2
tagged with: jquery
has answer: http://stackoverflow.com/a/29729247
accepted answer: http://stackoverflow.com/a/29729247
has title: Missing formal parameter javascript

http://stackoverflow.com/comment/47535775
type: QuestionComment
has text: The `+` sign cause the string to end .. You should use **`prepared statement`** instead.. You can find help [here](http://php.net/manual/en/mysqli.quickstart.prepared-statements.php)
comment on: http://stackoverflow.com/q/29699834
score: 1
type: Comment

http://stackoverflow.com/q/29714134
has answer: http://stackoverflow.com/a/29714160
answer count: 2
upvote count: 12
tagged with: javascript
has body: I am new to Angular.js and am trying to create dynamic scope variables in AngularJs inside a for Loop. This is something as below: $scope.lists=[{listName:'list1'},{listName:'list2'}]; for(var i=0;i&lt;$scope.lists.length;i++){ var listName = $scope.lists[i].listName; listName = $parse(listName); listName.assign($scope,[]); $scope.$apply(); } The above code throws an error saying: $digest already in progress. The code works ok when used without looping just for one as done in: Setting dynamic scope variables in AngularJs - scope.&lt;some_string&gt; I ultimately am looking for $scope.list1=[] and $scope.list2=[] as 2 separate arrays. Any leads would be awesome. Thanks.
favorite count: 0
accepted answer: http://stackoverflow.com/a/29714280
tagged with: angularjs
has title: Create dynamic scope variables in AngularJs inside loop
linked to: http://stackoverflow.com/q/18875486
score: 11
linked to: http://stackoverflow.com/q/22346990
type: AnsweredQuestion
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/29714160
has answer: http://stackoverflow.com/a/29714280

http://stackoverflow.com/a/29729934
has comment: http://stackoverflow.com/comment/47608916
has comment: http://stackoverflow.com/comment/47608601
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29729814
accepted answer of: http://stackoverflow.com/q/29729814
has comment: http://stackoverflow.com/comment/47593537
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47593466
has comment: http://stackoverflow.com/comment/47594107
has comment: http://stackoverflow.com/comment/47593771
score: 1
has comment: http://stackoverflow.com/comment/47593655
has body: You can use the following JQuery functions to Remove/Edit, and also to change the text while editing to have it make more sense: $('.edit').on('click', function () { var parent = $(this).parent(); var input = parent.find('input'); if (input.attr('readonly') === 'readonly') { $(this).text('Stop Edit'); } else { $(this).text('Edit'); } input.attr('readonly', !input.attr('readonly')); }); $('.remove').on('click', function () { var parent = $(this).closest("div"); var uncle = parent.prev(); parent.remove(); uncle.remove(); }); Fiddle
downvote count: 0

http://stackoverflow.com/a/29805397
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29804151
has body: Some of the rules of the stylesheet have changed. You need to add back/modify the following rules to hubtheme-style.min.css: .hs-responsive-embed iframe, .hs-responsive-embed object, .hs-responsive-embed embed { position: absolute; left: 0; } .hs-responsive-embed, .hs-responsive-embed.hs-responsive-embed-youtube, .hs-responsive-embed.hs-responsive-embed-wistia, .hs-responsive-embed.hs-responsive-embed-vimeo { padding-bottom: 56.25%; } The best way to find these problems in the future is by beautifying the stylesheets and using a diff tool. I recommend using difftool.net since it only shows identical text that's near changes (not the rest of an enormous file).
answers question: http://stackoverflow.com/q/29804151
upvote count: 1
score: 1

http://stackoverflow.com/a/29695303
has body: I guess you need something like this var lastVisitedCookieName = 'last-visited'; if (!document.cookie.contains(lastVisitedCookieName)) { alert('Welcome'); setCookie(lastVisitedCookieName, "1", 20); }
accepted answer of: http://stackoverflow.com/q/29695051
answers question: http://stackoverflow.com/q/29695051
has comment: http://stackoverflow.com/comment/47527324
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/q/29712422
has comment: http://stackoverflow.com/comment/47846910
has title: KnockoutJs Updating Counters post Filter
upvote count: 1
answer count: 1
tagged with: knockout.js
accepted answer: http://stackoverflow.com/a/29870861
has comment: http://stackoverflow.com/comment/47693660
tagged with: javascript
has answer: http://stackoverflow.com/a/29870861
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I have a number of filters: FilterMessageTime = Filter on message time FilterCommentTime = Filter on comment time FilterCommentStatus = Filter on comment status FilterExcludeWithoutComments = Filter messages without comments And with these said filters (and their various combinations), I would like to keep a constant count of the messages filteredMessagesTimeCount and comments filteredCommentsTimeCount. I have the following view: Message Time: 0"> Comment Time: Comment Status: Only show messages with comments: /*Message...*/ /*Comments...*/ Total message <!-- ko if: filteredMessagesTimeCount() > 1 --> Total messages No messages in the . Total comment <!-- ko if: filteredCommentsTimeCount() > 1 --> Total comments No comments in the . Accompanied by the following JS: self.FilterMessageTime = [ { name: 'Any', include: /./, exclude: null }, { name: 'Last Hour', include: /minutes?|hour/i, exclude: /hours|days?|weeks?|months?/i}, { name: 'Last Day', include: /minutes?|hours?|day/i, exclude: /days|weeks?|months?/i}, { name: 'Last Week', include: /minutes?|hours?|days?|week/i, exclude: /and|weeks?|months?/i }, { name: 'Last Month', include: /minutes?|hours?|days?|weeks?|month/i, exclude: /months/i} ]; self.FilterCommentTime = [ { name: 'Any', include: /./, exclude: null }, { name: 'Last Hour', include: /minutes?|hour/i, exclude: /hours|days?|weeks?|months?/i }, { name: 'Last Day', include: /minutes?|hours?|day/i, exclude: /days|weeks?|months?/i }, { name: 'Last Week', include: /minutes?|hours?|days?|week/i, exclude: /and|weeks?|months?/i }, { name: 'Last Month',include: /minutes?|hours?|days?|weeks?|month/i, exclude: /months/i } ]; self.FilterCommentStatus = [ { id: 4, name: 'Any' }, { id: 2, name: 'Read' }, { id: 3, name: 'Unread' } ]; self.FilterExcludeWithoutComments = [ { id: 1, name: 'No' }, { id: 2, name: 'Yes' }, ]; self.selectedFilterMessageTime = ko.observable(self.FilterMessageTime[0]); self.selectedFilterMessageTimeOption = ko.computed(function () { return ko.uti…
favorite count: 0
has comment: http://stackoverflow.com/comment/47692644
has comment: http://stackoverflow.com/comment/47656725
type: Question
has comment: http://stackoverflow.com/comment/47636741

http://stackoverflow.com/q/29741172
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29741638
tagged with: forms
type: Question
tagged with: jquery-plugins
has body: My form contains input fields which will be validated against minimum and maximum values while submitting.The input fields will be displayed on the screen using list iteration. &lt;c:forEach var="Item" items="${listBean.nameList}" varStatus="status"&gt; &lt;input type="number"name="nameList&lt;c:outvalue='[${status.index}]'/&gt;.initialWeight" onchange="checkOnChange(this,'&lt;c:out value='${Item.personId}'/&gt;','&lt;c:out value='${Item.minWeight}'/&gt;','&lt;c:out value='${Item.maxWeight}'/&gt;','&lt;c:out value='[${status.index}]'/&gt;')"&gt; &lt;br&gt;&lt;br&gt; &lt;input type="number" name="nameList&lt;c:out value='[${status.index}]'/&gt;.finalWeight" onchange="checkOnChange(this,'&lt;c:out value='${Item.personId}'/&gt;','&lt;c:out value='${Item.minWeight}'/&gt;','&lt;c:out value='${Item.maxWeight}'/&gt;','&lt;c:out value='[${status.index}]'/&gt;')"&gt; &lt;br&gt;&lt;br&gt; &lt;input type="text" class="formtext" name="nameList&lt;c:out value='[${status.index}]'/&gt;.Reason" id ="reason&lt;c:out value='[${status.index}]'/&gt;" value="" maxlength="255" &gt; &lt;br&gt;&lt;br&gt; &lt;input type="submit" value="submit" id="submit" /&gt; &lt;/c:forEach&gt; So while submitting the form , i have all the user entered values which will be stored in the bean and also the min/ max values.i need to validate the form and prevent the user from submitting the form if any of the entered value is not within the min / max values. So i am a bit of confused on how to do this in Java script ? thanks for your suggestions and time .. JSFIDDLE
linked to: http://stackoverflow.com/q/16358112
tagged with: validation
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29741638
has title: Iterating through a bean list and validate the data in javascript

http://stackoverflow.com/a/29804315
has comment: http://stackoverflow.com/comment/47788758
has comment: http://stackoverflow.com/comment/47736419
has body: Can you move the ClearAll trigger to the end of the ajax success callback within the $("#CourseID").trigger('change') event?
answers question: http://stackoverflow.com/q/29804126
score: 0
type: Answer

http://stackoverflow.com/q/29715466
has comment: http://stackoverflow.com/comment/47565922
possible better answer: http://stackoverflow.com/a/29715613
accepted answer: http://stackoverflow.com/a/29715588
has comment: http://stackoverflow.com/comment/47565806
downvote count: 0
has title: JavaScript - Toggle CSS colors with plain JavaScript?
favorite count: 0
has comment: http://stackoverflow.com/comment/47565905
tagged with: colors
has answer: http://stackoverflow.com/a/29715588
has comment: http://stackoverflow.com/comment/47565849
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29715613
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47566004
type: Question
tagged with: javascript
has body: I'm trying to change the colors of a form text field back and forth, using plain javascript. Can somebody help? I can change the color once but not back Here is what I have done JavaScript Current ID: CSS
answer count: 2

toggle
tags question: http://stackoverflow.com/q/29691118
tags question: http://stackoverflow.com/q/29760498
type: Tag
tags question: http://stackoverflow.com/q/29700349
tags question: http://stackoverflow.com/q/29713098
tag name: toggle
tags question: http://stackoverflow.com/q/29712209
tags question: http://stackoverflow.com/q/29782017

http://stackoverflow.com/q/29842122
has answer: http://stackoverflow.com/a/29842333
tagged with: javascript
has body: Imagine the next scenario: a user wants to register to a webpage and fills a form. While he is filling the form, jQuery keeps checking through a regular expression if fields are valid, etc... Taking the email as the primary key which the user will use after registering to login, the email field needs to be checked with Ajax to let the user know if that email is registered or not. I want to check it with Ajax to avoid sending the full form and emptying it, refreshing page, etc... So, when the user has ended filling the email field, the Ajax request is sent to the server, something like the next link: example.com/check.php?email=abcdefg@gmail.com When check.php receives the email, it asks the database if it exists or not and returns a message like: User already exists if user exists or null if user does not exist. The question is: if someone digs through my .js and finds out links similar to that, they could use that link to send a large number of requests to find out if those random emails exist. This could lead to heavy use of the database or in the worst cases even crashing and private information leaks. Someone could do a huge for loop to check emails like: //Getting the response of the next links example.com/check.php?email=aaaaaaa@gmail.com // Returns null example.com/check.php?email=aaaaaab@gmail.com // Returns null example.com/check.php?email=aaaaaac@gmail.com // Returns null example.com/check.php?email=aaaaaad@gmail.com // Returns User already exists ------------------------------------------------------------------------------------------------------------------------------------ Since i last accepted the answer, i kept investigating this and found the solution to avoid this behaviour. The following code is for JAVA but the logic can be applied to any other server-side language. Before doing ANY ajax request to the server, I request a token to the server. This token looks like this fmf5p81m6e56n4va3nkfu2ns8n it is made by a simple method, it can, however, be…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47810431
has answer: http://stackoverflow.com/a/29842244
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/47810442
favorite count: 0
tagged with: ajax
score: 46
type: Question
possible better answer: http://stackoverflow.com/a/29842244
answer count: 8
has comment: http://stackoverflow.com/comment/47811070
has comment: http://stackoverflow.com/comment/47812946
has answer: http://stackoverflow.com/a/29842436
has answer: http://stackoverflow.com/a/49061739
tagged with: php
has answer: http://stackoverflow.com/a/29843341
has title: How to secure Ajax link requests?
has answer: http://stackoverflow.com/a/29842247
has answer: http://stackoverflow.com/a/29842380
upvote count: 46
accepted answer: http://stackoverflow.com/a/29842436
linked to: http://stackoverflow.com/q/9843982
has answer: http://stackoverflow.com/a/29842181
has comment: http://stackoverflow.com/comment/53756521

http://stackoverflow.com/a/29827966
upvote count: 1
answers question: http://stackoverflow.com/q/29827796
score: 1
has body: Something like this maybe: function redefineData(data) { var outData = []; for (var i = 0; i &lt; data.length; i++) { var obj = { id: data[i].eid, text: data[i].name }; if (data[i].children &amp;&amp; data[i].children.length) { obj.children = redefineData(data[i].children); } outData.push(obj); } return outData; } var treeData = redefineData(topics);
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29827796
type: Answer

http://stackoverflow.com/comment/47594835
has text: Well the very first thing to know is that if you call *your* function "Photostack", you'll *hide* the name of the library you're trying to use.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29730672
score: 1

http://stackoverflow.com/comment/47678943
has text: Nevermind, for some reason it sometimes loads the script too late (or skips it) and then it will jump back to the default layout. At least on my Android device with Chrome. I am out of ideas. Maybe a media query? But I have no idea about them at all.
comment on: http://stackoverflow.com/a/29773070
score: 0
type: AnswerComment
type: Comment

mysql
tags question: http://stackoverflow.com/q/29831231
tags question: http://stackoverflow.com/q/29795576
tags question: http://stackoverflow.com/q/29727499
tags question: http://stackoverflow.com/q/29717286
tags question: http://stackoverflow.com/q/29774601
tags question: http://stackoverflow.com/q/29721792
tag name: mysql
tags question: http://stackoverflow.com/q/29695422
tags question: http://stackoverflow.com/q/29709513
tags question: http://stackoverflow.com/q/29716009
tags question: http://stackoverflow.com/q/29705425
tags question: http://stackoverflow.com/q/29794090
tags question: http://stackoverflow.com/q/29765991
tags question: http://stackoverflow.com/q/29778061
tags question: http://stackoverflow.com/q/29838773
tags question: http://stackoverflow.com/q/29732132
tags question: http://stackoverflow.com/q/29771428
tags question: http://stackoverflow.com/q/29821694
tags question: http://stackoverflow.com/q/29802031
tags question: http://stackoverflow.com/q/29750806
tags question: http://stackoverflow.com/q/29756266
tags question: http://stackoverflow.com/q/29714789
tags question: http://stackoverflow.com/q/29799512
tags question: http://stackoverflow.com/q/29831608
tags question: http://stackoverflow.com/q/29705734
tags question: http://stackoverflow.com/q/29779020
tags question: http://stackoverflow.com/q/29764254
tags question: http://stackoverflow.com/q/29699834
type: Tag
tags question: http://stackoverflow.com/q/29817706
tags question: http://stackoverflow.com/q/29699738
tags question: http://stackoverflow.com/q/29836478
tags question: http://stackoverflow.com/q/29736610
tags question: http://stackoverflow.com/q/29768070
tags question: http://stackoverflow.com/q/29713883
tags question: http://stackoverflow.com/q/29735265
tags question: http://stackoverflow.com/q/29691812
tags question: http://stackoverflow.com/q/29833737
tags question: http://stackoverflow.com/q/29733383
tags question: http://stackoverflow.com/q/29763483
tags question: http://stackoverflow.com/q/29844047
tags question: http://stackoverflow.com/q/29805855
tags question: http://stackoverflow.com/q/29746473
tags question: http://stackoverflow.com/q/29705040
tags question: http://stackoverflow.com/q/29714175
tags question: http://stackoverflow.com/q/29763461
tags question: http://stackoverflow.com/q/29693357

http://stackoverflow.com/a/29755155
type: AcceptedAnswer
downvote count: 0
has body: I like plunker more than codepen. So I created this plunker http://plnkr.co/edit/l8gxQHXBQdFeKIuwf3f0?p=preview The main idea is that I format the original array as: $scope.allOptions = [ {key: 'one'}, {key: 'two'}, {key: 'three'}, {key:'four'} ]; And slight change to the sync logic as well: $scope.sync = function(bool, item){ if (bool) { // add item $scope.data.push(item); // if we have gone over maxItems: if ($scope.data.length &gt; maxItems) { //remove first item $scope.data[0].checked = false; $scope.data.splice(0,1); } } else { // remove item for (var i=0 ; i &lt; $scope.data.length; i++) { if ($scope.data[i] === item) { $scope.data.splice(i,1); } } } }; Also change html portion: &lt;p ng-repeat="item in allOptions" class="item" id="{{item.key}}"&gt; {{item.key}} &lt;input type="checkbox" ng-change="sync(item.checked, item)" ng-model="item.checked"&gt; Click this to sync this item with the target array. {{item.key}} Selected: {{bool}}
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29751887
answers question: http://stackoverflow.com/q/29751887

http://stackoverflow.com/comment/47684360
comment on: http://stackoverflow.com/a/29763384
type: Comment
score: 0
type: AnswerComment
has text: regarding the id, I don't see how that is impacting the fact that is not posting back to original page. However, I made the modifications recommended, but still I'm getting error ReferenceError: request is not defined. here's the part of the code the console is pointing at: request.open("POST", "contact.php", true); // set the request

http://stackoverflow.com/q/29733308
type: Question
tagged with: mysqli
has comment: http://stackoverflow.com/comment/47600414
has comment: http://stackoverflow.com/comment/47600774
tagged with: php
score: -1
has title: JQuery Ajax not interacting with MySQL
has comment: http://stackoverflow.com/comment/47604399
has comment: http://stackoverflow.com/comment/47604217
has comment: http://stackoverflow.com/comment/47600694
has comment: http://stackoverflow.com/comment/47602350
answer count: 2
has comment: http://stackoverflow.com/comment/47603238
has comment: http://stackoverflow.com/comment/47604081
downvote count: 1
has answer: http://stackoverflow.com/a/29733411
has comment: http://stackoverflow.com/comment/47600994
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29735787
upvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47600549
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47600579
has comment: http://stackoverflow.com/comment/47603000
has body: I'm attempting to make a very basic browser MMORPG with php, ajax, and jquery. However the webpages do not seem to be interacting with the MySQL server correctly. Here is my php class that defines some SQL functions: &lt;?php class Db { protected static $connection; public function connect() { if(!isset(self::$connection)) { $config = parse_ini_file('config.ini'); self::$connection = new mysqli('localhost',$config['username'],$config['password'],$config['dbname']); } if(self::$connection === false) { return false; } return self::$connection; } public function query($query) { $connection = $this -&gt; connect(); $result = $connection -&gt; query($query); return $result; } public function select($query) { $rows = array(); $result = $this -&gt; query($query); if($result === false) { return false; } while ($row = $result -&gt; fetch_assoc()) { $rows[] = $row; } return $rows; } public function error() { $connection = $this -&gt; connect(); return $connection -&gt; error; } public function quote($value) { $connection = $this -&gt; connect(); return "'" . $connection -&gt; real_escape_string($value) . "'"; } public function close() { mysqli_close(self::$connection); } } ?&gt; Along with the config.ini it references: [database] username = root password = *** dbname = *** (password and database name have been omitted but I've checked that they are correct.) Here is my validation.php file that the login uses: &lt;?php include 'DbClass.php'; $db = new Db(); $name= = $db -&gt; quote($_POST['user_name']); $pass=md5($db -&gt; quote($_POST['password'])); $rows = $db -&gt; select("select * from players where name=" . $name . " and password=" . $pass); if($rows) { echo json_encode("1"); } else { echo json_encode("0"); } ?&gt; And here is the login javascript file with the functions that are called on my index page. function login() { $("#msgbox").removeClass().addClass('messagebox').text('Validating....').fadeIn(1000); $.ajax({ url : 'scripts/php/validation.php', type : 'POST', data…

http://stackoverflow.com/q/29735990
has answer: http://stackoverflow.com/a/29736096
has comment: http://stackoverflow.com/comment/47605160
type: Question
upvote count: 2
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47605465
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47605142
downvote count: 0
type: UnansweredQuestion
has title: Using Javascript to display an input (A number) from a user to a div
has body: I have looked at the other questions that are asking similar things to this question however when I attempted to create my own I can't get it to work properly and i dont understand why. It's only very basic before I introduce it into a more complex system I just wanted to try and get the functionality done. This is my HTML; Please enter a number: Change Value And this is the JavaScript; function R1Value() { var t = document.getElementById("RValue1"); var div = document.getElementById('ShowR1'); div.innerHTML = t.value; } I have made this fiddle to save time and so you can have a look at it, http://jsfiddle.net/2ufnK/52/ I can't see why this doesn't seem to work so if anyone can see why I would really appreciate it. Thanks.
score: 2

http://stackoverflow.com/comment/47642794
score: 0
has text: Do you mean you want to detect `foo.bar.push()` calls, but not `foo._bar.push()` ones?
comment on: http://stackoverflow.com/q/29755304
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29725530
downvote count: 0
answers question: http://stackoverflow.com/q/29725424
accepted answer of: http://stackoverflow.com/q/29725424
type: Answer
has body: Very simple answer: It can not do without Authorization You can do that in different way after Authorization you can sync your youtube history with another database and show that data from fetching from that database to others
upvote count: 1
score: 1
type: AcceptedAnswer

http://stackoverflow.com/q/29729611
has answer: http://stackoverflow.com/a/29729623
downvote count: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
has body: What is best practice for debugging in JavaScript? debugging ? console.log('info') : null; My question is the null, what is standard practice for this in general, or in this debugging use case?
has title: JavaScript ternary operator calling function or no-op
type: Question
tagged with: javascript
score: 4
upvote count: 4

http://stackoverflow.com/comment/47745020
comment on: http://stackoverflow.com/a/29771467
score: 0
type: AnswerComment
has text: Alright I'll try this out and post what happens here when I get the chance. Sounds like something that shud work. I'm just clipping out the Grey and showing the green as it clips down.
type: Comment

http://stackoverflow.com/q/29788889
tagged with: http://stackoverflow.com/tag/html
has title: Calling java class from javascript written in html
has body: I have a .java class to read a mongodb collection and copy the contents into the .json file. .json file is then provided to the chart (created using Fusion Charts as it only accepts data either in json format or in xml format) written in javascripts in html and then the chart is build on the basis of the data provided to the chart. My requirement is to call a java class from java script so that it will get the data in .json file and chart would get created based on it. How to do so? public class Write { //@SuppressWarnings("null") public void connect() throws Exception{ MongoClient mongo = new MongoClient( "localhost" , 27017 ); DB db = mongo.getDB("Age"); DBCollection collection = db.getCollection("agegroup"); try{ File file = null; String content = "{ "+ " \"chart\": { \n"+ " \"caption\" : \"Weekly Sales Summary\" ,\n"+ " \"xAxisName\" : \"Week\",\n" + " \"yAxisName\" : \"Sales\",\n"+ " \"numberPrefix\" : \"$\" \n"+ "},\n"+ "\"data\":[\n"; // if file doesnt exists, then create it file = new File("C:/Users/ila/Desktop/pie.json"); file.createNewFile(); FileWriter fw = new FileWriter(file.getAbsoluteFile()); BufferedWriter bw = new BufferedWriter(fw); bw.write(content); DBObject s; String str; String delimiter=","; DBCursor cursorDoc = collection.find(); while (cursorDoc.hasNext()) { s=cursorDoc.next(); str=s.toString(); String[] str1= str.split(delimiter); bw.write("{\n"); bw.write(str1[1]+", \n"); bw.write(str1[2]+"\n"); if(cursorDoc.hasNext()) bw.write(","); System.out.println(Arrays.toString(str1)); } bw.write("]\n"); bw.write("}\n"); bw.close(); System.out.println("Done"); }catch(Exception e){ e.printStackTrace(); } } } .html code Pie chart
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29789302
has answer: http://stackoverflow.com/a/29789241
tagged with: java
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29789118
score: 0
answer count: 3

http://stackoverflow.com/comment/47723046
type: QuestionComment
comment on: http://stackoverflow.com/q/29796925
score: 0
has text: I want to do the same, but the post don't specified where and what code I've to put. Thank you.
type: Comment

http://stackoverflow.com/a/29821628
has body: You can't put your "goodbye" message directly in #myContainer because this will destroy #myObject. Add another div to hold the message: HTML: &lt;div id="mainContainer"&gt; &lt;div id="myObject"&gt;:c)&lt;/div&gt; &lt;div id="myText"&gt;&lt;/div&gt; &lt;/div&gt; CSS: #myText { position: absolute; left: 0; top: 0; right: 0; bottom: 0; } JavaScript: function doTask() { myCallback = function () { document.getElementById("mainContainer").innerHTML = "hello"; }; animateCharacter(myCallback); // WORKS FINE IF THIS IS COMMENTED OUT, // BUT I WANT MORE CODE TO EXECUTE document.getElementById("myText").innerHTML = "goodbye"; } Fiddle here: http://jsfiddle.net/robbyn/0qkt0v5r/
score: 0
has comment: http://stackoverflow.com/comment/47771526
has comment: http://stackoverflow.com/comment/47769889
answers question: http://stackoverflow.com/q/29820966
type: Answer
has comment: http://stackoverflow.com/comment/47770190

http://stackoverflow.com/comment/47726368
type: QuestionComment
comment on: http://stackoverflow.com/q/29799075
has text: can you create a jsfiddle and show it
score: 0
type: Comment

http://stackoverflow.com/q/29689507
accepted answer: http://stackoverflow.com/a/29691640
tagged with: javascript
answer count: 1
downvote count: 0
has body: I have a question regarding my programming problem, I am using ION Slider (http://ionden.com/a/plugins/ion.rangeSlider/demo_advanced.html) and Moment.js for date range operation. i need to set the specific date range and specific date range picker for my program. Whenever user changes the value it should update the database. but im having a little problem here that the slider doesnt show correct format in console.log(). Please help me with this situation. My code is, var startDate = moment("2014-01-05"); var endDate = moment("2014-01-13"); range.ionRangeSlider({ type: "double", grid: true, min: +moment(startDate).format("X"), max: +moment(endDate).format("X"), from: +moment(endDate).subtract(5, "days").format("X"), to: +moment(endDate).subtract(2, "days").format("X"), prettify: function (num) { return moment(num, "X").format("dddd, MMM Do YYYY"); } }); range.on("change", function () { var $this = $(this), from = $this.data("from"), to = $this.data("to"); console.log(from + " - " + to); }); the console log, 1389113336 - 1389373200 jquery-... &gt; eval (line 28) 1389111677 - 1389373200 jquery-... &gt; eval (line 28) 1389111345 - 1389373200 jquery-... &gt; eval (line 28) 1389109686 - 1389373200 jquery-... &gt; eval (line 28) 1389108359 - 1389373200 jquery-... &gt; eval (line 28) 1389106368 - 1389373200 jquery-... &gt; eval (line 28) 1389103713 - 1389373200 jquery-... &gt; eval (line 28) 1389102054 - 1389373200 it should show date in the console log.
favorite count: 0
tagged with: slider
tagged with: momentjs
score: 2
type: AnsweredQuestion
upvote count: 2
has answer: http://stackoverflow.com/a/29691640
has title: getting date value from ION slider with moment when user changes the value
type: Question

mocha.js
tags question: http://stackoverflow.com/q/29802117
tags question: http://stackoverflow.com/q/29785784
tags question: http://stackoverflow.com/q/29794372
tags question: http://stackoverflow.com/q/29759226
tags question: http://stackoverflow.com/q/29798049
tags question: http://stackoverflow.com/q/29697724
tags question: http://stackoverflow.com/q/29755219
tags question: http://stackoverflow.com/q/29776056
tag name: mocha.js
tags question: http://stackoverflow.com/q/29796339
tags question: http://stackoverflow.com/q/29810939
tags question: http://stackoverflow.com/q/29703353
type: Tag
tags question: http://stackoverflow.com/q/29824503
tags question: http://stackoverflow.com/q/29754459
tags question: http://stackoverflow.com/q/29766119

http://stackoverflow.com/a/29766895
answers question: http://stackoverflow.com/q/29766805
has body: I have found autocomplete to work when there is an actual form attached and its submit event was actually triggered (even if the data was sent by AJAX). I would suggest to use a form with a submit button, and intercept the submission via Javascript (attaching to the form's onsubmit event) to prevent it and do it by AJAX. Using a proper HTML form and preventing submit, instead of using just an input field, also has the benefit of activating your onsubmit handler when the user presses enter. I find that pretty useful as a user.
has comment: http://stackoverflow.com/comment/47664862
type: Answer
upvote count: 1
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47664988

http://stackoverflow.com/comment/47793322
type: QuestionComment
has text: What should the result look like?
comment on: http://stackoverflow.com/q/29833245
score: 0
type: Comment

http://stackoverflow.com/a/29835422
score: 0
has body: With youtube you can easily open the video in a modal box. With other webiste you can open a iframe modal with the entire page content. You can affect iframe with jquery to take only the video only if the other page is the same domain.
type: Answer
answers question: http://stackoverflow.com/q/29835354

http://stackoverflow.com/a/29791482
has comment: http://stackoverflow.com/comment/47716365
answers question: http://stackoverflow.com/q/29791356
type: Answer
accepted answer of: http://stackoverflow.com/q/29791356
has body: The code provided is not very good, for instance you don't know if there are 3 realcats (0,1,2) don't use json as a variable name, json is a notation, not an good variable name $.getJSON(jsonData, function(rawJsonData){ var complete =[]; var realcatCount = rawJsonData.doc[0].data[0].realcategories.length; for (realCat = 0; realCat &lt;= (realcatCount -1); realcatCount ++) { console.log(realCat); var basePath = json.doc[0].data[0].realcategories[realCat] ... The rest of your code seems ok, but not really good. Try to walk the json path as less as needed. this would be: var match = basePath.tournaments[0].matches[0]; var matchStatus = match .status._id; var homeTeam = match .teams.home.name; What you need to do is make sure your html is there BEFORE you bind it. so first generate the carrousel items, and then perform the .slick() function This way you would get: // Your existingt code.. $('#results').empty().append(complete); // AND then slick it.. Delete this code from the seperate code block in your html and move it to here.. $('.slider').slick({ dots: true, arrows: false, infinite: true, speed: 300, slidesToShow: 1, adaptiveHeight: true, fade: true, cssEase: 'linear' }); Your problem is that .slick is called BEFORE the html is there (it is derived from a web url) first create the html, and append it then do .slick The resulting (working) code: https://jsfiddle.net/aeuuymuy/12/
has comment: http://stackoverflow.com/comment/47717469
has comment: http://stackoverflow.com/comment/47716139
has comment: http://stackoverflow.com/comment/47714656
has comment: http://stackoverflow.com/comment/47712400
has comment: http://stackoverflow.com/comment/47722358
has comment: http://stackoverflow.com/comment/47723644
score: 0
has comment: http://stackoverflow.com/comment/47713311
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47717267
has comment: http://stackoverflow.com/comment/47717518
has comment: http://stackoverflow.com/comment/47714303

http://stackoverflow.com/comment/47577988
score: 0
type: Comment
type: QuestionComment
has text: there is setting on left in jsFiddle change it to no wrap- in head the add row would work.. while I am looking into the code
comment on: http://stackoverflow.com/q/29718750

http://stackoverflow.com/a/29753658
answers question: http://stackoverflow.com/q/29753380
upvote count: 3
type: AcceptedAnswer
downvote count: 0
has body: Try this. public string getJson() { var publicationTable = new[] { new[] { 1, 2, 3, 4, 5 }, new[] { 6, 7, 8, 9, 10 } }; return (new JavaScriptSerializer()).Serialize(publicationTable); }
type: Answer
accepted answer of: http://stackoverflow.com/q/29753380
score: 3

http://stackoverflow.com/comment/47574980
has text: possible duplicate of [How to force a Download File prompt instead of displaying it in-browser with HTML?](http://stackoverflow.com/questions/23825871/how-to-force-a-download-file-prompt-instead-of-displaying-it-in-browser-with-htm)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29720170
score: 0

http://stackoverflow.com/q/29719441
answer count: 1
downvote count: 1
tagged with: angular-http
linked to: http://stackoverflow.com/q/9772933
has comment: http://stackoverflow.com/comment/47576827
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47577074
has comment: http://stackoverflow.com/comment/47574538
has body: I'm a full-time backend developer just starting to learn angular for some of my own projects. By default it seems angular $http requests are sent as JSON strings. I am currently overriding the transformRequest method to parameterize it like jquery. Its more convenient for my backend framework (Phalcon PHP) to receive it this way. Before I commit to this path, are there any cons to structuring it this way? Any problems unit testing or using third-party modules? Edit To clarify, angular sends POST as JSON string in the body. jQuery and other frameworks I've used send as form-urlencded like: Name=Jonathan+Doe&amp;Age=23&amp;Formula=a+%2B+b+%3D%3D+13%25%21 http://en.wikipedia.org/wiki/POST_%28HTTP%29#Use_for_submitting_web_forms Which, perhaps due to the content header populates the $_POST global in php (I assume) with the form data;
score: 2
has title: Pros and cons of parameterizing angular request
has answer: http://stackoverflow.com/a/29723517
type: Question
tagged with: javascript
upvote count: 3
has comment: http://stackoverflow.com/comment/47573681

http://stackoverflow.com/a/29750387
accepted answer of: http://stackoverflow.com/q/29750235
answers question: http://stackoverflow.com/q/29750235
score: 3
downvote count: 0
type: AcceptedAnswer
has body: Yes, exactly. From the spec: A stack is used to track execution contexts. The running execution context is always the top element of this stack. A new execution context is created whenever control is transferred from the executable code associated with the currently running execution context to executable code that is not associated with that execution context. The newly created execution context is pushed onto the stack and becomes the running execution context.
upvote count: 3
type: Answer

http://stackoverflow.com/comment/47628248
has text: It is to increment the div id on every call to spawnDiv. The id is passed to eraseDiv function so that it knows which div to be deleted similar to @James method of passing this .
comment on: http://stackoverflow.com/a/29737757
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/47806298
comment on: http://stackoverflow.com/a/29824114
type: Comment
score: 0
type: AnswerComment
has text: how to add yes/no button in this alertbox

http://stackoverflow.com/q/29787964
answer count: 2
has comment: http://stackoverflow.com/comment/47705662
tagged with: css-selectors
has comment: http://stackoverflow.com/comment/47705424
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/6345358
has comment: http://stackoverflow.com/comment/47705992
has comment: http://stackoverflow.com/comment/47705587
favorite count: 0
has comment: http://stackoverflow.com/comment/47705489
has answer: http://stackoverflow.com/a/48081741
tagged with: selectors-api
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47705438
upvote count: 3
has comment: http://stackoverflow.com/comment/47705704
has comment: http://stackoverflow.com/comment/47705802
type: Question
score: 3
has title: Build the querySelector string value of any given node in the DOM
possible better answer: http://stackoverflow.com/a/69135997
accepted answer: http://stackoverflow.com/a/48081741
has comment: http://stackoverflow.com/comment/130332383
has answer: http://stackoverflow.com/a/69135997
has comment: http://stackoverflow.com/comment/47705373
has comment: http://stackoverflow.com/comment/47721218
tagged with: dom
has comment: http://stackoverflow.com/comment/47705515
has comment: http://stackoverflow.com/comment/47739214
has body: I am trying to find a way to build the querySelector string of any given node. In other words - pick any node on a page - is it possible to walk up the DOM and build a string that would allow me to pass the generated string to document.querySelector and get back the node I chose? From what I can tell querySelector has a bug where you can only use nth-child once in the string. I have tried several times but so far have failed to find a solution. I want to do this in native JavaScript, not jQuery.Any suggestions?

http://stackoverflow.com/comment/47656281
score: 0
comment on: http://stackoverflow.com/a/29761794
type: AnswerComment
type: Comment
has text: This answer is completely wrong, in most cases. It's much better to minimize HTTP requests. There is no performance hit to including a few bytes of extra JavaScript on each page.

http://stackoverflow.com/comment/47672410
type: Comment
has text: Is possible to override this default behavior?
comment on: http://stackoverflow.com/a/29770277
score: 0
type: AnswerComment

http://stackoverflow.com/q/29804987
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/29805077
has answer: http://stackoverflow.com/a/29805076
has title: Passing a string value from c# file to js file
accepted answer: http://stackoverflow.com/a/29805069
has answer: http://stackoverflow.com/a/29805080
possible better answer: http://stackoverflow.com/a/29805077
upvote count: 2
has answer: http://stackoverflow.com/a/29805106
score: 2
tagged with: c#
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29805081
has body: I am trying to pass a string value from c# file to js file. If I try to pass an int value, then I can pass it, but I am unable to pass string value. string value = "abc"; int a=5; TableCell.Attributes.Add("onclick", "F1("+value +")"); //NOTHING HAPPENS TableCell.Attributes.Add("onclick", "F1("+a +")"); //Works Perfectly js file function F1(value) { alert(value); }
has answer: http://stackoverflow.com/a/29805069
type: Question
has answer: http://stackoverflow.com/a/29805149
downvote count: 0
answer count: 7
tagged with: javascript

http://stackoverflow.com/q/29783375
has title: Backbone.js and Browserify - requiring same module multiple times
favorite count: 0
tagged with: backbone.js
has answer: http://stackoverflow.com/a/29783428
accepted answer: http://stackoverflow.com/a/29783428
downvote count: 0
has body: I am currently working on a Backbone JS application, and I started using Browserify for the first time. But of course I ran into a few problematics. This is one of them. I have the following module, /js/views/Home.js. var $ = require('jquery'), _ = require('underscore'), Backbone = require('backbone'); Backbone.$ = $; module.exports = Backbone.View.extend({ el: '#view', template: _.template($('#home-template').html()), initialize: function () { this.render(); }, render: function () { this.$el.html(this.template()); }, events: { 'click button': 'searchSubmit' }, searchSubmit: function () { // this should be where the magic happens } }); When the searchSubmit method is called, I want to do something like router.navigate('search'). My question: If I have a router module, Router.js, do I then need to create a new instance of it in all of my modules every time I want some router functionality? var Router = require('./Router.js'), router = new Router(); It just does not seem logical to create a new router in every view, when Browserify bundles them all together. Is it me who do not understand Browserify properly, and is there a more clever solution? Thanks!
type: AnsweredQuestion
score: 1
type: Question
linked to: http://stackoverflow.com/q/24283362
answer count: 1
tagged with: javascript
tagged with: browserify
upvote count: 1

http://stackoverflow.com/q/29743215
tagged with: button
tagged with: jquery
has answer: http://stackoverflow.com/a/29743467
favorite count: 0
has answer: http://stackoverflow.com/a/29743356
type: UnansweredQuestion
tagged with: http-redirect
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29744165
downvote count: 1
type: Question
score: 3
tagged with: javascript
has title: Redirecting button after selection
upvote count: 4
has body: I have two buttons (describing the type of delivery). Once selected I have to press another button to proceed . Is there any way how I can proceed automatically after selection? Here is my code before selection: Select Here is my code after selection: Select Here is my third button to proceed: Continue Thanks
answer count: 3

http://stackoverflow.com/a/29762200
score: 0
has comment: http://stackoverflow.com/comment/47656287
has body: You could set a local environment variable on your dev machine, and then in your app try to import the DEV env variable. If successful, use the key for DEV, and if not, use the key for PROD.
type: Answer
answers question: http://stackoverflow.com/q/29761967

http://stackoverflow.com/comment/47767839
comment on: http://stackoverflow.com/q/29798548
score: 0
type: Comment
type: QuestionComment
has text: The first table is a material list with, lets say, 500 positions. The second is a job list with maybe 20 jobs in it. On click on any of the positions, i want to show all the jobs the material is used in. It may be possible that every position in the list is used in at least one job. I don't want to copy the same job 500 times in a table beneath every position and then hide it with css because the user is mostly just looking for one or two positions. I want to hide the job list completely and only copy the needed jobs in a table beneath the position on click.

http://stackoverflow.com/comment/47758798
type: QuestionComment
comment on: http://stackoverflow.com/q/29815747
score: 4
has text: In javascript, objects are passed by reference: you're always modifying the original category object in the first example.
type: Comment

http://stackoverflow.com/comment/47802675
has text: thanks for answer but how to get value of input field which is generated dynamically from dynamically generated button
type: AnswerComment
comment on: http://stackoverflow.com/a/29838108
score: 0
type: Comment

http://stackoverflow.com/comment/47591941
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29729200
has text: how can unset then set session value ? try place my code!!
type: AnswerComment

http://stackoverflow.com/a/29833774
type: Answer
has body: Just write what you want to happen: replace each sub-array with its elements preprended by "addEcommerceItem". You could use concat for that: function prepend(item) { return ["addEcommerceItem"] . concat(item); } Or, if you prefer, function prepend(item) { item.unshift("addEcommerceItem"); return item; } Then it's just function transform(products) { return products . map(prepend); } Sample usage: &gt;&gt; products = [ ["hat", 29.99], ["belt", 19.99] ] &gt;&gt; transform(products) &lt;&lt; [ ["addEcommerceItem","hat",29.99], ["addEcommerceItem","belt",19.99] ] To call _paq.push with each item in the resulting array as one argument, then _paq.push.apply(_paq, transform(products)) In ES6: var prepend = item =&gt; ["addEcommerceItem", ...item]; var transform = products =&gt; products . map(prepend); _paq.push(...transform(products));
has comment: http://stackoverflow.com/comment/47794601
has comment: http://stackoverflow.com/comment/47794720
score: 0
has comment: http://stackoverflow.com/comment/47794842
answers question: http://stackoverflow.com/q/29827086

http://stackoverflow.com/a/29760591
downvote count: 0
has body: The [\w ] allows for spaces in the names which you can't see because of the sample data. See this JSFiddle where I added spaces into the first set of data to show how the original differs. Version one allows for word characters or spaces. Version two allows for word characters or well just word characters because teh brackets only include \w. Version three allows for just word characters. The difference between two and three is that two gives a list of allowed characters that happens to just contain one entry while version three doesn't give a list. If I had to guess I'd say tree might perform better than two but I don't know for sure. Expert from developer.mozilla.org explaining the []'s: Character set. This pattern type matches any one of the characters in the brackets, including escape sequences. Special characters like the dot(.) and asterisk (*) are not special inside a character set, so they don't need to be escaped. You can specify a range of characters by using a hyphen, as the following examples illustrate. The pattern [a-d], which performs the same match as [abcd], matches the 'b' in "brisket" and the 'c' in "city". The patterns /[a-z.]+/ and /[\w.]+/ match the entire string "test.i.ng".
accepted answer of: http://stackoverflow.com/q/29760551
upvote count: 2
answers question: http://stackoverflow.com/q/29760551
type: AcceptedAnswer
type: Answer
score: 2

http://stackoverflow.com/comment/47664822
type: AnswerComment
score: 0
has text: what about if the code is a script like `jcarousel.js`? i also have a similar dilemma.
type: Comment
comment on: http://stackoverflow.com/a/29766869

http://stackoverflow.com/comment/58735863
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29805079
has text: @KDJ instead of images use background-image set to `background-size: cover` for the slides DIV.

http://stackoverflow.com/comment/47570058
comment on: http://stackoverflow.com/a/29710830
type: AnswerComment
has text: Can you provide more information what's not working? And what is the exception?
score: 0
type: Comment

http://stackoverflow.com/comment/47552758
has text: That's the easy way out.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29708508
score: 0

http://stackoverflow.com/q/29710996
has comment: http://stackoverflow.com/comment/47557618
score: 0
answer count: 3
tagged with: concatenation
has answer: http://stackoverflow.com/a/29711497
type: UnansweredQuestion
tagged with: innerhtml
tagged with: addition
has comment: http://stackoverflow.com/comment/47557599
has title: Concatenating instead of summing up (JavaScript)
type: Question
has answer: http://stackoverflow.com/a/29711032
has body: I am new to JavaScript, I've searched a lot in the web but I can't solve my problem. I know that "InnerHtml" could be the problem and already tried some solutions but nothing seems to work. Here's my code: function compra() { dinero = document.getElementById("precio").innerHTML; document.getElementById("tipoo").innerHTML; total = dinero+total; document.getElementById("compra").innerHTML = total; The problem is that went using the button to show the result, it doesn't add the values, just concatenate them. I already tried "parseInt" but doesn't work, or maybe I put it in the wrong place. Thanks. Edit----- Thanks for quickly replies guys... when I use parseFloat or Int I get the "NaN". Here is more of my code... hope it helps. Total De Compra: $ A&ntilde;adir a la Lista
tagged with: function
has answer: http://stackoverflow.com/a/29711037
tagged with: javascript

http://stackoverflow.com/comment/47575955
score: 0
type: Comment
type: QuestionComment
has text: Are we sure? Please clarify. Does the image display at all? If so float:left with some sort of span etc might be good.
comment on: http://stackoverflow.com/q/29720665

http://stackoverflow.com/q/29779999
has title: How to redirect any specific link on the page to a specific url?
answer count: 1
has comment: http://stackoverflow.com/comment/47693419
has answer: http://stackoverflow.com/a/29780508
has comment: http://stackoverflow.com/comment/47694935
tagged with: http-redirect
has comment: http://stackoverflow.com/comment/47690160
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29780508
type: Question
tagged with: hyperlink
linked to: http://stackoverflow.com/q/29774574
tagged with: javascript
score: 0
has body: How to redirect any specific link on the page to a specific url? I have a webpage and it contains several links. link1.com (20 links) link2.com (15 links) link3.com (8 links) I want that whenever someone clicks on link1.com he gets redirected to www.example.com Please advise how I can acheieve this. With the below code I can do a redirect for a current page on screen. But I need to do it for every link on my website.

http://stackoverflow.com/q/29769591
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47670896
has comment: http://stackoverflow.com/comment/47671170
has comment: http://stackoverflow.com/comment/47674232
possible better answer: http://stackoverflow.com/a/29770302
tagged with: css
has body: I am trying to find a method of vertical centring images in a div of uncertain height, allowing the images to overflow the div when their heigh is larger than the containing div's. The div contains a randomly selected slogan which can be of various different lengths (and of course if the browser window width is small it may make even a short slogan run over two lines). I have shown the problem in a jsfiddle. I have tried every method of pure css that I can think of (including negative margins, pseudo elements and transforms), but they only seem to work when the height of the containing div can be guessed or known. That suggests that the only way to achieve what I want is using javascript (jquery?) to establish the height of the div and then use that to give the images either a negative or a positive margin, but I don't know how to achieve that. SLOGAN OF VARIOUS LENGTHS, SOME ONE LINE, SOME THREE OR FOUR .slogan { background-color: rgba(255, 100, 0, 0.3); text-align:center; display:block; width:80%; position:relative; float:none; padding:2em; margin:0.5em auto 1em auto; box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; border-radius: 0.8em; z-index:6; } .tsimg-left, .tsimg-right, .tsimg-centre { display:inline-block; padding:0 1em; height:150px; border-radius:50%; } .tsimg-left { float: left; } .tsimg-right { float: right; }
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29770302
has answer: http://stackoverflow.com/a/29773605
accepted answer: http://stackoverflow.com/a/29773605
type: Question
has title: Vertical centring images with known height in div with variable height, allowing images to overflow div above and below

http://stackoverflow.com/q/29761107
has comment: http://stackoverflow.com/comment/47654332
possible better answer: http://stackoverflow.com/a/29761320
has comment: http://stackoverflow.com/comment/47654315
accepted answer: http://stackoverflow.com/a/29761195
tagged with: youtube
has comment: http://stackoverflow.com/comment/47654827
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29761320
has answer: http://stackoverflow.com/a/29761195
has body: I am looping through some JSON and want to display DOM elements by latest date. I have a data-date attribute. How would I sort each object in array before creating them as DOM elements? I have the following -- $.getJSON(ytapiurl, function(data) { $.each(data.feed.entry, function(i, item) { var pubdate = item['published']['$t']; htmlString +=' Video '; console.log(new Date(pubdate).getTime()); }); });
tagged with: dom
type: Question
has title: How to sort by date before creating DOM elements
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: sorting
score: 0

backbone.js
tags question: http://stackoverflow.com/q/29748654
tags question: http://stackoverflow.com/q/29813209
tags question: http://stackoverflow.com/q/29832013
tags question: http://stackoverflow.com/q/29792846
tags question: http://stackoverflow.com/q/29800534
tags question: http://stackoverflow.com/q/29783375
tags question: http://stackoverflow.com/q/29769719
tags question: http://stackoverflow.com/q/29826878
tags question: http://stackoverflow.com/q/29836302
tags question: http://stackoverflow.com/q/29774300
tags question: http://stackoverflow.com/q/29810190
tags question: http://stackoverflow.com/q/29839956
tags question: http://stackoverflow.com/q/29758724
tags question: http://stackoverflow.com/q/29814340
tags question: http://stackoverflow.com/q/29826226
tags question: http://stackoverflow.com/q/29821498
tags question: http://stackoverflow.com/q/29728583
tags question: http://stackoverflow.com/q/29819596
tags question: http://stackoverflow.com/q/29726668
tags question: http://stackoverflow.com/q/29752700
tags question: http://stackoverflow.com/q/29690667
tags question: http://stackoverflow.com/q/29785873
tags question: http://stackoverflow.com/q/29714576
tags question: http://stackoverflow.com/q/29795013
tags question: http://stackoverflow.com/q/29769606
tags question: http://stackoverflow.com/q/29793914
tags question: http://stackoverflow.com/q/29742898
tags question: http://stackoverflow.com/q/29706673
tags question: http://stackoverflow.com/q/29822159
type: Tag
tags question: http://stackoverflow.com/q/29728794
tag name: backbone.js

http://stackoverflow.com/comment/47693032
comment on: http://stackoverflow.com/q/29781469
type: Comment
type: QuestionComment
has text: Calling `.submit()` reloads the page, so all scripts stop running.
score: 2

http://stackoverflow.com/comment/47620027
type: Comment
type: QuestionComment
score: 0
has text: What did you try so far?
comment on: http://stackoverflow.com/q/29743374

http://stackoverflow.com/comment/47756831
type: AnswerComment
comment on: http://stackoverflow.com/a/29814473
type: Comment
has text: I think you are trying to access the variable right after you call `googleSearchSuggestions`. That will most likely not work, because the xhr is not done yet. Take a look at deferred resolution aka promises.
score: 0

http://stackoverflow.com/comment/47809559
score: 0
type: Comment
type: QuestionComment
has text: Which version of IE/Safari are you using for your tests ? You can see the browser compatibility of Blob [here](https://developer.mozilla.org/en-US/docs/Web/API/Blob#Browser_compatibility)
comment on: http://stackoverflow.com/q/29841117

http://stackoverflow.com/comment/47563469
has text: So what is the issue??? Error in console? Etc...
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29714185
type: QuestionComment

http://stackoverflow.com/q/29707503
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47550641
score: -2
has title: implement background img for web animation
has answer: http://stackoverflow.com/a/29708339
tagged with: javascript
has comment: http://stackoverflow.com/comment/47550769
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47550937
has answer: http://stackoverflow.com/a/29707585
accepted answer: http://stackoverflow.com/a/29707585
has comment: http://stackoverflow.com/comment/47550637
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29708339
has body: I need to pull an image, and the below isn't working. The result within the fiddle via the code below is just a black circle. I need the image to appear within this circle. var context; var dx= 4; var dy=4; var y=150; var x=10; function draw(){ context= myCanvas.getContext('2d'); context.clearRect(0,0,300,300); context.beginPath(); /* context.fillStyle="#0000ff"; */ context.src = 'http://s22.postimg.org/8i2xyc8wt/coin.png'; context.arc(x,y,20,0,Math.PI*2,true); context.closePath(); context.fill(); if( x&lt;0 || x&gt;300) dx=-dx; if( y&lt;0 || y&gt;300) dy=-dy; x+=dx; y+=dy; } setInterval(draw,10); JSfiddle Demo.
has comment: http://stackoverflow.com/comment/47550703
has comment: http://stackoverflow.com/comment/47551175
downvote count: 3
upvote count: 1

http://stackoverflow.com/a/29780508
has body: Here is some sample code. You can edit the redirects variable to match your needs. The index of the redirects variable is a regular expression, if it matches the link gets redirected. option 1 link 1 link 2 not redirected option 2 This is the preferred solution as it replaces the href attribute if necessary. Thus you do not have to check the redirects on every click. link 1 link 2 not redirected
upvote count: 2
has comment: http://stackoverflow.com/comment/47692215
has comment: http://stackoverflow.com/comment/50196432
accepted answer of: http://stackoverflow.com/q/29779999
score: 2
answers question: http://stackoverflow.com/q/29779999
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47691534
type: Answer

http://stackoverflow.com/q/29812233
tagged with: javascript
type: Question
score: 0
answer count: 1
tagged with: arrays
tagged with: jquery
has body: The user can define how many he will choose and when the on change event is triggered, the value of the will be push to array. So basically, the value and the length of an array is depending on the user. Now, what I want is if the user already selected that specific value on other and he tries to select it on the other , it will prompt a message that the item already selected. Well, the item will be the name of the existing value he is about to select. I really don't know how to do it. Here is my codes for adding the . var a = 1; $('#add').click(function() { var cnt = $('#append').val(); for (var i = 0; i < cnt; i++) { a++; $('#contain').append(' x '); } var selval = $('#contain select').val(); var optarr = []; $('#contain #sel1 option').each(function() { var opt = $(this).val(); if (opt != selval && opt != 'null') { optarr.push(opt); } }); var optjoin = optarr.join(','); var optlen = optarr.length; var optsplit = optjoin.split(','); for (var x = 0; x < optlen; x++) { var optappend = ' ' + optsplit[x] + ' '; $('#contain select.sel[name="' + a + '"]').append(optappend); } }); $(document).on('click', '#contain #remove', function() { $('#contain select.sel, #contain #remove, #contain br').remove('[name="' + a + '"]'); a--; }); + val1 val2 val3 val4 val5 val6 val7 val8 val9 val10
has title: jQuery: How to search the user defined array?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29812482

http://stackoverflow.com/q/29836042
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47927871
tagged with: kendo-ui
has comment: http://stackoverflow.com/comment/47936940
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47897955
has comment: http://stackoverflow.com/comment/47798877
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47937088
has comment: http://stackoverflow.com/comment/47928095
tagged with: kendo-asp.net-mvc
has title: 0x800a138f - JavaScript runtime error: The value of the property ''is null or undefined, not a Function object
score: 2
has answer: http://stackoverflow.com/a/29836130
type: Question
tagged with: kendo-grid
has body: 1> I have kendo grid, and one of the column has a button. I have assigned javascript function to the onclick event of the button. The javascript makes ajax call. But when I click on the button I get error 0x800a138f - JavaScript runtime error: The value of the property 'DoSomething' is null or undefined, not a Function object I tried setting onclick to "javascript:DoSomething();" with no luck 2> I would also like to pass "BatchKey" value to the function if possible @(Html.Kendo().Grid< BatchDetail>() .Name("grid") .Columns(col => { col.Bound(p => p.BatchKey); col.Bound(p => p.OriginalCost); col.Bound(p => p.Status); col.Bound(p => p.LastFileName); col.Bound(p => p.FileID).ClientTemplate( "# if (Status == \"Error\") { #" + " Resolve " + "#}#" ).Title("Action"); }) .AutoBind(true) .Pageable() .Sortable() .DataSource(dataSource => dataSource .Ajax() .PageSize(20) .Read(read => read .Action("GetData", "Detail", new { ID = Model.ID }))) ) function DoSomething() { $.ajax({ url: "www.msn.com", success: function (result) { $("#div1").html(result); } }) }

http://stackoverflow.com/a/29726209
score: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47586351
has comment: http://stackoverflow.com/comment/47586398
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29726156
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29726156
has body: Try something like: str.replace(/"(.*?)"/g, function(_, match) { return "(" + match + ")"; }) Or more simply str.replace(/"(.*?)"/g, "($1)") Note the "non-greedy" specifier ?. Without this, the regexp will eat up everything including double quotes up until the last one in the input. See documentation here. The $1 in the second fragment is a back-reference referring the first parenthesized group. See documentation here.

http://stackoverflow.com/q/29835100
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47797477
has answer: http://stackoverflow.com/a/29841892
type: Question
tagged with: angular-strap
answer count: 2
possible better answer: http://stackoverflow.com/a/29835221
tagged with: javascript
tagged with: jquery
score: 0
tagged with: angularjs
has title: Customize close button of modal
has comment: http://stackoverflow.com/comment/47797575
has body: I used modal angular strap in controller, as the following: $scope.modal = $modal({ scope: $scope, title: 'My Title', content: text, html: true, contentTemplate: 'views/partials/myTemplate.html', show: true, keyboard: false, backdrop: "static" }); I need to customize the action of close button in the top of modal at the following image: . How can I overwrite the close action of top button ?
tagged with: twitter-bootstrap
accepted answer: http://stackoverflow.com/a/29841892
has answer: http://stackoverflow.com/a/29835221

http://stackoverflow.com/q/29812524
tagged with: html5-canvas
upvote count: 10
has body: I drew a circle using the HTML canvas arc method, but I want to remove the border of the circle. I tried to set lineWidth = 0 but it doesn't seem to work. Is there a way to remove the border of a circle in canvas? $(document).ready(function() { pie_chart = $('#pie_chart'); var p = pie_chart[0].getContext('2d'); var canvas_width = pie_chart.width(); var canvas_height = pie_chart.height(); p.beginPath(); p.arc(canvas_width/2, canvas_height/2, 150, 0 , Math.PI * 2); p.lineWidth = 0; p.stroke(); p.fillStyle = '#777'; p.fill(); });
accepted answer: http://stackoverflow.com/a/29812572
has title: Trying to remove border of arc on canvas
downvote count: 0
has comment: http://stackoverflow.com/comment/47752916
has comment: http://stackoverflow.com/comment/47752872
has answer: http://stackoverflow.com/a/29812572
type: Question
type: AnsweredQuestion
score: 10
tagged with: canvas
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/29828154
score: 0
has comment: http://stackoverflow.com/comment/47782898
type: Answer
has body: There is a plugin called OverlappingMarkerSpiderfier-Leaflet that spreads overlapping markers on an onClick event so their identification is more easy. You can see a demo here and download it from github. Maybe it is useful for your application.
answers question: http://stackoverflow.com/q/29826242

http://stackoverflow.com/a/29836937
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29836676
has comment: http://stackoverflow.com/comment/47800647
downvote count: 0
has body: I have a couple of suggestions: I am not sure if this works - in general, or with AWS - but you could try doing an AJAX request with "Range" HTTP request header. The idea being that you only fetch the first few hundred bytes of the SVG file. Assuming you are in control of the uploading, you could add the dimensions to the file name. Ie. "mysvg_128x128.svg" and parse the values from the name.

http://stackoverflow.com/a/29824393
answers question: http://stackoverflow.com/q/29823649
has body: It's actually quite straightforward: First, set your new text to a scope value on click: $scope.moreInfo = function(id) { $scope.curResults = "Email: " + id.email + "\nName: " + id.name + "\nBody: " + id.body //alert("Email: " + id.email + "\nName: " + id.name + "\nBody: " + id.body); }; Then, simply assign this value to another div: &lt;div ng-show="curResults"&gt;{{curResults}}&lt;/div&gt; Then, whenever you click on the results, curResults is updated and shown in that div. ng-show="curResults" makes sure the div is only shown when there's a value set to curResults.
type: Answer
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/q/29828941
type: Question
answer count: 2
tagged with: ember-data
downvote count: 0
tagged with: javascript
has body: I have a model made by 3 other nested models in Ember and I want to use data from one of them for a parameter for another one. I have got a model to set the configuration of my App (hotTopicConfig) The thing is that I want to use data from hotTopicConfig to use it as a parameter in hotTopics Model return new Ember.RSVP.hash({ hotTopicConfig: self.store.findQuery('hot-topic-config', { touchpointId: params.touchpointId, }).then(function (results) { self.set('periodType', results.get('periodType')) return results.get('firstObject'); }), hotTopicSortByType: self.store.find('hot-topic-sort-by-type'), hotTopics: self.store.findQuery('hot-topic', { touchpointId: params.touchpointId, periodType: HERE I WANT TO USE DATA FROM hotTopicConfig }).then(function (results) { return results.get('firstObject'); }) I have used several solutions but none of them workt for me, like external and additional calls to AJAX call. Is there any other way to do this?
tagged with: ember.js
tagged with: asynchronous
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/29829514
has title: Ember CLI Data Chaining data Models
score: 1
has answer: http://stackoverflow.com/a/29848208

http://stackoverflow.com/q/29830370
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47788304
favorite count: 0
has body: I'm trying to use google's materialize date picker (http://materializecss.com/forms.html). In their examples they have used it with elements like in this jsfiddle. HTML: JQuery: $('.datepicker').pickadate({ selectMonths: true, // Creates a dropdown to control month selectYears: 15 // Creates a dropdown of 15 years to control year }); But I want to do it with elements like in this jsfiddle which is not working properly. The problem is I have to click and hold the mouse to see the date picker here..! HTML: click JQuery: $('.datepicker').pickadate({ selectMonths: true, // Creates a dropdown to control month selectYears: 15 // Creates a dropdown of 15 years to control year }); Anybody knows a solution for making this to work properly when I click (without disappearing after releasing the mouse)?
has comment: http://stackoverflow.com/comment/47788453
has answer: http://stackoverflow.com/a/61299760
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47790808
tagged with: datepicker
score: 2
has comment: http://stackoverflow.com/comment/47789386
tagged with: material-design
type: Question
has title: Materialize datepicker - Rendering when an icon is clicked
upvote count: 2
linked to: http://stackoverflow.com/q/29832007

http://stackoverflow.com/a/29796407
has body: I'm a bit confused about the problem you're seeing, but this is what I see: The second time I load an image into your Plunker the crop region disappears, but I can still click and drag a crop region. The reason for this is the crop box element is display:none. This is because your old cropper has been hidden, and you need to reset() and clear() it before it can be used with the new image. You've already got the following: $image.one('built.cropper', function () { URL.revokeObjectURL(blobURL); // Revoke when load complete }).cropper('reset', true).cropper('replace', blobURL); but your missing clear() $image.one('built.cropper', function () { URL.revokeObjectURL(blobURL); // Revoke when load complete }).cropper('reset', true).cropper('clear').cropper('replace', blobURL); Plunker (since you asked so politely)
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/29793624
has comment: http://stackoverflow.com/comment/47720954
score: 3
accepted answer of: http://stackoverflow.com/q/29793624
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47548950
type: Comment
comment on: http://stackoverflow.com/a/29705538
type: AnswerComment
score: 0
has text: Thank you. I've been able to succesfully do what I wanted to with your method. As I get it, the height being adjusted on the website I linked isn't the best way to achieve the responsive design ?

iframe
tags question: http://stackoverflow.com/q/29771468
tags question: http://stackoverflow.com/q/29789684
tags question: http://stackoverflow.com/q/29803036
tags question: http://stackoverflow.com/q/29805890
tags question: http://stackoverflow.com/q/29702943
tags question: http://stackoverflow.com/q/29718948
tags question: http://stackoverflow.com/q/29756278
tag name: iframe
tags question: http://stackoverflow.com/q/29797369
tags question: http://stackoverflow.com/q/29704982
tags question: http://stackoverflow.com/q/29699276
tags question: http://stackoverflow.com/q/29732264
tags question: http://stackoverflow.com/q/29803676
tags question: http://stackoverflow.com/q/29773521
tags question: http://stackoverflow.com/q/29832171
tags question: http://stackoverflow.com/q/29773598
tags question: http://stackoverflow.com/q/29790682
tags question: http://stackoverflow.com/q/29729197
tags question: http://stackoverflow.com/q/29790142
tags question: http://stackoverflow.com/q/29695438
tags question: http://stackoverflow.com/q/29695139
tags question: http://stackoverflow.com/q/29688255
tags question: http://stackoverflow.com/q/29798225
tags question: http://stackoverflow.com/q/29815284
tags question: http://stackoverflow.com/q/29808481
tags question: http://stackoverflow.com/q/29743100
tags question: http://stackoverflow.com/q/29842554
tags question: http://stackoverflow.com/q/29793125
tags question: http://stackoverflow.com/q/29714998
tags question: http://stackoverflow.com/q/29707110
tags question: http://stackoverflow.com/q/29697158
tags question: http://stackoverflow.com/q/29729644
type: Tag
tags question: http://stackoverflow.com/q/29706382
tags question: http://stackoverflow.com/q/29688594
tags question: http://stackoverflow.com/q/29723112
tags question: http://stackoverflow.com/q/29816795
tags question: http://stackoverflow.com/q/29809075
tags question: http://stackoverflow.com/q/29837980
tags question: http://stackoverflow.com/q/29799976
tags question: http://stackoverflow.com/q/29825229
tags question: http://stackoverflow.com/q/29735907
tags question: http://stackoverflow.com/q/29727062
tags question: http://stackoverflow.com/q/29743336
tags question: http://stackoverflow.com/q/29709924
tags question: http://stackoverflow.com/q/29839178
tags question: http://stackoverflow.com/q/29812989
tags question: http://stackoverflow.com/q/29712743
tags question: http://stackoverflow.com/q/29840949
tags question: http://stackoverflow.com/q/29732180
tags question: http://stackoverflow.com/q/29698303
tags question: http://stackoverflow.com/q/29694558
tags question: http://stackoverflow.com/q/29838083
tags question: http://stackoverflow.com/q/29811420

http://stackoverflow.com/q/29761368
type: AnsweredQuestion
downvote count: 0
tagged with: paperjs
favorite count: 0
has answer: http://stackoverflow.com/a/57301820
type: Question
score: 5
possible better answer: http://stackoverflow.com/a/57301820
has title: Resize rectangle in Paper.js
has body: I have a very ordinary rectangle created in Paper.js and I'd like to resize it, but I can't find any obvious ways to do it. var rect = new Rectangle([0, 0],[width,height]); rect.center = mousePoint; var path = new Path.Rectangle(rect, 4); path.fillColor = fillColor; path.meta = fillColor; There's a scale transformation method, but it's not really for mouse interaction and my goal is to create a handle that can resize a component.
has answer: http://stackoverflow.com/a/29762862
answer count: 2
accepted answer: http://stackoverflow.com/a/29762862
upvote count: 5
tagged with: javascript
tagged with: canvas

http://stackoverflow.com/comment/47601768
type: Comment
type: QuestionComment
has text: `innerHTML` is a property of DOM element, whereas `$characterArray` is a jQuery object. You have to use `.html()` method instead of `innerHTML`
score: 3
comment on: http://stackoverflow.com/q/29734322

http://stackoverflow.com/a/29755038
answers question: http://stackoverflow.com/q/29754362
score: 0
type: Answer
has body: You may need to use prop prop instead of attr attr as using attr to get or retrieve values has been deprecated fro certain elements since jQuery 1.6. As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. To retrieve and change DOM properties such as the checked, selected, or disabled state of form elements, use the .prop() method.

affiliate
type: Tag
tags question: http://stackoverflow.com/q/29804219
tag name: affiliate

http://stackoverflow.com/q/29821946
has comment: http://stackoverflow.com/comment/47770663
has comment: http://stackoverflow.com/comment/47770266
has comment: http://stackoverflow.com/comment/47771225
has answer: http://stackoverflow.com/a/29822810
has comment: http://stackoverflow.com/comment/47771531
has comment: http://stackoverflow.com/comment/47770990
linked to: http://stackoverflow.com/q/25721390
has comment: http://stackoverflow.com/comment/47770688
type: Question
has answer: http://stackoverflow.com/a/29822092
tagged with: javascript
has comment: http://stackoverflow.com/comment/47770899
has comment: http://stackoverflow.com/comment/47771793
has comment: http://stackoverflow.com/comment/47770287
downvote count: 3
has comment: http://stackoverflow.com/comment/47771609
has comment: http://stackoverflow.com/comment/47771760
has comment: http://stackoverflow.com/comment/47770433
has comment: http://stackoverflow.com/comment/47771536
has comment: http://stackoverflow.com/comment/47770514
has comment: http://stackoverflow.com/comment/47771167
has comment: http://stackoverflow.com/comment/47770167
tagged with: jquery
has title: jQuery closest (inside and outside DOM tree )
favorite count: 0
has comment: http://stackoverflow.com/comment/47771066
has comment: http://stackoverflow.com/comment/47773623
has comment: http://stackoverflow.com/comment/47770396
has comment: http://stackoverflow.com/comment/47770322
upvote count: 5
has answer: http://stackoverflow.com/a/29822202
answer count: 5
has answer: http://stackoverflow.com/a/29823718
accepted answer: http://stackoverflow.com/a/29823718
has comment: http://stackoverflow.com/comment/47770631
has answer: http://stackoverflow.com/a/29823712
has comment: http://stackoverflow.com/comment/47770527
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/47771291
has comment: http://stackoverflow.com/comment/47770333
possible better answer: http://stackoverflow.com/a/29822810
has body: Given an element and any selector, I need to find the closest element which matches it, not matter if it's inside the element or outside of it. Currently jQuery doesn't provide such traversing functionality, but there is a need. Here is the scenario: A list of many items where the element reside inside click me click me ... Or the element might reside outside of the element click me click me ... The very very basic code would look like this: $('a').closest1('button'); // where `closest1` is a new custom function // or $('a').select('> button') // where `select` can parse any selector relative to the object, so it would also know this: $('a').select('~ button') // where the button is a sibling to the element the known element is and anything else can change. I want to locate the nearest element for a given element, no matter if that button is inside or outside of 's DOM tree. It would be very logical that native jQuery function "closest" would do as the name suggests and find the closest, but it only searches upwards as you all know. (it should have been named differently IMO). Does anyone know any custom traversing function which does the above? Thanks. (i'm asking you people because someone must have written this for sure but I was unlucky to find a lead on the internet)

http://stackoverflow.com/tag/pdf
tags question: http://stackoverflow.com/q/29794689
tags question: http://stackoverflow.com/q/29706536
type: Tag
tag name: pdf
tags question: http://stackoverflow.com/q/29744967
tags question: http://stackoverflow.com/q/29817457
tags question: http://stackoverflow.com/q/29705975
tags question: http://stackoverflow.com/q/29704126
tags question: http://stackoverflow.com/q/29755518
tags question: http://stackoverflow.com/q/29807055
tags question: http://stackoverflow.com/q/29693529
tags question: http://stackoverflow.com/q/29841117
tags question: http://stackoverflow.com/q/29792273
tags question: http://stackoverflow.com/q/29750008
tags question: http://stackoverflow.com/q/29707110
tags question: http://stackoverflow.com/q/29820095
tags question: http://stackoverflow.com/q/29803100

http://stackoverflow.com/q/29733980
has answer: http://stackoverflow.com/a/29832689
has body: I am using JQuery Mobile with Phonegap and I am trying to create a button and when I click it a phone call should be made. I have mad a lot of research for this problem and I have found the following solution Call or Call This solution is working on browsers (is asking me to open Skype) but when I run it on Android with a Samsung Galaxy S2 is not working. It is not doing anything. I have tried to add to the config.xml file the following permission: <access launch-external="yes" origin="tel:*" /> but is not working either. If you have any solution to suggest please do so. Thank you!
type: Question
tagged with: jquery-mobile
has title: JQuery Mobile app, make a mobile call with HTML 5
tagged with: javascript
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29734012
tagged with: cordova
has answer: http://stackoverflow.com/a/29734012
answer count: 5
has answer: http://stackoverflow.com/a/29734960
tagged with: android
has answer: http://stackoverflow.com/a/29734064
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29794263
favorite count: 0
accepted answer: http://stackoverflow.com/a/29794263

http://stackoverflow.com/comment/47785743
has text: This might help but looks like a bit of a hack http://stackoverflow.com/questions/9857659/setting-line-height-for-text-element-in-raphael
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29829277

http://stackoverflow.com/a/29810754
accepted answer of: http://stackoverflow.com/q/29810717
has comment: http://stackoverflow.com/comment/47749505
type: Answer
score: 2
has body: document.getElementById(id) finds an element with a given id value in your HTML. An id value looks like this: Some Content And, then you can find that element with: document.getElementById("myHeader"); ID values must be unique in each document so there should only ever be one element with a given ID. If an id isn't what you really want, you can find elements other ways, by tag type, by class name, by attribute, etc... using CSS selectors with document.querySelectorAll(). For example, if you wanted to find all tags, you could do this: var items = document.querySelectorAll("h3"); Here are some other reasons that document.getElementById(...) might fail to find what you want it to find: The Javascript code is running before the DOM elements have been parsed and loaded so thus the element is actually not there yet when you're running the code. This is common with code run from the section of the document. You have an HTML error in how you are specifying the id value in the HTML. You have an HTML error that causes the browser not to parse your HTML properly. You have a script error that cause your script to abort before it gets to the part you want to run.
downvote count: 0
has comment: http://stackoverflow.com/comment/47749647
has comment: http://stackoverflow.com/comment/47749482
upvote count: 2
has comment: http://stackoverflow.com/comment/47749607
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29810717

http://stackoverflow.com/a/29767451
has body: If you store the ID in an attribute and use replace, you can do &lt;a href="#" id="{{video.I‌​d}}" onclick="location.replace(location.href.split('#')[0]+'#/videos/detail/'+this.id‌​); return false"&gt; or for the purist (here jQuery, I do not do Angular): &lt;a href="#" class="vids" id="{{video.I‌​d}}"&gt; using $(function() { $(".vids").on("click",function(e) { e.preventDefault(); location.replace(location.href.split('#')[0]+'#/videos/detail/'+this.id‌​); " }); }); For more parameters: &lt;a href="#" class="vids" data-id="{{video.I‌​d}}" data-target="somewhere"&gt; using $(function() { $(".vids").on("click",function(e) { e.preventDefault(); location.replace(location.href.split('#')[0]+'#/videos/detail/'+ $(this).data("id‌"​)+'/'+ $(this).data("target"​)); }); });
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47665811
type: Answer
accepted answer of: http://stackoverflow.com/q/29766659
has comment: http://stackoverflow.com/comment/47667530
answers question: http://stackoverflow.com/q/29766659
has comment: http://stackoverflow.com/comment/47667447

http://stackoverflow.com/comment/47705289
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29772140
has text: You can't open some https not all in iframe. I have tried to open the paypal in iframe with my app header and back button but paypal not allowed it.

http://stackoverflow.com/q/29750498
has comment: http://stackoverflow.com/comment/47634916
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47635618
has comment: http://stackoverflow.com/comment/47678993
favorite count: 0
tagged with: kendo-ui
has answer: http://stackoverflow.com/a/29781577
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
score: 2
has title: How to enable parent after on last child uncheck?
has comment: http://stackoverflow.com/comment/47655356
type: Question
has body: I have implemented code for enable/disable childs and parents based on user requirement so one of the requirement I have kendo treeview with checkboxes where i implemented below code when child is uncheck enable parent thats what it suppose to do but problem is if i check multiple childs and uncheck any one of them its enabling parent. I want to enable parent when last child gets unchecked. see code below so far... HTML &lt;div id="treeViewDisplay4" class="dropdown-menu multi-level" ng-style="nonPersistentProcess.geoLocationStyle"&gt; &lt;div kendo-tree-view="geoLocationTree" k-data-source="geoLocationDataSource" options="geoLocationTreeOptions" k-on-expand="onGeoExpand(kendoEvent)" k-rebind="nonPersistentProcess.selectedTypeGEO"&gt;&lt;/div&gt; &lt;/div&gt; index.js $scope.updateGeoLoctionList = function(geoLocation){ var pos = $.inArray(geoLocation.text, selectedGeoLocations); if(pos &lt; 0){ selectedGeoLocations.push(geoLocation.text); selectedGeoLocationIds.push(geoLocation.id); //if Global is checked disable all parent and children if (geoLocation.id === 5657){ $.each(geoLocation.parent(),function(index,location) { if (location.id !== geoLocation.id) { $.each(location._childrenOptions.data.items,function(index,child){ var disableChildId = 'disabled' + child.id; var model = $parse(disableChildId); model.assign($scope, true); }) var disableItemId = 'disabled' + location.id; // Get the model var model = $parse(disableItemId); // Assigns a value to it model.assign($scope, true); } }); } // If a child is checked Disable the parents try { var parent = geoLocation.parent().parent(); var disableParentId = 'disabled' + parent.id; var parentModel = $parse(disableParentId); parentModel.assign($scope, true); } catch (err) { // Ignore since this happens when a node is selected which has no children } //Expand tree on parent check so childs can be disabled. $scope.geoLocationTree.expand($scope.geoLocationTree.findByText(geoLocation.text)); //If the parent item is checked, di…
tagged with: javascript

http://stackoverflow.com/q/29844976
has answer: http://stackoverflow.com/a/29845078
upvote count: 2
downvote count: 3
has comment: http://stackoverflow.com/comment/47816322
type: Question
has answer: http://stackoverflow.com/a/29845262
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/47816483
has body: In form, There is a field of file &lt;input type="file" name="file"&gt; &lt;input type="button" value="upload"&gt; I want to upload image file onto server but I can't able to upload the image. Is there any solution in only javascript? Please help me to find this answer. Thanks..!
has answer: http://stackoverflow.com/a/29847117
answer count: 3
has title: How to upload an image file using only javascript and ajax
has comment: http://stackoverflow.com/comment/47815868
favorite count: 0
tagged with: ajax
type: UnansweredQuestion

http://stackoverflow.com/a/29785092
score: 0
has comment: http://stackoverflow.com/comment/47703139
type: Answer
has body: Try the following modification to your ajax function: $.ajax({ url: utils.getJSONPRequestURL(ip), jsonpCallback: 'callback', dataType: "jsonp", success: function (data) {console.log(this.url)} }).done(function(){ console.log("done"); }); The done function should fire regardless of the call's success.
has comment: http://stackoverflow.com/comment/47702602
answers question: http://stackoverflow.com/q/29784975

http://stackoverflow.com/comment/47527476
type: Comment
comment on: http://stackoverflow.com/a/29695428
type: AnswerComment
score: 0
has text: What is happening is that you are executing tooltip plugin from jQuery UI instead of Bootstrap tooltip, so you should avoid Tooltip import from jQuery UI creating a custom jQuery UI import file: https://jqueryui.com/download/ (uncheck widget tooltip)

http://stackoverflow.com/comment/47514084
score: 0
comment on: http://stackoverflow.com/q/29688459
has text: Look at Aruns answer below
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29697426
has answer: http://stackoverflow.com/a/29697742
type: AnsweredQuestion
score: 1
upvote count: 1
has title: Add image in highcharts labels
type: Question
accepted answer: http://stackoverflow.com/a/29697742
tagged with: highcharts
has comment: http://stackoverflow.com/comment/47531638
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
has body: I am trying to draw Highchart and placing image and text on slices. But somehow SVG image is not getting displayed. Below is the Fiddle link Fiddle link Some of the code i am using to display image in Series object is formatter : function(){ return '&lt;svg class="icon"&gt; &lt;circle cx="10" cy="10" r="10" fill="red" /&gt;&lt;/svg&gt; 7 %' ; },

http://stackoverflow.com/comment/47581989
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29723816
has text: I showed it in the picture, if your looking at the live site, you must be logged in and have some larger posts
score: 0

http://stackoverflow.com/comment/47771745
type: AnswerComment
score: 1
comment on: http://stackoverflow.com/a/29821687
type: Comment
has text: Hey thanks for reminding me about the $scope variable, I was using the hit and trial method and forgot to remove it. I want to use the data from the json into another function is there any other way to do it? I mean how I could pass my song list to the different function?

http://stackoverflow.com/a/29718388
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29718349
downvote count: 0
answers question: http://stackoverflow.com/q/29718349
has body: You can try this: $(document).ready(function() { $('#sumbitf').click(function(){ $('#sumbitf').fadeOut(); }); }); Or you can save time and do this little trick: I like peanuts
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/29797802
answers question: http://stackoverflow.com/q/29765430
has comment: http://stackoverflow.com/comment/47752396
has body: I'm quite sure that answer you get is not a solution for your problem. If it is true what you said, when file customers.php is not in the root of web directory, which means is hidden from url, then you can not solve problem with the help of $http.get function. Suppose that we have /var/www/public directory and the file customers.php is in next directory /var/customers.php Your root directory of your web server is /var/www/public with your AngularJS files, like *.html or customers.html. If someone enter this url www.serverip.com Your web server point to this directory /var/www/public/customers.html and you want to read file from /var/customers.php with $http.get fuction. You can not do that. You must put customers.php in the root of your web server. For instance, in the next directory /var/www/public/customers.php Thanks for your attention.
type: Answer
score: 0

http://stackoverflow.com/comment/47540510
type: QuestionComment
has text: This error is pretty straightforward. Angular says it can't find that module, so my first question is what scripts are you referencing on your page?
score: 0
comment on: http://stackoverflow.com/q/29702255
type: Comment

http://stackoverflow.com/q/29840145
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29840288
accepted answer: http://stackoverflow.com/a/29840261
score: 6
has answer: http://stackoverflow.com/a/29840288
upvote count: 7
has comment: http://stackoverflow.com/comment/47806650
downvote count: 1
type: Question
tagged with: javascript
has body: how can we create ngELSE directive as same as ngIF directive? below code for ngIfDirective. Shall we customize the code for ngELSE? var ngIfDirective = ['$animate', function($animate) { return { multiElement: true, transclude: 'element', priority: 600, terminal: true, restrict: 'A', $$tlb: true, link: function($scope, $element, $attr, ctrl, $transclude) { var block, childScope, previousElements; $scope.$watch($attr.ngIf, function ngIfWatchAction(value) { if (value) { if (!childScope) { $transclude(function(clone, newScope) { childScope = newScope; clone[clone.length++] = document.createComment(' end ngIf: ' + $attr.ngIf + ' '); // Note: We only need the first/last node of the cloned nodes. // However, we need to keep the reference to the jqlite wrapper as it might be changed later // by a directive with templateUrl when its template arrives. block = { clone: clone }; $animate.enter(clone, $element.parent(), $element); }); } } else { if (previousElements) { previousElements.remove(); previousElements = null; } if (childScope) { childScope.$destroy(); childScope = null; } if (block) { previousElements = getBlockNodes(block.clone); $animate.leave(previousElements).then(function() { previousElements = null; }); block = null; } } }); } }; }];
tagged with: angular-ng-if
has answer: http://stackoverflow.com/a/29840316
has answer: http://stackoverflow.com/a/29840261
favorite count: 0
has answer: http://stackoverflow.com/a/29840235
tagged with: angularjs
has title: ng-else directive in angularjs
answer count: 4

http://stackoverflow.com/comment/47796890
comment on: http://stackoverflow.com/a/29835024
type: AnswerComment
has text: Cheers for this tip! Have removed the blur but the alert still fires!
score: 0
type: Comment

http://stackoverflow.com/comment/47578062
comment on: http://stackoverflow.com/q/29718750
score: 0
type: Comment
type: QuestionComment
has text: ohh you are having ids to keyword and chapter fields same in all added rows, you need to have the dynamic id for each row as html dont allow duplicate ids

google-sites
tags question: http://stackoverflow.com/q/29695860
type: Tag
tag name: google-sites

http://stackoverflow.com/comment/47627089
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29746917
has text: @JamieCalver ok i added my answer. i think you need like that.

http://stackoverflow.com/q/29730592
answer count: 1
linked to: http://stackoverflow.com/q/18693005
tagged with: d3.js
linked to: http://stackoverflow.com/q/17262028
has title: D3 multi-line chart with same color dots
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47594645
type: Question
has comment: http://stackoverflow.com/comment/47597473
has body: I am new to D3 and my requirement is to get multiple line graphs and provide dots for each data point. I started with this example: http://www.d3noob.org/2014/07/d3js-multi-line-graph-with-automatic.html and I added the dots along the line but I have not been able to get the dots to be the same color. Here are the other examples I have tried with no luck so far. Adding point and value to line chart... how to color the point like the line? Create points on a D3 multiline graph Here is a copy of my code. Any help would be greatly appreciated. Thank you. Here is my data: Climate_data.csv symbol date data Winter 1976 3.9 Winter 1977 1.3 Winter 1978 2 Winter 1979 3.2 Winter 1980 3.5 Winter 1981 2.3 Winter 1982 2.3 Winter 1983 4.7 Winter 1984 4.3 Winter 1985 4.7 Winter 1986 4.1 Winter 1987 4.4 Winter 1988 3.3 Winter 1989 3.8 Winter 1990 4.3 Winter 1991 5.4 Winter 1992 4.5 Winter 1993 3.8 Winter 1994 2.6 Winter 1995 5.3 Winter 1996 2.9 Winter 1997 3.7 Winter 1998 4.7 Winter 1999 5 Winter 2000 4.2 Winter 2001 4.3 Winter 2002 5.7 Winter 2003 2.4 Winter 2004 3.2 Winter 2005 3.2 Winter 2006 5.7 Winter 2007 5 Winter 2008 5.4 Winter 2009 4.1 Winter 2010 3.83 Winter 2011 3.02 Spring 1976 11.1 Spring 1977 10.7 Spring 1978 9.4 Spring 1979 10.7 Spring 1980 10.5 Spring 1981 10.7 Spring 1982 9.9 Spring 1983 10.9 Spring 1984 11 Spring 1985 11 Spring 1986 11.5 Spring 1987 11.6 Spring 1988 10.8 Spring 1989 10.7 Spring 1990 10.8 Spring 1991 12.3 Spring 1992 11 Spring 1993 11 Spring 1994 10.6 Spring 1995 11.4 Spring 1996 9.7 Spring 1997 9.8 Spring 1998 11.5 Spring 1999 12.5 Spring 2000 11.8 Spring 2001 11.5 Spring 2002 12 Spring 2003 10.5 Spring 2004 11.5 Spring 2005 11 Spring 2006 12.1 Spring 2007 11.3 Spring 2008 11.9 Spring 2009 11.4 Spring 2010 13.04 Spring 2011 11.3 Summer 1976 18.9 Summer 1977 19.6 Summer 1978 18.9 Summer 1979 19.9 Summer 1980 19.6 Summer 1981 20.1 Summer 1982 19.7 Summer 1983 19.6 Summer 1984 19.7 Summer 1985 20.2 Summer 1986 19.4 Summer 1987 19.7 Summer 1988 19.2 S…
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29734189
accepted answer: http://stackoverflow.com/a/29734189

http://stackoverflow.com/a/29724593
score: 6
has body: First, you'll iterate over the data with .map so that you can return markup (the child component) for each item. In the child component markup, you pass the data for that item in an attribute. {Object.keys(yourObject).map(function(key) { return ( // Add a key to the list item, it is mandatory from react // What the key consists of if it's the id or not is up to you // it needs to be unique though <ChildComponent key={key} data={yourObject[key]}/> ); })} The child component's markup can then use that data by binding this.props.data. Player: {this.props.data.name} You don't have to use the name "data" for the attribute/property. Something like info={yourObject[key]} with this.prop.info is just as valid. Working JS Fiddle here.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29724473
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/29724473

http://stackoverflow.com/comment/47601722
type: QuestionComment
comment on: http://stackoverflow.com/q/29734290
score: 1
has text: There are a tonne of examples of this throughout the web, not least here on SO. Did you research anything?
type: Comment

liferay-aui
tags question: http://stackoverflow.com/q/29821522
tag name: liferay-aui
type: Tag

http://stackoverflow.com/q/29815747
tagged with: javascript
has title: Why cant JavaScript handle this?
linked to: http://stackoverflow.com/q/24766826
score: 0
duplicate of: http://stackoverflow.com/q/24766826
has comment: http://stackoverflow.com/comment/47758798
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47758948
has comment: http://stackoverflow.com/comment/47758913
has comment: http://stackoverflow.com/comment/47758888
has comment: http://stackoverflow.com/comment/47758907
answer count: 0
has comment: http://stackoverflow.com/comment/47759086
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47759096
type: Question
has body: So, I spent way to many hours figuring this problem out. So basically, I have this for loop, which should add all the unique elements to a separate array. var categories = []; var category = { "name": "", "id": "", "icon": "", "subcategory": [] }; for (var i = 0; i &lt; array.length; i++) { var add = false; for (var j = 0; j &lt;= categories.length; j++) { if (!objectExists(categories, array[i].zones[0].description)) { add = true; } } if (add) { category.name = array[i].zones[0].description; category.id = generateUUID(); category.icon = array[i].zones[0].description; category.subcategory = []; categories.push(category); } } var objectExists = function (array, name) { for (var i = 0; i &lt; array.length; i++) { if (array[i].name === name) { return true; } } return false; }; This does not work, since the object category will never change the different properties, they will remain the same (at least in my case). If I create the variable category inside the if (add) { ... } this way: if (add) { category = { "name": "", "id": "", "icon": "", "subcategory": [] }; category.name = array[i].zones[0].description; category.id = generateUUID(); category.icon = array[i].zones[0].description; category.subcategory = []; categories.push(category); } It works. Can someone explain to me what happens? I've been trying to read some literature about it, but cant find anything that fits this case. Here's a fiddle displaying what I'm experiencing. http://jsfiddle.net/fAypL/1/
tagged with: arrays

http://stackoverflow.com/comment/47561599
has text: do I have to do anything to update the view/scope, it is always returning the same thing, I really appreciate your help though
comment on: http://stackoverflow.com/a/29713078
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/48297309
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29718660
has text: I observe sth similar on IE 11 as well. Still working on it.
type: Comment

http://stackoverflow.com/comment/47737931
has text: From when "css" is a verb?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29805098
score: 2

http://stackoverflow.com/comment/47760059
type: Comment
type: QuestionComment
has text: @ozil: Am trying to get this in a long manipulated function which not a AJAX call....
comment on: http://stackoverflow.com/q/29815595
score: 0

http://stackoverflow.com/q/29815843
type: Question
has comment: http://stackoverflow.com/comment/47760082
has answer: http://stackoverflow.com/a/29815930
has comment: http://stackoverflow.com/comment/47759785
has answer: http://stackoverflow.com/a/29816050
tagged with: javascript
has comment: http://stackoverflow.com/comment/47759461
has comment: http://stackoverflow.com/comment/47759854
has comment: http://stackoverflow.com/comment/47759066
score: 0
answer count: 3
has body: How to avoid duplication of data using jquery? My code is : Generate Sl.No. District Name js: $("#gen").click(function(){ $("#report").css("visibility","visible"); for(var i=0; i<5; i++){ var row=' ('+(i+1)+') ' $("#report").append(row); } }); Each time when i clicking the button, the same data were shown. How to avoid it? sqlfiddle: http://jsfiddle.net/etdx5o08/
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29815930
has comment: http://stackoverflow.com/comment/47759034
possible better answer: http://stackoverflow.com/a/29815927
has title: Avoid duplication using jquery
has comment: http://stackoverflow.com/comment/47759084
has comment: http://stackoverflow.com/comment/47759664
has answer: http://stackoverflow.com/a/29815927
has comment: http://stackoverflow.com/comment/47759921
has comment: http://stackoverflow.com/comment/47758939
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47759573
has comment: http://stackoverflow.com/comment/47759410

http://stackoverflow.com/q/29832416
answer count: 3
has body: I am trying to add a Google Maps application to give the user the directions from his/her current location to a particular fixed static point on the map. So far I have created a controller and the related HTML. However, for some reason when I am testing this out I am not getting the map, but rather an error in the console "" This is my controller: 'use strict'; angular.module('main') .controller('LocationCtrl', function($scope, $ionicLoading, $compile) { function initialize() { google.maps.event.addDomListener(window, 'load'); var myLatlng = new google.maps.LatLng(43.07493, -89.381388); var mapOptions = { center: myLatlng, zoom: 16, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map"), mapOptions); //Marker + infowindow + angularjs compiled ng-click var contentString = " Click me! "; var compiled = $compile(contentString)($scope); var infowindow = new google.maps.InfoWindow({ content: compiled[0] }); var marker = new google.maps.Marker({ position: myLatlng, map: map, title: 'Uluru (Ayers Rock)' }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map, marker); }); $scope.map = map; } function loadScript(src) { var script = document.createElement("script"); script.type = "text/javascript"; document.getElementsByTagName("head")[0].appendChild(script); script.src = src; } loadScript('http://www.google.com.mt/jsapi'); loadScript('http://maps.googleapis.com/maps/api/js?key=&v=3&sensor=true&callback=initialize'); $scope.centerOnMe = function() { if (!$scope.map) { return; } $scope.loading = $ionicLoading.show({ content: 'Getting location', showBackdrop: false }); navigator.geolocation.getCurrentPosition(function(pos) { $scope.map.setCenter(new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude)); $scope.loading.hide(); }, function(error) { alert('Unable to get location: ' + error.message); }); }; $scope.clickTest = function() { alert('Example of infowindow with ng-click') }; }); Direc…
has comment: http://stackoverflow.com/comment/47793486
possible better answer: http://stackoverflow.com/a/29859179
has answer: http://stackoverflow.com/a/29859179
linked to: http://stackoverflow.com/q/29686922
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29833728
tagged with: ionic-framework
has answer: http://stackoverflow.com/a/29835789
accepted answer: http://stackoverflow.com/a/29833728
tagged with: google-maps
has title: Adding Google Maps to AngularJS & Ionic App
tagged with: javascript
tagged with: google-maps-api-3
score: 0
tagged with: angularjs

http://stackoverflow.com/a/29822824
has comment: http://stackoverflow.com/comment/47786121
answers question: http://stackoverflow.com/q/29819382
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/47786892
has comment: http://stackoverflow.com/comment/47778477
score: 14
has comment: http://stackoverflow.com/comment/47778602
has body: It seems that this function does not like 0 value. FF throws "SyntaxError: An invalid or illegal string was specified". Below code will ramp correctly. See on Plnkr. var context = new AudioContext(), osc = context.createOscillator(), gain = context.createGain(); osc.frequency.value = 440.0; // A note osc.start( 0 ); osc.connect( gain ); gain.connect( context.destination ); gain.gain.setValueAtTime(0.0001, context.currentTime); // &lt;-- line of interest gain.gain.exponentialRampToValueAtTime(1, context.currentTime + 10 ); UPDATE: "A NotSupportedError exception must be thrown if this value is less than or equal to 0, or if the value at the time of the previous event is less than or equal to 0" according Web Audio specification. As figured out by @cwilso (see comments).
has comment: http://stackoverflow.com/comment/47779844
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47780028
accepted answer of: http://stackoverflow.com/q/29819382
upvote count: 14
has comment: http://stackoverflow.com/comment/47797033
has comment: http://stackoverflow.com/comment/47791470

http://stackoverflow.com/comment/47726903
type: Comment
type: QuestionComment
has text: [Event loops](https://en.wikipedia.org/wiki/Event_loop) predate browsers, but I'm not sure whether that is your actual question. Have you done any research?
comment on: http://stackoverflow.com/q/29799316
score: 0

http://stackoverflow.com/comment/47522056
score: 1
comment on: http://stackoverflow.com/q/29692732
type: Comment
type: QuestionComment
has text: if you create regex as strings you need double escape `\\/`.

http://stackoverflow.com/a/29827199
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47785905
has comment: http://stackoverflow.com/comment/47780921
has comment: http://stackoverflow.com/comment/47784303
has comment: http://stackoverflow.com/comment/47781106
answers question: http://stackoverflow.com/q/29817190
downvote count: 0
has body: _.findIndex can return -1 in the case where it is not found. 0 is the first item in the array, -1 is not found. This will cause problems here if (toStateIndex === 0) { canGoToStep = true; } else { canGoToStep = myRouteSteps[toStateIndex - 1].valid; } When toStateIndex is -1 you will get index of out range exception. You probably want something like this: if (toStateIndex &lt; 0) { canGoToStep = true; } else { canGoToStep = myRouteSteps[toStateIndex].valid; } To explain how this could happen... When you first load your page, UI router will go to the '' state, when it tries to go to '' it triggers $stateChangeStart. _.findIndex cannot find '' in myRouteSteps and toStateIndex becomes -1. -1 is not equal to 0 so it falls in the else block, -1 - 1 is -2, myRouteSteps[-2] is out of range.
type: Answer
has comment: http://stackoverflow.com/comment/47782584

http://stackoverflow.com/comment/136798255
type: AnswerComment
has text: Love that it is also wrapped by self invoking asynchronous function.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29823632

http://stackoverflow.com/q/29739397
tagged with: arrays
has answer: http://stackoverflow.com/a/29739618
tagged with: ruby
tagged with: sinatra
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29739466
type: Question
has body: What I want to accomplish is to pass a 2D array from javascript to something that ruby will recognize. All objects are strings I have been using gon-sinatra, but it doesn't do exactly what I need. I can pass store the string I want to pass as gon.text doing @temp = gon.text array.push(@temp) This doesn't work because it shows gon.text as a nil object type, when I want it as a string. gon.text.to_s returns an empty string, so when I try to display it, nothing happens. alert("&lt;%= @temp %&gt;") // displays an empty string I'm at a bit of a loss here and don't know the best way to approach this. Would it be better to store the array as a json, and then read in the json using ruby instead?
tagged with: javascript
score: 0
answer count: 2
has title: Passing an array from javascript to ruby with sinatra

http://stackoverflow.com/comment/83280689
type: QuestionComment
comment on: http://stackoverflow.com/q/29821694
type: Comment
has text: Please also add your HTML form, including the form attribute
score: 0

http://stackoverflow.com/a/29793614
has comment: http://stackoverflow.com/comment/47717347
has comment: http://stackoverflow.com/comment/47715649
answers question: http://stackoverflow.com/q/29793366
has comment: http://stackoverflow.com/comment/47717473
score: 0
type: Answer
has body: $(document).ready(function(){ var text = $('span.conditionHilite').text(); var $el = $(".productbox .item .right"); if (text === "Approved Selection ONE"){ // do something here and then continue with the inner if // nested if: if ($('.head h1').text() === "Cisco") { // do whatever you need to do when this second condition is met... $el.before('&lt;span class="ciscoBanner"&gt;&lt;/span&gt;'); } else { $el.before( '&lt;span class="myAwesomeBanner"&gt;&lt;/span&gt;' ); } } else if (text === "Approved Selection" ){ $el.before( '&lt;span class="myAwesomeBanner2"&gt;&lt;/span&gt;' ); } });

http://stackoverflow.com/comment/47556232
type: Comment
comment on: http://stackoverflow.com/a/29710009
type: AnswerComment
has text: @firebend77 As for phonegap, I found it most useful to get a web app working in my browser first, and then put it into phonegap, assuming it doesn't make use of too many phone-only APIs. That might just be a personal preference, but it made the process faster (for me).
score: 0

http://stackoverflow.com/q/29704872
favorite count: 0
has answer: http://stackoverflow.com/a/29736144
has comment: http://stackoverflow.com/comment/47605829
type: UnansweredQuestion
has body: Let's say I have a PHP string that contains the following text, or some other text that is valid Javascript code if put into an interpreter: $js_script PHP variable var loaded = []; var loading = []; var downloading = []; function load(name) { loading.push(name); downloading.push(name); // do some asynchronous stuff, with the following callback: (function () { loaded.push(name); downloading = []; }); } I want to replace the variable loading (as in replace the variable name itself in the entire code) to l1, without using a full javascript parser, and thus producing the following output: $js_script PHP variable var loaded = []; var l1 = []; var downloading = []; function load(name) { l1.push(name); downloading.push(name); // do some asynchronous stuff, with the following callback: (function () { loaded.push(name); downloading = []; }); } The reasons I assume avoiding using a parser is a good choice: they seem to be extreme overkill for this single task, this is the only modification I wish to perform on the input code, I explicitly know the variable name I'm going to replace. I'm not concerned with performance, since the resulting output is to be cached. I thought about using regex for this, that is, finding all occurrences of "loading" in the code-string using: \bloading\b(?=[^"]*(?:"[^"]*"[^"]*)*$) ... which obviously doesn't support apostrophes yet, but other than that, seems to handle the task right so far. Is there something I'm missing? I know that JavaScript in wholesale is not a regular language, but how about this part? Should I forget about using regex, and utilize a parser instead?
tagged with: php
tagged with: regex
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47620328
has title: Using PHP, how do I reliably identify (find) a known Javascript variable name in a source string?
type: Question
has comment: http://stackoverflow.com/comment/47545637
tagged with: javascript
has comment: http://stackoverflow.com/comment/47755039
answer count: 1
downvote count: 0

http://stackoverflow.com/q/29710152
tagged with: ajax
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29710441
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47588074
has comment: http://stackoverflow.com/comment/47556011
has title: Jquery or Javascript or Ajax: Close iframe by clicking on it
has body: I would like to close the iframe and div, whenever someone clicks any link in iframe. I know it's possible, I've seen some websites doing this. Just do not remember the url of such websites. I copied this code on a site a while ago and was used to locate the click inside the iframe. Do not know how to use the script. $.enableFrameClick = function(){ var decoy = $('&lt;a href="#"/&gt;').css({ position: 'absolute', right:0, top:0, width:1, opacity:0 }).click(function(e){ return false }).appendTo(document.body); $(window).blur(function(){ if ($.inFrame){ $('#'+$.inFrame).trigger('click'); setTimeout(function(){ decoy.focus(); }, 10); } }); var ids = +(new Date); $('iframe').each(function(){ if (!this.id){ this.id = ++ids; } $(this).hover(function(){ $.inFrame = this.id; }, function(){ $.inFrame = null; }) }); }; $('#mha iframe').bind('click', function(){ $.ifrm(1); //log(['[',++i,']','clicked', this.id].join(' ')); }); function log(m){ //$('#log').text(m); //console.log(m); } var i = 0; $.ifrm = function(r){ $.get("http://www.example.com/"+r, function(html,status){ $('#mha iframe').attr("src",html); if(r == 1) html = ''; if(html == '') $('#fanback').remove(); }); }; $.enableFrameClick(); $.ifrm(0);
type: Question
has answer: http://stackoverflow.com/a/29710333
has comment: http://stackoverflow.com/comment/47556083
has answer: http://stackoverflow.com/a/29710259
tagged with: javascript
score: 0
answer count: 3
tagged with: jquery

http://stackoverflow.com/a/29729627
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29729099
score: 1
answers question: http://stackoverflow.com/q/29729099
type: AcceptedAnswer
downvote count: 0
has body: Yes, you should be reliable with second solution. Angular does not run the digest cycle when event occurred from outside angular context, at that you need to tell AngularJs to run apply cycle to update all bindings. When you are using $interval angular will run digest cycle after an execution of callback function, there is no need of running digest cycle which you have done in your 1st solution. You need to look at $interval service $interval($scope.updateView, 20, //delay 10, //this option will run it 10 times, if not specified then infinite times true, //do you want to run digest cycle after callback execution, defaulted to true {} //any extra params );

http://stackoverflow.com/q/29793125
accepted answer: http://stackoverflow.com/a/29793323
has title: How to get reference of iFrame from its caller in parent window
tagged with: iframe
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29793323
answer count: 1
has body: I have javascript module like below in my main page. var LX = (function () { this.print_msg(divID){ document.getElementById(divID).innerHTML = "some computed message"; //above line throw error : TypeError: document.getElementById(...) is null } // some others functions retrun this; })(); There are many iframes dynamically created in this page. code in all iFrame as below &lt;div id="msgDiv"&gt;&lt;/div&gt; &lt;script&gt; LX = parent.LX ; LX.print_msg("msgDiv"); &lt;/script&gt; my problem is How to get reference of iFrame from its caller in parent window ??
type: AnsweredQuestion

http://stackoverflow.com/comment/47811309
comment on: http://stackoverflow.com/a/29841582
has text: Hey I am really sorry to be such a hurry[actually I passed some other variable whose value was already set before form submission,which worked ] and gave it correct. But what I wanted was something I am setting in the present form and pass it. Let me try I guess my brand is null thats why it shows nothing but for previous case it worked. Let me test.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29822768
has title: XML3D API methods and scene hierarchy
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29827089
accepted answer: http://stackoverflow.com/a/29827089
type: Question
tagged with: javascript
upvote count: 1
has body: I'm using XML3D library to make a simple 3D editor. I wonder if the users of this library are supposed to use its API too or just treat this lib as a tool that renders scene from XML scene definition. First thing i need would be to create some js scene representation. There is a plenty of tool for XML->JSON conversion but maybe accessing the XML3D internal scene representation would be the better way to handle scene modification. Could you please give me any advices on scene manipulation with this library?
answer count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/xml
tagged with: xml3d

http://stackoverflow.com/comment/48035005
comment on: http://stackoverflow.com/a/29721373
score: 0
type: Comment
has text: Oh, sorry for that. It seems like the most effective way to check that is using something like https://github.com/serkanyersen/ifvisible.js - I updated the JSFiddle: http://jsfiddle.net/nvobhaor/18/ and it now works perfectly for your purpose.
type: AnswerComment

http://stackoverflow.com/a/29735028
accepted answer of: http://stackoverflow.com/q/29734752
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Please, remove ; from posts: []; var app = angular.module('flapperNews', []); app.factory('posts', [ function() { var o = { posts: [] }; return o; } ]); app.controller('MainCtrl', ['$scope', 'posts', function($scope, posts) { $scope.test = 'Hello world!'; $scope.posts = posts.posts; $scope.addPost = function() { if (!$scope.title || $scope.title === '') { return; } $scope.posts.push({ title: $scope.title, upvotes: 0, link: $scope.link }); $scope.title = ''; $scope.link = ''; } $scope.incrementUpvotes = function(which) { which.upvotes += 1; } } ]); {{post.upvotes}} {{post.title}} {{post.title}} Add a new post Post
answers question: http://stackoverflow.com/q/29734752
upvote count: 2

http://stackoverflow.com/comment/47518726
score: 0
comment on: http://stackoverflow.com/q/29691102
type: Comment
type: QuestionComment
has text: Have you tried ` This is a special day for me `

http://stackoverflow.com/comment/47744635
has text: thanks, I want to eliminate render-blocking, so have inlined the first code but the 1.11.1 I don't fully understand it's purpose or know of an alternative.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29808107
type: Comment

marker
tag name: marker
tags question: http://stackoverflow.com/q/29806815
tags question: http://stackoverflow.com/q/29730582
tags question: http://stackoverflow.com/q/29765720
tags question: http://stackoverflow.com/q/29806300
type: Tag

http://stackoverflow.com/q/29810741
tagged with: zurb-foundation
type: UnansweredQuestion
has body: I'm building a CMS based on Zurb Foundation, and one thing I'd really like to do is allow the user to switch between large/medium/small layouts via a button so that they can both preview how the page looks at this size, but also so they can set up columns etc. for different breakpoints. Media queries are predicated on the window width, and I've been so far able to build something that my users find quite intuitive, and I feel that asking them to resize their browser window to change the mode seems a bit iffy. An immediate way that I can think of would be to use an iframe for the main edit view, but the problem is that the page interactions I have are quite complex, drag &amp; drop, drag to resize etc. - I have all of these working at present with both mouse and touch, and in order to drag &amp; drop between the parent and an iframe I'd have to rewrite a significant amount of code. So I'd rather avoid this if at all possible. I'm looking for suggestions/advice on how I could make this work - workarounds and hacks are fine. This is how it looks at the moment, to give you an idea of the kind of interface I currently have - no live link that I can share atm, sorry:
tagged with: content-management-system
tagged with: media-queries
type: Question
has answer: http://stackoverflow.com/a/29812078
answer count: 1
tagged with: javascript
score: 0
has title: Zurb Foundation based CMS, preview effect of media queries

http://stackoverflow.com/comment/47735701
type: Comment
type: QuestionComment
has text: This seems weird because I want to set the page to the state when it is loaded. Why do I need a fixture for this?
comment on: http://stackoverflow.com/q/29718503
score: 0

http://stackoverflow.com/q/29689229
has title: How to let Angular JS ng-init only under certain condition?
type: Question
has answer: http://stackoverflow.com/a/29689652
answer count: 1
has comment: http://stackoverflow.com/comment/47516419
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has body: Let say I have the following short input form: As you may already know, the model x in childController will follow the value of of model x in parentController until the user type in something in the childController input field, so the user can simply change the value in parent for bulk input and then fine tune in child. Now, after the user have submitted the form, I want to call the same form for editing function. To keep the bulk input function on new items, is there a way I can ng-init model x in childController only when there is a previous value?
upvote count: 1
tagged with: angularjs-ng-init

http://stackoverflow.com/a/29829468
has comment: http://stackoverflow.com/comment/63133088
type: Answer
score: 11
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29817796
answers question: http://stackoverflow.com/q/29817796
upvote count: 11
type: AcceptedAnswer
has body: First, you need to use: var jSon = JSON.stringify({obj:javascriptObject}); instead of: var jSon = JSON.stringify(javascriptObject); Then your WebMethod would be like: [WebMethod] public static string Updatera(aData obj) { // logic code } Now here aData is your class something like below : public class aData { public string Foretagsnamn { get; set; } public string BGFarg { get; set; } public string TextColor { get; set; } public string FooterFarg { get; set; } public string Email { get; set; } } So your final code look like jQuery: var jSon = JSON.stringify({ obj:javascriptObject }); $.ajax({ type: "POST", url: "Post/Installningar.aspx/Updatera", data: jsonData, contentType: "application/json; charset=utf-8", dataType: "json", success: OnSuccess, error: OnErrorCall }); function OnSuccess(response){ // Do something } function OnErrorCall(){ // Do something } Code Behind: public class aData { public string Foretagsnamn { get; set; } public string BGFarg { get; set; } public string TextColor { get; set; } public string FooterFarg { get; set; } public string Email { get; set; } } [WebMethod] public static string Updatera(aData obj) { // Logic code }

http://stackoverflow.com/comment/125750970
has text: What you are doing wrong there is passing the return value of the call to handleSort and of course, it happens at page load
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29810914

http://stackoverflow.com/comment/47742311
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29807029
has text: You should target it by that unique attribute https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors

http://stackoverflow.com/comment/49270170
has text: possible duplicate of [How to handle ECONNRESET, Connection reset by peer](http://stackoverflow.com/questions/4088222/how-to-handle-econnreset-connection-reset-by-peer)
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29784507
score: 0

http://stackoverflow.com/q/29839777
tagged with: three.js
has comment: http://stackoverflow.com/comment/71950402
has comment: http://stackoverflow.com/comment/47805832
linked to: http://stackoverflow.com/q/11020405
type: AnsweredQuestion
score: 7
has body: Three.js has function called THREE.Triangle() and I would like to know how to use it.
linked to: http://stackoverflow.com/q/6100528
type: Question
has comment: http://stackoverflow.com/comment/47805766
answer count: 1
tagged with: javascript
favorite count: 0
downvote count: 3
upvote count: 10
tagged with: http://stackoverflow.com/tag/html
has title: How to use Three.Triangle() in three.js
has answer: http://stackoverflow.com/a/29843694
accepted answer: http://stackoverflow.com/a/29843694

http://stackoverflow.com/comment/47761380
type: QuestionComment
type: Comment
score: 2
has text: Are you trying to imitate a REST call? If so: A $http request returns a promise, which you can use inside the controller with .then() to change the scope. Don't set a new scope and $apply() inside the REST call. Because, what you are doing now is pointless.
comment on: http://stackoverflow.com/q/29817111

http://stackoverflow.com/a/29701881
accepted answer of: http://stackoverflow.com/q/29700887
answers question: http://stackoverflow.com/q/29700887
has body: Quoting the docs on storage.local: 5,242,880 QUOTA_BYTES The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. Emphasis mine. You need to add "unlimitedStorage" to your permissions in the manifest.
score: 3
has comment: http://stackoverflow.com/comment/47539898
type: AcceptedAnswer
upvote count: 3
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/47539867

http://stackoverflow.com/q/29725943
has body: Here's the problem I'm trying to solve: Write a program that asks a user to enters pairs of numbers until they enter "quit". As each pair of numbers is entered and validated, add the numbers using a function. The function will have two parameters for the pair of numbers and will return the sum. After the user enters "quit", output all the pairs of numbers and their sums. I've got the program to output number1, number2 and the sum when I just do one, but when I try to repeat until the user enters "quit" I seem to break it? //function to sum 2 entered numbers function sum2enteredNumbers(number1, number2) { var sum1and2; sum1and2 = number1 + number2; return sum1and2; } function exercise4Part1() { // PART 1: YOUR CODE STARTS AFTER THIS LINE var QUIT_CODE = "quit"; var output; var number1; var number2; while (number1 !== QUIT_CODE || number2 !== QUIT_CODE) { number1 = Number(prompt("Enter a number:")); number2 = Number(prompt("Enter another number:")); } sum1and2 = sum2enteredNumbers(number1, number2); output = document.getElementById('outputPart1'); output.innerHTML = "&lt;br /&gt;Entry 1: " + number1 + " Entry 2: " + number2 + " Sum: " + sum1and2; } Attempt 2--still not working: function sum2enteredNumbers(number1, number2) { var sum1and2; sum1and2 = number1 + number2; return sum1and2; } function exercise4Part1() { // PART 1: YOUR CODE STARTS AFTER THIS LINE var QUIT_CODE = "quit"; var output; var number1; var number2; while (number1 !== QUIT_CODE &amp;&amp; number2 !== QUIT_CODE) { number1 = prompt("Enter a number or \"quit\":"); number2 = prompt("Enter another number or \"quit\":"); if (number1 !== QUIT_CODE &amp;&amp; number2 !== QUIT_CODE) { number1 = Number(number1); number2 = Number(number2); } } sum1and2 = sum2enteredNumbers(number1, number2); output = document.getElementById('outputPart1'); output.innerHTML = "&lt;br /&gt; Entry 1: " + number1 + " Entry 2: " + number2 + " Sum: " + sum1and2; }
has answer: http://stackoverflow.com/a/29726832
tagged with: sentinel
accepted answer: http://stackoverflow.com/a/29726832
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47585967
type: Question
tagged with: function
answer count: 1
has comment: http://stackoverflow.com/comment/47586413
tagged with: javascript
has comment: http://stackoverflow.com/comment/47586021
score: 0
has comment: http://stackoverflow.com/comment/47586152
has comment: http://stackoverflow.com/comment/47585955
has title: user to enters pairs of numbers until they enter "quit", sentinel not working?
tagged with: loops

http://stackoverflow.com/q/29701246
upvote count: 8
tagged with: django
has comment: http://stackoverflow.com/comment/47539225
type: AnsweredQuestion
tagged with: django-templates
has title: Move all Javascript to a separate file in Django
has answer: http://stackoverflow.com/a/29701997
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47538652
has answer: http://stackoverflow.com/a/29704758
has body: I'm beginning with Django and doing some stuff. I want to keep html files clean, without &lt;script&gt; blocks. Is it possible, even if my js part is using {% url %} blocks? Example: page.html &lt;div&gt; &lt;h1&gt; My home url is: &lt;/h1&gt; &lt;div id="js-tag" &gt;&lt;/div&gt; &lt;/div&gt; &lt;script&gt; $(function(){ $('#js-tag').html("{% url 'home' %}") }); &lt;/script&gt; What I want to is remove this and place it on a separate js file and just import it to page.html
answer count: 2
accepted answer: http://stackoverflow.com/a/29701997
downvote count: 0
possible better answer: http://stackoverflow.com/a/29704758
favorite count: 0
score: 8

http://stackoverflow.com/q/29695438
tagged with: javascript
has body: I have a small js script and some clients, which use it. A few days ago a client came to me with the site on 2 differnet domains. My script store some data in cookies. When users within single site go to another domain - i can't access this cookie. I'm looking for a solution and come to a standstill. I have a server that hosts this script and i read that if site load script from my server - i can set cookie on my server domain. It's true? For example - if i go to vk.com i can open dev tools and see cookies on domains .scorecardresearch.com and .tns-counter.ru. How can i do something like this?
answer count: 1
favorite count: 0
has title: Third party cookie in iframe
type: UnansweredQuestion
tagged with: iframe
has answer: http://stackoverflow.com/a/29696159
tagged with: cookies
score: -1
downvote count: 1
type: Question
upvote count: 0

http://stackoverflow.com/q/29802430
tagged with: webgl
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29826816
tagged with: 3d
tagged with: javascript
linked to: http://stackoverflow.com/q/27554969
answer count: 1
downvote count: 0
tagged with: antialiasing
score: 1
has comment: http://stackoverflow.com/comment/53532625
favorite count: 0
type: UnansweredQuestion
has title: Dynamically switch antialiasing on/off with three.js
tagged with: three.js
has body: Is it possible to dynamically switch antialiasing on/off with three.js? I tried the following which doesn't work at all: ` var rendererAA = new THREE.WebGLRenderer({{ antialias: true }}); rendererAA.setSize( window.innerWidth, window.innerHeight ); document.body.appendChild( rendererAA.domElement ); var rendererNA = new THREE.WebGLRenderer({{ antialias: false }}); rendererNA.setSize( window.innerWidth, window.innerHeight ); rendererNA.domElement = rendererAA.domElement; var renderer = rendererAA; function render() { if (somePredicate) { renderer = rendererAA; }else { renderer = rendererNA; } requestAnimationFrame( render ); renderer.render( scene, camera ); }` If the active renderer is rendererNA (somePredicate = false), the scene just freezes and no change in antialiasing. I also tried to set the inactive renderers domElement to null, which didn't help. I was inspired by this question: Dynamically turn on/off antialiasing and shadows in WebGLRenderer But there was no definite answer.

http://stackoverflow.com/comment/65903108
has text: Fix your file encoding or your encoding header.
comment on: http://stackoverflow.com/q/29714724
score: 2
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47542399
type: AnswerComment
has text: It has no right to assume that JavaScript in domain A is not malicious.
comment on: http://stackoverflow.com/a/29703027
type: Comment
score: 0

http://stackoverflow.com/q/29801958
answer count: 1
has answer: http://stackoverflow.com/a/30384585
has title: Missing price fields in Magento Bundle products
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/30384585
type: Question
has body: I am getting the following JS error on bundled product pricing could anyone help me to the reason why this could be please. It looks like a conflict or a result of the missing fields. It appears this is causing the pricing to display incorrectly TypeError: $(...) is null $('price_type').observe('change', changePriceTypeMap); This is what is supposed to appear like
tagged with: magento
tagged with: javascript
score: 0

http://stackoverflow.com/a/54153014
type: Answer
answers question: http://stackoverflow.com/q/29805704
has body: I used a combination of 2 packages. In my use case I had to parse response of a SOAP request: The first package is - React Native XML2JS The reason for using it and not XML2JS is I was getting an error of React Native not supporting node standard library. (I am using expo as well.) The second package which I actually used for parsing is - XML-JS. I had to use the first package as I was getting the same error of React Native not supporting node standard library. I used this because it gave a more structured result in case of a large XML response.
score: 0

http://stackoverflow.com/comment/47640252
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29753984
has text: @WakeskaterX So accessing js scripts that do UI manipulation -- through Web Workers -- is impossible? How about caching those scripts in Local Storage?
score: 0

http://stackoverflow.com/a/29819127
type: Answer
score: 2
downvote count: 0
has body: Use event delegation for adding and removing the class dynamically. If the Dom didn't know the class is removed or not on traversed so use of document or immediate parent selector to traverse it again and check the class is found or not $(document/immediateParent).on('click', '.edit_agent_val' ,function(e){ **// This should not work** // some code... }); $(document/immediateParent).on('click', '.edit_agent_val2', function(e){ **// This should work** // some code... });
answers question: http://stackoverflow.com/q/29819033
upvote count: 2

http://stackoverflow.com/comment/47529495
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/29696727
has text: try giving it as `$(document).on("click",".info", function(e){`
type: Comment

http://stackoverflow.com/comment/47526426
type: QuestionComment
comment on: http://stackoverflow.com/q/29694820
has text: its working fine: http://jsfiddle.net/j4mawjv7/
score: 0
type: Comment

http://stackoverflow.com/a/29723812
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29723530
score: 1
has body: When manipulating the DOM via Javascript (or a Javascript library or framework) you must bring those elements of the DOM you want to manipulate into existence before you attempt to manipulate them. If you don't, then... there is simply nothing there to manipulate.
upvote count: 1

http://stackoverflow.com/q/29815149
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/47758666
upvote count: 2
has title: Get linearly spread array of dates between two dates, given count of desired dates - javascript, d3.js, moment.js
tagged with: d3.js
has answer: http://stackoverflow.com/a/29815643
type: Question
has comment: http://stackoverflow.com/comment/47758390
has comment: http://stackoverflow.com/comment/47757754
has comment: http://stackoverflow.com/comment/47758530
has body: Let's say I have dates: Mon Mar 31 2014 05:42:35 GMT+0200 (CEST) Wed Sep 02 2015 10:29:38 GMT+0200 (CEST) and totalNumberOfDates = 37; I'd like to get array of 37 dates (first and last date should be those above), which are exactly linearly spread between given dates. I'd appreciate elegant solution in D3.js or moment.js
answer count: 2
has comment: http://stackoverflow.com/comment/47758622
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29815643
favorite count: 0
has answer: http://stackoverflow.com/a/29817212
accepted answer: http://stackoverflow.com/a/29817212
has comment: http://stackoverflow.com/comment/47758332
tagged with: momentjs

http://stackoverflow.com/comment/47609273
comment on: http://stackoverflow.com/q/29738023
type: Comment
has text: But I need an infinite loop in order to keep reading a value from another device.
type: QuestionComment
score: 0

http://stackoverflow.com/a/29710791
downvote count: 0
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29708416
has body: I think your problem is that you cant store global variable in sinatra as usual. You need to store page views count data in setting like this set :my_config_property, 'hello world' Here is docs about it http://www.sinatrarb.com/configuration.html SO question about it In Sinatra(Ruby), how should I create global variables which are assigned values only once in the application lifetime?

http://stackoverflow.com/a/45278843
has comment: http://stackoverflow.com/comment/83006259
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29749544
has body: I tried all the answers above, but didnt work for me. Then I tried to install express-static using "npm install -g express-static --save". And used in the code like below, var pathComp= require("express-static"); app.use(pathComp(__dirname+"/client")); Sharing this though its an old thread. For more reference visit, https://www.npmjs.com/package/express-static
downvote count: 0
type: Answer

http://stackoverflow.com/a/29794744
has body: You should get all existed keys and after create new Objects with fill "empty" keys: function mergeArrays(){ var keys = {}; //save all existed keys for(var i=arguments.length;--i;){ for(var j=arguments[i].length;--j;){ for(var key in arguments[i][j]){ keys[key] = true; } } } var res = []; for(var i=arguments.length;--i;){ for(var j=arguments[i].length;--j;){ //set clone of object var clone = JSON.parse(JSON.stringify(arguments[i][j])); for(var key in keys){ if(!(key in clone)){ clone[key] = undefined; } } res.push(clone); } } return res; } https://jsfiddle.net/x3b0tk3g/
type: Answer
answers question: http://stackoverflow.com/q/29794051
score: 0

http://stackoverflow.com/comment/47794428
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29833658
has text: I see. But what about the "mapObject" property of the layer? It seems to be a fully-fledged Google Maps object, with a streetViewControl property. There's no functionality I can use here?
type: AnswerComment

http://stackoverflow.com/q/29838829
tagged with: validation
tagged with: model
has title: Sequelize create method is ignoring validation rules
has answer: http://stackoverflow.com/a/29841156
accepted answer: http://stackoverflow.com/a/29841156
tagged with: node.js
type: AnsweredQuestion
has body: I am building a small REST API with node, hapi and sequelize. When attempting to create a new user without the required data, I expect validation errors. Instead, I receive database errors. The model: 'use strict'; module.exports = function(sequelize, DataTypes) { var User = sequelize.define('User', { email: { type: DataTypes.STRING, validate: {notEmpty: true, isEmail: true} }, password: { type: DataTypes.STRING, validate: {notEmpty: true, min: 6} }, name: { type: DataTypes.STRING, validate: {notEmpty: true} }, is_active: { type: DataTypes.BOOLEAN }, api_key: { type: DataTypes.STRING, validate: {notEmpty: true} } }, { classMethods: { associate: function(models) { // associations can be defined here User.hasMany(models.Keeper); } }, timestamps: true, createdAt: 'created', updatedAt: 'modified', deletedAt: false } ); return User; }; The code: exports.users = { /* ... */ create: function(req, reply) { models.User.create(req.payload) .then(function(err, user) { /* ... */ }) .catch(function(err) { console.log(err); }); reply('test'); }, /* ... */ }; The error: { [SequelizeDatabaseError: ER_NO_DEFAULT_FOR_FIELD: Field 'password' doesn't have a default value] name: 'SequelizeDatabaseError', message: 'ER_NO_DEFAULT_FOR_FIELD: Field \'password\' doesn\'t have a default value', parent: { [Error: ER_NO_DEFAULT_FOR_FIELD: Field 'password' doesn't have a default value] code: 'ER_NO_DEFAULT_FOR_FIELD', errno: 1364, sqlState: 'HY000', index: 0, sql: 'INSERT INTO `Users` (`id`,`email`,`modified`,`created`) VALUES (DEFAULT,\'email@email.com\',\'2015-04-24 04:35:49\',\'2015-04-24 04:35:49\');' }, original: { [Error: ER_NO_DEFAULT_FOR_FIELD: Field 'password' doesn't have a default value] code: 'ER_NO_DEFAULT_FOR_FIELD', errno: 1364, sqlState: 'HY000', index: 0, sql: 'INSERT INTO `Users` (`id`,`email`,`modified`,`created`) VALUES (DEFAULT,\'email@email.com\',\'2015-04-24 04:35:49\',\'2015-04-24 04:35:49\');' }, sql: 'INSERT INTO `Users` (`id`,`email`,`modified`,`created`) VALUES (DEFAU…
possible better answer: http://stackoverflow.com/a/29840226
has answer: http://stackoverflow.com/a/29840226
type: Question
tagged with: javascript
score: 0
answer count: 2
tagged with: sequelize.js

http://stackoverflow.com/q/29745680
has answer: http://stackoverflow.com/a/55989404
has title: how to open only one window popup and restrict it to only one window
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/39873171
has comment: http://stackoverflow.com/comment/47624530
tagged with: popupwindow
has answer: http://stackoverflow.com/a/29746318
score: 1
has answer: http://stackoverflow.com/a/29745841
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47624834
has comment: http://stackoverflow.com/comment/47623920
tagged with: http://stackoverflow.com/tag/html
answer count: 4
has comment: http://stackoverflow.com/comment/47623669
has body: I want to open only one popup window after clicking an URL. but if i click the same URL another popup window is opening . so now there are two popup. can anybody help on this issue as I want to restrict it to only one window. Code:- Link 1 Link 2 Link 3
tagged with: popup
upvote count: 2
has comment: http://stackoverflow.com/comment/47626042

http://stackoverflow.com/a/30311316
score: 0
accepted answer of: http://stackoverflow.com/q/29721171
type: AcceptedAnswer
has body: A colleague of mine found the solution. Thank's everyone for your help. Option 1: Replace part of my original JS: "document.getElementsByTagName("a")[0].innerHTML" with: "window.location" Or Option 2: jsfiddle Replace all of my original JS: $var anchors = document.querySelectorAll('a[href$="http://www.3.com"]'); Array.prototype.forEach.call(anchors, function (element, index) { element.href = document.getElementsByTagName("a")[0].innerHTML; }); With: var anchors = $('a[href$="http://www.3.com"]'); $.each(anchors, function (index, element) { $(element).attr('href',$(element).text()); });
type: Answer
answers question: http://stackoverflow.com/q/29721171

http://stackoverflow.com/comment/47690686
type: Comment
comment on: http://stackoverflow.com/a/29779575
has text: @adeneo your code is broken somehow, though I'm not sure why: [fiddle](http://jsfiddle.net/zn586bqc/)
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47725836
score: 0
type: Comment
has text: and where it says var image = new image (), would mine say var snake = new image()? I want my image to be part of the snake object, so that I can do stuff with it if thats makes sense
type: AnswerComment
comment on: http://stackoverflow.com/a/29798659

http://stackoverflow.com/q/29800530
answer count: 0
has comment: http://stackoverflow.com/comment/47729370
has comment: http://stackoverflow.com/comment/47730630
tagged with: transition
type: Question
tagged with: performance
tagged with: javascript
has body: Ι'm writing a calendar in Jquery. Now i want to fade in and fade out the diffrent views(Days,Month,Years,Decade etc). I tried it with Jquery.animation , but a friend told me, that the performance is better using CSS transition. So i used CSS transition, but the performance is crazy. Sometimes its smooth and perfect but when i click to fast or to often it always laggs. I'm just changing the Width and the Height of the Divs. What can i do to increase the Performance? Thats how Ι implemented this: $('#Monat-Jahr').click(function openMonth() { if( $('#tableKalender').hasClass('open')){ $('#tableKalender').removeClass('open'); }; $('#tableKalender').addClass('close'); $('#Kalender').addClass('close'); $('#Clock').addClass('close'); $('#CalendarClock').css("visibility","hidden"); $('#Kalender').css("visibility","hidden"); $('#btnMonate').css("visibility","visible"); if ($('#Monate').hasClass('close')) { $('#Monate').removeClass('close'); } $('#Monate').addClass('open'); $('#Monate').css("visibility", "visible"); }); #tableKalender { width: 246px; height: 165px; font-family: Calibri; font-size: 10pt; transition: all 0.5s linear 0s; overflow: hidden; margin-right: 4px; } #tableKalender.close { width:0px ; height:0px ; } #tableKalender.open { width:246px; height:165px; } KW Mo Di Mi Do Fr Sa So
has comment: http://stackoverflow.com/comment/47730021
score: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/47729229
has comment: http://stackoverflow.com/comment/47730728
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47731098
has title: Performance Problems with Transition
tagged with: css
has comment: http://stackoverflow.com/comment/47729692

http://stackoverflow.com/comment/71353648
type: Comment
has text: fromEvent didnt work for me. And I ended up with this solution instead. In TS its: `let obs = Observable.fromEventPattern(h => this.socket.on('my_event', h));`
comment on: http://stackoverflow.com/a/29814398
type: AnswerComment
score: 0

http://stackoverflow.com/q/29706124
downvote count: 0
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29706695
has comment: http://stackoverflow.com/comment/47549801
upvote count: 1
has title: Change image source after page load for select links
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/1780364
has body: I'm looking to change two image sources that are being generated by an app after page load. What is currently occurring is the app is loading 4 images from the local website's collections, all of which are thumb sized versions. I'm trying to change these links that are being generated after page load for the last 2 images to load normal sized images. The file structure it uses is ..../small/img and I need to change it to ..../large/img. I'm not finding a lot of information on how to do this for image sources, so I turn to SO. Thanks! ADDITIONAL I have found what looks to be what is in the right direction to a solution, but still misses the mark by a lot. Hopefully this can help someone give me a solid answer. function changeImage(img) { document.getElementById("img").src = img.src.replace("small", "large"); } I may be completely incorrect, but if this kind of does it then the last step is just figuring out how to target just the last two images without any unique id, similar i guess to the css selector :nth-child(3) & :nth-child(4). I've added the javascript tag, though i'm open to (if it's even possible) any non-javascript solutions. EDIT I was able to change the class for the bottom section which makes up the last two images, the html reflects:
accepted answer: http://stackoverflow.com/a/29706695
type: Question
tagged with: javascript
tagged with: image
has comment: http://stackoverflow.com/comment/47549867
answer count: 1

http://stackoverflow.com/q/29793650
has title: Upload file/image with AngularJs
tagged with: file-upload
has comment: http://stackoverflow.com/comment/47716083
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29793975
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29793823
has body: I want upload a file (so image) with AngularJs...I read the AngularJs don't support tag input type="file" so I read that I need of custom directive...I want fetch the input file and use it for show preview (thumbnail) on same page html and in controller upload the file on server...in my page html I wrote this code: Select file File content is: {{ content }} I wrote this directive: var modulo = angular.module('myApp', []); modulo.directive('fileModel', function () { return { restrict: 'A', link: function(scope, element, attrs) { element.on('change', function (event) { var file = event.target.files[0]; scope.$emit("fileSelected", file); }); } }; }); And this is my controller: modulo.controller('myController', function ($scope) { $scope.$on('fileSelected', function (event, args) { $scope.content(args.file); console.log(args.file); }); }); This code don't work...is there a solution? Where is the error?
has comment: http://stackoverflow.com/comment/47715993
type: Question
tagged with: angularjs-directive
answer count: 2
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/17063000
score: 2
downvote count: 0

http://stackoverflow.com/comment/47699512
type: AnswerComment
type: Comment
has text: That's interesting, except it would mean that the offset would need to be stable over the range covered by the chart. See "Time Zone != Offset" in [the timezone tag wiki](http://stackoverflow.com/questions/tagged/timezone). If the offset is stable, then that would work fine. Otherwise, converting to UTC is probably a good idea.
comment on: http://stackoverflow.com/a/29784144
score: 0

http://stackoverflow.com/comment/47809880
comment on: http://stackoverflow.com/q/29841736
has text: The result from SVG converter is the way to go. With paths and other SVG objects available you can go ahead and script your animation. What have you tried so far?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47676517
has text: can you not wrap your code in window.onload ?
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29772994

http://stackoverflow.com/comment/47637513
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29730519
has text: @SLaks are you online
score: 0

http://stackoverflow.com/q/29733442
has comment: http://stackoverflow.com/comment/47600073
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47600083
linked to: http://stackoverflow.com/q/383402
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47600219
duplicate of: http://stackoverflow.com/q/383402
has body: I have read lots of paragraphs on w3schools that are telling us to avoid "new" when there is an another option. "new" Keyword is easy to use so why are they telling us to avoid it? What are the advantages of using literals? var family = [ new Person("Bob",13), new Person("Bo0",103), new Person("hfg",163), new Person("timmy",6) ] instead of this var family = new Array(); family[0] = new Person("alice", 40); family[1] = new Person("bob", 42); family[2] = new Person("michelle", 8); which one is better or wise? English is not my native. Please correct mistakes if possible. Thanks.
has title: Should I use "new" over literals?
answer count: 0
upvote count: 3
linked to: http://stackoverflow.com/q/5224295
has comment: http://stackoverflow.com/comment/47600057
type: Question
score: 3
tagged with: javascript

http://stackoverflow.com/a/29698683
type: AcceptedAnswer
has body: You are not resolving promise correctly, You should collect all the promise in array and then use $q.all to resolve the deferred promise Code this.getBenchmarkData = function () { var benchmarkData = []; var d = $q.defer(), promise = []; users.forEach(function(user){ var dataArray = []; modules.forEach(function (module) { var currentPromise = $http.get(api.getUrl('teamUserBenchmark', [user.user_id, module.id, user.team_id])) .success(function (response) { response.forEach(function(result){ dataArray.push(result.score); }) }); promise.push(currentPromise); //&lt;--creating promise array here }); }); $q.all(promise).then(function(){ benchmarkData.push(dataArray); //added whole data. d.resolve(benchmarkData); //resolved after all promise gets completed }); return d.promise
has comment: http://stackoverflow.com/comment/47536054
type: Answer
has comment: http://stackoverflow.com/comment/47533462
downvote count: 1
upvote count: 4
accepted answer of: http://stackoverflow.com/q/29698440
answers question: http://stackoverflow.com/q/29698440
has comment: http://stackoverflow.com/comment/47533600
has comment: http://stackoverflow.com/comment/47533385
score: 3

http://stackoverflow.com/a/29774301
type: Answer
downvote count: 0
score: 1
upvote count: 1
has body: The reason it doesnt is because the preview is not in separate window Try this code http://plnkr.co/edit/Xg8d2pZlOTGreCi65SND?p=preview **Update To open the result in separate window, click on fullscreen icon on top right corner of the result area So, i added ng-if="!fullscreen" in Submit input Submit Form
answers question: http://stackoverflow.com/q/29773848

http://stackoverflow.com/a/29735250
has body: Well, you messed things up, but instead of fixing this code, I prefer that you choose a better approach on table manipulation, this is definitely NOT the way you should do it. Check this article: http://www.htmlgoodies.com/beyond/css/working_w_tables_using_jquery.html I believe that you will get it right when you apply what is inside. (:
type: Answer
answers question: http://stackoverflow.com/q/29734848
score: 0

http://stackoverflow.com/q/29743929
tagged with: javascript
has answer: http://stackoverflow.com/a/29744079
has title: How can I make a hidden image appear after scrolling down a certain amount of pixels?
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I've begun experimenting with javascript/jquery and have hit my first snag. Everything works but that. I have a nav bar that fixes to the top of the page when you scroll down to it and it has a hidden image in it. I'm trying to make it visible and fade in when the nav bar hits the top and fade out when you scroll back up. I've tried using several solutions but nothing seems to work. I'm pretty sure the problem is me failing at writing this so can anyone shine some light? CSS: #navimg { padding: 0px 0px 0px 0px; margin: 0px; height: 45px; visibility: hidden; } Javascript: $(function() { var sticky_navigation_offset_top = $('#sticky_navigation').offset().top; var sticky_navigation = function(){ var scroll_top = $(window).scrollTop(); if (scroll_top &gt; sticky_navigation_offset_top) { $('#sticky_navigation').css({ 'position': 'fixed', 'top':0, 'left':0 }); } else { $('#sticky_navigation').css({ 'position': 'relative' }); } }; sticky_navigation(); $(window).scroll(function() { // sticky_navigation(); }); }); $(window).scroll(function(){ if($(window).scrollTop()&lt;200){ $('#navimg').css({ 'visibility': 'visible' }); } else { $('#navimg').css({ 'visibility': 'hidden' }); } });
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/q/29708416
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/4525482
tagged with: ruby
upvote count: 0
type: UnansweredQuestion
has body: How to implement a page views counter in Sinatra and Ruby? I have tried the @@ variables but they reset to zero whenever the page is loaded... Like this one: http://148.251.142.233:8080/ Thanks!
has answer: http://stackoverflow.com/a/29710791
has comment: http://stackoverflow.com/comment/47555241
has answer: http://stackoverflow.com/a/29727695
score: -1
has comment: http://stackoverflow.com/comment/47565707
type: Question
answer count: 2
has title: Page Views counter sinatra?
has comment: http://stackoverflow.com/comment/47556497
downvote count: 1
tagged with: javascript
favorite count: 0
tagged with: sinatra

http://stackoverflow.com/comment/47655212
comment on: http://stackoverflow.com/a/29761534
score: 0
type: Comment
has text: Well now I just feel silly! Thank you so much man. It's like trying to find the ketchup in the fridge!
type: AnswerComment

http://stackoverflow.com/comment/47591240
has text: Do words contain non-alpha characters?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29728757

http://stackoverflow.com/q/29755250
has answer: http://stackoverflow.com/a/46735084
has comment: http://stackoverflow.com/comment/47643494
possible better answer: http://stackoverflow.com/a/42527025
has comment: http://stackoverflow.com/comment/47644265
has answer: http://stackoverflow.com/a/42527025
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/67028248
answer count: 3
has title: "Hide" a YouTube Video's Loading screen
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47643159
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
downvote count: 0
has body: After looking through the YouTube IFrame API, I haven't been able to find anything that can help me. My goal is to "hide" the loading screen a YouTube video has; i.e. this black screen with a spinning wheel. While it only appears for a brief second and doesn't bother me, it's bothersome when trying to use a YouTube as the background of an element. My approach to solving this problem was to have a picture of the first frame of the YouTube video overlap the video and then hide it when video starts playing. I originally thought I'd be able to use onStateChange and watch for the YT.PlayerState.PLAYING value so I can hide the image but this event is triggered when it is about to start playing; in other words, it hides the images when the video is about to start playing which is when the loading screen appears. Are there any other approaches to this or am I stuck with the brief loading screen or would a self-hosted video be the better approach? I wanted to avoid self-hosting the video because of bandwidth.
tagged with: youtube-api
has answer: http://stackoverflow.com/a/29756070
type: Question
accepted answer: http://stackoverflow.com/a/29756070

http://stackoverflow.com/comment/47749981
score: 0
type: Comment
type: QuestionComment
has text: Unsure why this is `PHP` tagged. What is it you want to have done? Do you have more examples of what you're doing so far?
comment on: http://stackoverflow.com/q/29811008

http://stackoverflow.com/comment/47600622
type: QuestionComment
has text: Try commenting $('#removeItemModal' + Id).modal('hide'). Modal popup CSS is the culprit it seems.
comment on: http://stackoverflow.com/q/29732166
score: 0
type: Comment

http://stackoverflow.com/q/29713037
has answer: http://stackoverflow.com/a/29713121
tagged with: css
upvote count: 6
accepted answer: http://stackoverflow.com/a/29713373
has title: How to get a list of valid values for a CSS property with javascript?
has comment: http://stackoverflow.com/comment/47561479
has comment: http://stackoverflow.com/comment/47561903
downvote count: 1
has comment: http://stackoverflow.com/comment/47561345
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47561866
type: Question
has answer: http://stackoverflow.com/a/29713373
has comment: http://stackoverflow.com/comment/47561844
answer count: 2
score: 5
has comment: http://stackoverflow.com/comment/47562096
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47561339
possible better answer: http://stackoverflow.com/a/29713121
has body: Is there any way to get a list of valid values for a given CSS property with Javascript or check if the value you set is valid? Ex.: If I try to set document.getElementById('foo').style.cursor = "grab";. Nothing happens and the property remains unchanged(at least in chrome). I'd like to get a list of valid values for the current browser only. For example, on Firefox I'd get -moz-grab in the list and on IE I wouldn't get grab or any of it's variants. I want to be able to add vendor prefixes when needed and maybe have a way to provide a fallback.

http://stackoverflow.com/a/29791454
has comment: http://stackoverflow.com/comment/47718495
type: Answer
has comment: http://stackoverflow.com/comment/47719845
has comment: http://stackoverflow.com/comment/47718466
answers question: http://stackoverflow.com/q/29777058
downvote count: 0
has comment: http://stackoverflow.com/comment/47714294
score: 3
has comment: http://stackoverflow.com/comment/47720275
upvote count: 3
has body: It is not possible to further reduce the code with the current ECMAScript version. Perhaps with ES6 it might be possible, depending on what features will the language have. However if you're worried about code redundancy, you can add that method to a mixing and refer it in all components that you need to. Update: Thanks to @FakeRainBrigand for providing the ES6 syntax that allows the code reduction: setState({[name]: value});
has comment: http://stackoverflow.com/comment/47713537

http://stackoverflow.com/a/29835513
has body: You're passing app.Name instead of app.ProcessName in your String.Format example. Otherwise, I see no reason why that code shouldn't work.
has comment: http://stackoverflow.com/comment/48477670
answers question: http://stackoverflow.com/q/29835030
score: 0
type: Answer

http://stackoverflow.com/a/29830279
score: 3
type: Answer
has body: The value of param used by the inner function is indeed bound just once when that function is first created.
upvote count: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29829989
answers question: http://stackoverflow.com/q/29829989

http://stackoverflow.com/comment/63988918
type: Comment
has text: José's answer is very good, but I appreciate this one for explicitly outlining good rules-of-thumb for when/why to use one vs. two packages.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29738455

http://stackoverflow.com/comment/47551103
type: QuestionComment
score: 0
has text: Sorry, I forget to say what the problem is (I've edited my question).
type: Comment
comment on: http://stackoverflow.com/q/29707603

http://stackoverflow.com/q/29826242
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/29835015
has answer: http://stackoverflow.com/a/29828154
tagged with: leaflet
has title: How to prevent LeafletJS from issuing multiple click events on overlapping markers?
score: 1
has body: I have a LeafletJS map with a lot of markers on it, and many of them overlap at high zoom levels. Currently, when I click on a few overlapping markers, multiple click events are being issued, each of which then issues a popupopen event which in turn does a $.getJSON() to populate the popup. Obviously, this isn't ideal, so I'd like to find out how to get Leaflet to just execute one click at a time. Other answers I find on here talk about e.preventDefault() or e.stopPropagation(). Neither of those appear to be available in Leaflet's click or popupopen events, so I'm thinking there must be a smarter way that I've not heard of. Here's my code, watered down for the purpose of this question: var geojson_options = { onEachFeature: function(feature, layer){ layer.bindPopup('&lt;img src="/spinner.gif" /&gt;'); layer.on("popupopen", function(e){ // e.preventDefault and e.stopPropogating don't exist $.getJSON("some-url.json", function(json){ e.popup.setContent("Some processing of the json"); }); }); }, pointToLayer: function (feature, latlng) { // Irrelevant stuff } }; L.geoJson(geojson_data, geojson_options); I've tried variations on using layer.on("click", ...) to set a variable called popping_open to true to keep state while the popup is opening, but that didn't work either. Tell me there's a clean way to handle this?
type: Question
answer count: 2
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/92762711
type: Comment
comment on: http://stackoverflow.com/a/52733769
has text: @Steve Harrig please mark as answer if it work for you
type: AnswerComment
score: 1

http://stackoverflow.com/q/29823971
has body: I'm working on a Meteor project, and my navigation bar is supposed to have the collapsing functionality that Bootstrap provides. The following is my navigation code: &lt;!-- Navigation, via bootstrap --&gt; &lt;nav class="navbar navbar-default navbar-fixed-top"&gt; &lt;section class="container-fluid"&gt; &lt;section class="navbar-header"&gt; &lt;button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#collapse-1"&gt; &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;/button&gt; &lt;a class="navbar-brand" href="{{ pathFor 'home' }}"&gt;&lt;i class="fa fa-usd"&gt;&lt;/i&gt;&amp;nbsp;&amp;nbsp;AccountedFor&lt;/a&gt; &lt;/section&gt; &lt;!-- collapse? --&gt; &lt;section class="collapse navbar-collapse" id="collapse-1"&gt; &lt;ul class="nav navbar-nav"&gt; {{#if currentUser}} &lt;p class="navbar-text"&gt;|&lt;/p&gt; &lt;li&gt;&lt;a href="{{pathFor 'categories'}}"&gt;Manage Categories&lt;/a&gt;&lt;/li&gt; {{/if}} &lt;p class="navbar-text"&gt;|&lt;/p&gt; &lt;li&gt;&lt;a href="{{pathFor 'about'}}"&gt;About&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;section class="navbar-right"&gt; &lt;p class="navbar-text"&gt; {{&gt; loginButtons align="right"}} &lt;/p&gt; &lt;/section&gt; &lt;/section&gt; &lt;!-- end collapse --&gt; &lt;/section&gt; &lt;/nav&gt; This is what the current bar looks like, after I clicked the button that should be expanding the menu. This is what the bar looks like when it is of adequate width to not require collapse, with all entries visible: It has no problem showing the applicable toggle button when the size of the window is appropriate, but the collapsing functionality I'm expecting does not happen. Anyone care to offer some advice? Thanks ahead of time: http://jsfiddle.net/bfo38kb1/ &lt;-- This fiddle illustrates the problem I'm having.
has comment: http://stackoverflow.com/comment/47774770
has comment: http://stackoverflow.com/comment/47776476
has answer: http://stackoverflow.com/a/29825196
type: Question
has comment: http://stackoverflow.com/comment/47776325
answer count: 1
accepted answer: http://stackoverflow.com/a/29825196
tagged with: javascript
has comment: http://stackoverflow.com/comment/47774478
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Bootstrap collapse mobile navbar not working
tagged with: css
has comment: http://stackoverflow.com/comment/47776272
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/47774673
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47774711

http://stackoverflow.com/comment/47788038
has text: Well, I tried using YQL and I get this message: "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access."
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29828910

http://stackoverflow.com/comment/47671116
has text: @Cerlin Boss - we are using jquery.mobile-1.3.2.min.css & jquery.mobile-1.3.2.min.js.
comment on: http://stackoverflow.com/q/29768876
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29814401
has comment: http://stackoverflow.com/comment/47782400
has comment: http://stackoverflow.com/comment/47782081
has comment: http://stackoverflow.com/comment/47782752
answers question: http://stackoverflow.com/q/29813403
has comment: http://stackoverflow.com/comment/47781393
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29813403
downvote count: 0
has comment: http://stackoverflow.com/comment/47781240
has body: I think this type of thing should be inside your User controller, not inside the model. Your trying to modify a model that you are defining inside the model you are defining. Move it to the controller and call it at the end of your createUser function. EDIT: Try moving the function outside the attributes object, and add var User = this;, so that it can reference itself: var User = { // ... attributes: { avatar: {model: 'Image'}, // ... }, afterCreate: function(user, next){ var url = sails.config.s3 + "/" + sails.config.default_avatar; sails.log.info(user); // This displays the proper user var data = { url: url, isAvatar: true, user: user.id }; var User = this; // for internal reference Image.create(data) .exec( function (err, image) { sails.log.info(image); // This displays the proper image User.update(image.user, { avatar: image.id}) .exec( sails.log.info ); }); next(); } }
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/29848208
has body: The solution I have provided has been to to an AJAX request on beforeModel and set : beforeModel : function(){ var self = this; var touchpointId = window.location.href.split('hot-topics/'); return Ember.$.get('someUrl') .done(function(data){ self.controllerFor('hot-topics').set('defaultPeriod', data.hotTopicConfig[0].defaultPeriod); }); }, hotTopics : self.store.findQuery('hot-topic', { touchpointId : params.touchpointId, periodType : self.controllerFor('hot-topics').get('defaultPeriod') }).then(function(results){ return results.get('firstObject'); })
type: Answer
answers question: http://stackoverflow.com/q/29828941
score: 0

http://stackoverflow.com/comment/47765614
type: AnswerComment
type: Comment
has text: Using "Developer Tools" (F12) try to see after loading the page, if $('#formid:datepicker') return an object not empty.
score: 1
comment on: http://stackoverflow.com/a/29816891

http://stackoverflow.com/q/29834623
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/31197449
tagged with: spring
has body: Is there any way to automatically generate fields of type "time" in the database using JHipster? I'm looking for "time" in SQL (HH:mm:ss), not datetime or date or timestamp. JHipster has Datetime and LocalDate, but not simple "Time". Why?
downvote count: 0
score: 1
tagged with: java
type: Question
tagged with: javascript
answer count: 2
tagged with: jhipster
upvote count: 1
has title: Time in JHipster
favorite count: 0
has answer: http://stackoverflow.com/a/70434857

http://stackoverflow.com/q/29791771
linked to: http://stackoverflow.com/q/3725546
has answer: http://stackoverflow.com/a/29791855
downvote count: 0
tagged with: javascript
score: 1
tagged with: callback
type: Question
type: AnsweredQuestion
favorite count: 0
has title: Why does declaring a var inside a callback undefine the parameter? (Hoisting)
accepted answer: http://stackoverflow.com/a/29791855
tagged with: declaration
has body: $(function() { foo1("text"); foo2("text"); }) function callback(func) { func(); } function foo1(bar) { callback(function() { console.log(bar); // "text" bar = "derp"; console.log(bar); // "derp" }) } function foo2(bar) { callback(function() { console.log(bar); // undefined var bar = "derp"; console.log(bar); // "derp" }) } Why is that declaration of var bar = "derp" undefining the parameter, that is accessed beforehand?
tagged with: hoisting
upvote count: 1
answer count: 1
tagged with: parameters

http://stackoverflow.com/comment/47602745
comment on: http://stackoverflow.com/q/29693175
has text: @jaggs your answer is complete and correct one. Also you are the first who has posted it. I stay in comments, when there already are correct answers.
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/47789735
has text: Might help to [read more about regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions). You could just replace `/^g/` with `/^[ghi]/i`.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29808957
score: 0

http://stackoverflow.com/comment/47688027
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29778563
has text: @DanyalSandeelo it seems to be working for me. I tried out a few test cases and its good, but I do see your logic. Interesting
score: 0

http://stackoverflow.com/a/29705284
score: 2
answers question: http://stackoverflow.com/q/29705206
downvote count: 0
upvote count: 2
has body: const was new in IE11, it is not supported in IE10. Consider using the ALL_CAPS convention to show that the variable should not be changed. link var HANDLER = function (event) {
type: Answer

http://stackoverflow.com/comment/47887355
has text: You should validate @Swordfish answer, you simply forgot the upper case
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29689592

http://stackoverflow.com/comment/71158461
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29759699
has text: @Jamby Even with a hash function you still have to deal with collisions. You're just deferring the equality problem.
score: 1

http://stackoverflow.com/q/29783754
favorite count: 0
has title: jQuery slider not working
has comment: http://stackoverflow.com/comment/47697433
has comment: http://stackoverflow.com/comment/47699180
type: UnansweredQuestion
downvote count: 1
type: Question
tagged with: jquery-ui
score: 1
has comment: http://stackoverflow.com/comment/47697651
has answer: http://stackoverflow.com/a/29791864
upvote count: 2
has comment: http://stackoverflow.com/comment/47697869
has comment: http://stackoverflow.com/comment/47697683
has body: I'm trying to work around to get my slider to work but I don't know what the problem is. I've done it in other projects but with different versions of jQuery-UI $(function() { $("#slider-range-max").slider({ range: "max", min: 1, max: 5, value: 1, slide: function(event, ui) { $("#amount").val(ui.value); } }); $("#amount").val($("#slider-range-max").slider("value")); }); <?php echo "Welcome ".$name?> Minimum number of bedrooms:
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29839509
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47805500
has answer: http://stackoverflow.com/a/29839691
tagged with: node.js
score: 0
has title: How to I serve angular files with node http library?
has body: I am converting my app from Express to use Node's simple http library due to deployment complications with using Express. In Express to serve my client side angular files I have the following line: app.use(express.static(__dirname + '/client/app/')); How can I achieve the same thing using node's http module? Please, no comments/questions on why I am not using Express or suggestions on why I should use Express. The reason for not using Express is outside the scope of this post. I just really need to be able to serve my frontend using Node's http library. Thanks!
type: Question
has comment: http://stackoverflow.com/comment/47805445
tagged with: javascript
answer count: 1

http://stackoverflow.com/q/29772022
upvote count: 1
has answer: http://stackoverflow.com/a/29772115
type: AnsweredQuestion
has title: this.getDomNode() in reapp returns undefined
score: 1
has answer: http://stackoverflow.com/a/29772094
type: Question
tagged with: reactjs
downvote count: 0
tagged with: javascript
has body: I just got started with reapp. I simply created an app. Once the app was created, I modified the default home.jsx as shown: import { Reapp, React } from 'reapp-kit'; class Home extends React.Component { render() { return ( &lt;div className='map'&gt;&lt;/div&gt; ); } getDefaultProps() { return { initialZoom: 8, mapCenterLat: 43.6425569, mapCenterLng: -79.4073126, }; } componentDidMount() { console.log('Dom node is ',this.getDomNode()); } } export default Reapp(Home); Now the issue is the this.getDomNode which returns the error Uncaught TypeError: undefined is not a function Does anyone have any idea what might be wrong ??
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/51338437
accepted answer: http://stackoverflow.com/a/29772094
possible better answer: http://stackoverflow.com/a/29772115

http://stackoverflow.com/comment/47566492
comment on: http://stackoverflow.com/q/29715794
type: QuestionComment
type: Comment
has text: Cookies would be a better option I guess.
score: 0

http://stackoverflow.com/q/29773166
has comment: http://stackoverflow.com/comment/47678026
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47679723
has answer: http://stackoverflow.com/a/29773866
favorite count: 0
has comment: http://stackoverflow.com/comment/47679344
has comment: http://stackoverflow.com/comment/47679287
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47679480
has title: Second level menu item using ul li not working
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47677970
type: Question
score: 1
has comment: http://stackoverflow.com/comment/47678145
has comment: http://stackoverflow.com/comment/47677673
has comment: http://stackoverflow.com/comment/47679910
has body: I have a collapsible ul li. It works fine for the first level, but it is not expanding the ul elements inside the li (second level menu). This is the code: $(document).ready(function () { $("li").slideUp(); }); var hovering = 0; var element; $("ul,li").mouseenter(function(e) { setTimeout(function() { clearHover(); }, 1000); if (hovering == 0) { hovering = 1; $("#testdiv").css({ "background-color": "red" }); $(this).find("&gt; li").delay(500).slideDown("medium"); $(".nav").not(this).find("li").delay(500).slideUp(); } }); function clearHover() { hovering = 0; $("#testdiv").css({ "background-color": "green" }); }; You can check the fiddle here I tried to simplify the code using show, hide $(document).ready(function () { $("li").slideUp(); // setTimeout(function(){ $("ul li").slideDown(); },1000); }); $("ul").hover(function (e) { $(this).children().stop(true,true).show(); $(".nav").not(this).find("li").stop(true,true).hide(); }); $("li").hover(function (e) { if($(this).children().length&gt;0){ $(this).children().show(); $(this).children("ul").css({"z-index":"100"}); } //console.log($(this).children().length+ " " + Math.random); }); Please check this fiddle
has comment: http://stackoverflow.com/comment/47678220
has comment: http://stackoverflow.com/comment/47677398
answer count: 1
downvote count: 0

http://stackoverflow.com/a/29731140
downvote count: 0
answers question: http://stackoverflow.com/q/29731126
score: 5
has body: Your function only has one return statement in it. When the else path of the if statement is taken, nothing is returned. That said, you really don't need a return value because you just want the sequence of numbers printed (in descending order): function someFun(number) { if (number &gt;= 0) { alert(number); someFun(number - 1); } } someFun(4); If you want the numbers printed in ascending order, you'd just reverse the order of the alert() and the recursive call.
upvote count: 5
type: Answer

http://stackoverflow.com/a/29714413
answers question: http://stackoverflow.com/q/29713678
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/47565691
has body: Use $.when for aggregation and then chaining. function handleFirstFilter(){ if(firstFilterSelected){ var ps = []; $.each(elements, function(el){ ps.push(el.animate(...).promise()); // add all the promises }); return $.when.apply($, ps); // aggregate over them } return $.Deferred().resolve(); // return an empty promise resolved, nothing to do } // the other two filters are similar in pattern, can extract it to a function // now execute them all with each stage waiting for the previous. handleFirstFilter().then(handleSecondFilter).then(handleThirdFilter)
type: Answer
score: 2

http://stackoverflow.com/q/29755686
has comment: http://stackoverflow.com/comment/47644013
has comment: http://stackoverflow.com/comment/47645149
has comment: http://stackoverflow.com/comment/47643674
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: extjs5
accepted answer: http://stackoverflow.com/a/29756171
has comment: http://stackoverflow.com/comment/47644124
has comment: http://stackoverflow.com/comment/47644922
has comment: http://stackoverflow.com/comment/47643688
score: -6
favorite count: 0
has comment: http://stackoverflow.com/comment/47643570
has comment: http://stackoverflow.com/comment/47644499
has comment: http://stackoverflow.com/comment/47645301
has comment: http://stackoverflow.com/comment/47643544
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47643960
has comment: http://stackoverflow.com/comment/47643852
has comment: http://stackoverflow.com/comment/47645919
has comment: http://stackoverflow.com/comment/47643806
upvote count: 1
has comment: http://stackoverflow.com/comment/47643656
has body: I want to know how to check the web browser to see if a specific string of text exists. For example, I want to validate that the string "Hello World" is visible on the browser. Any tips would be great. Thanks.
has title: How to check if the web browser contains a specific string?
has answer: http://stackoverflow.com/a/29756171
has comment: http://stackoverflow.com/comment/47644411
downvote count: 7
type: Question
has comment: http://stackoverflow.com/comment/47644187
has comment: http://stackoverflow.com/comment/47645030
has comment: http://stackoverflow.com/comment/47643655
has comment: http://stackoverflow.com/comment/47643770
has comment: http://stackoverflow.com/comment/47645826
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29727219
has comment: http://stackoverflow.com/comment/47588781
has comment: http://stackoverflow.com/comment/47588980
has comment: http://stackoverflow.com/comment/47588933
has comment: http://stackoverflow.com/comment/47589115
score: 0
type: Answer
has body: Although there are ways to simplify your JS code, I will keep the general format and modify it slightly for an effect. Note that you can use a comma to select multiple div objects. You can make the code cleaner by adding an animation like rkamath suggested. His offers a slide effect. Here is a fade effect for your convenience as well: $(document).ready(function () { $('#cpass').click(function () { $('#form2,#form3,#form4').hide(); $('#form1').fadeIn(); }); $('#cinfo').click(function () { $('#form1,#form3,#form4').hide(); $('#form2').fadeIn(); }); $('#cmail').click(function () { $('#form4,#form2,#form1').hide(); $('#form3').fadeIn(); }); $('#cplace').click(function () { $('#form3,#form2,#form1').hide(); $('#form4').fadeIn(); }); }); Here is the fiddle for this. If you really want to keep the general structure of your code here you go: $('#cpass').click(function () { $('#form1').collapse('show'); if ($('#form2,#form3,#form4').is(':visible')) $('#form2,#form3,#form4').collapse('hide'); }); $('#cinfo').click(function () { $('#form2').collapse('show'); if ($('#form1,#form3,#form4').is(':visible')) $('#form1,#form3,#form4').collapse('hide'); }); $('#cmail').click(function () { $('#form3').collapse('show'); if ($('#form4,#form2,#form1').is(':visible')) $('#form4,#form2,#form1').collapse('hide'); }); $('#cplace').click(function () { $('#form4').collapse('show'); if ($('#form3,#form2,#form1').is(':visible')) $('#form3,#form2,#form1').collapse('hide'); }); Here is the fiddle.
has comment: http://stackoverflow.com/comment/47588887
has comment: http://stackoverflow.com/comment/47589041
has comment: http://stackoverflow.com/comment/47588982
has comment: http://stackoverflow.com/comment/47588967
has comment: http://stackoverflow.com/comment/47588821
answers question: http://stackoverflow.com/q/29726889

http://stackoverflow.com/comment/47532793
score: 0
type: Comment
type: AnswerComment
has text: You said that you want to emit data to all your pages. What exactly do you mean? Do you want to emit to all the pages of the single page app (for example /index /profile etc...), or do you want to emit to all users connected to your page?
comment on: http://stackoverflow.com/a/29697470

http://stackoverflow.com/q/29711937
has comment: http://stackoverflow.com/comment/47560154
has body: Basic "Load More on Scroll" AJAX function, console shows HTML being sent back from the request, but nothing is rendered. I must be overlooking something very simple. $(window).scroll(function() { if($(window).scrollTop() == $(document).height() - $(window).height()) { $('div#loadmoreajaxloader').show(); $.ajax({ url: "loader.php", success: function(html) { if(html) { $("#postswrapper").append(html); $('div#loadmoreajaxloader').hide(); }else { $('div#loadmoreajaxloader').html(' No more posts to show. '); } } }); } }); On scroll, the loader gets hidden as requested, but no HTML is brought back from loader.php. Loading loader.php by itself gives the correct HTML, though, so I'm certain the problem is with the AJAX. requested return HTML JDOUBLE - "THE DROP" 2014 CEDEK - "ACTION REMIX" 2015 EVENT FLYER 2015 LINZ PRAG - "HIGH UP" 2014 "BAZAAR" 2015 "ATLANTA FOREVER 4" CONCEPT ART 2014
has comment: http://stackoverflow.com/comment/47559905
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47559415
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47560148
score: 0
has title: Ajax doing everything but appending HTML
has comment: http://stackoverflow.com/comment/47559877
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47559762
has comment: http://stackoverflow.com/comment/47559382
has comment: http://stackoverflow.com/comment/47559787
has answer: http://stackoverflow.com/a/29712358
has comment: http://stackoverflow.com/comment/47560060
has comment: http://stackoverflow.com/comment/47559879
type: UnansweredQuestion
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47559836

http://stackoverflow.com/comment/47559529
type: Comment
has text: the link gets generated dynamically
type: AnswerComment
comment on: http://stackoverflow.com/a/29712026
score: 0

http://stackoverflow.com/q/29740640
has answer: http://stackoverflow.com/a/32324353
has answer: http://stackoverflow.com/a/29740789
type: AnsweredQuestion
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/35304537
has title: Hide custom navigation buttons if carousel has less items to show - Owl Carousel
type: Question
answer count: 8
accepted answer: http://stackoverflow.com/a/31716853
tagged with: javascript
has body: I am using owl carousel on one of the pages and I am using following script from theme unify http://htmlstream.com/preview/unify-v1.7/shortcode_carousels.html I want to hide the navigation buttons when the carousel has fewer items to show even in responsive mode something similar to what has been done in this example http://codepen.io/OwlFonk/pen/qhgjb?editors=101, in this codepen example button hide based on items visible in different screen sizes. I tried to implement the same to the carousel but it is not working for me fiddle http://codepen.io/anon/pen/gpYKvq //Owl Slider v1 var owl = jQuery(".owl-slider").owlCarousel({ itemsDesktop : [1000,5], itemsDesktopSmall : [900,4], itemsTablet: [600,3], itemsMobile : [479,2], }); jQuery(".next-v1").click(function(){ owl.trigger('owl.next'); }) jQuery(".prev-v1").click(function(){ owl.trigger('owl.prev'); })
possible better answer: http://stackoverflow.com/a/39385261
has answer: http://stackoverflow.com/a/39385261
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/40640535
favorite count: 0
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/31716853
has answer: http://stackoverflow.com/a/34543451
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47614977
has answer: http://stackoverflow.com/a/37068353
tagged with: css

http://stackoverflow.com/comment/47704495
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29787515
has text: `when i reach the last slide and click the "Next Button" the slides won't go back to its first image.` then where it will go ??
score: 0

http://stackoverflow.com/comment/47774068
score: 0
comment on: http://stackoverflow.com/a/29792774
type: Comment
has text: @BenForg Are you naming everything correctly? you need to be visiting `/modals/layout` and the route for that should be called ModelsLayoutRoute
type: AnswerComment

http://stackoverflow.com/q/29797161
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47722497
has answer: http://stackoverflow.com/a/29797274
has title: add li elements to ul list with .after() method issue
accepted answer: http://stackoverflow.com/a/29797274
upvote count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29797279
has comment: http://stackoverflow.com/comment/47722449
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47722571
tagged with: cookies
score: 1
possible better answer: http://stackoverflow.com/a/29797279
has body: I'm trying to add li element to ul list. But after i open page source, i can't see that my DOM was updated. Here is the code bellow. I can't delete element also.... When i click on delete button nothing happens. var msg = $('#danger').hide(); var inputText = $('#todo'); //var list = $('#list'); var globalObj; //general function that will call other functions function addListElement(event) { event.preventDefault(); var input = inputText.val(); if( input == '') { msg.show(); } else { msg.hide(); addCookie(input); readCookie(); } } //function for adding value to cookie function addCookie(inputValue) { globalObj = {text: ''+ inputValue+''}; $.cookie('vesko', '' + globalObj.text + ''); } // function for reading cookie function readCookie() { var listCookie = $.cookie('vesko'); $('#list').after(' ' + listCookie + ' Delete '); } $(function (){ $('#add').on('click', addListElement); $('.delete').on('click', function(){ $('.delete').parent().remove(); }); }); Todo app Please type something in the field! Add ToDo Task
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/203198

http://stackoverflow.com/comment/47726304
has text: Ok so I've put `$('#CartDrawer').css('z-index', '999');` in and after a couple of clicks its showing the contents of the cart. How would it know to switch between the two?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29795248

http://stackoverflow.com/a/29765828
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/29765724
accepted answer of: http://stackoverflow.com/q/29765724
has body: The element inside the tag is a text node. You can't address it in CSS. If you want to style it, you either have to style the tag or surround the text you want to style with a element. So to, e.g., style only the Hello: Hello StackOverFlow And in your CSS span { font-weight: bold; } Or whatever style you want to give it. See also the answer to this related question.
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/29766114
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/34351460
score: 1
favorite count: 0
answer count: 2
upvote count: 1
tagged with: orientdb
has answer: http://stackoverflow.com/a/29768645
has comment: http://stackoverflow.com/comment/47663510
tagged with: java
accepted answer: http://stackoverflow.com/a/29768645
downvote count: 0
tagged with: javascript
has title: OrientDB - OrientDB function not executing using Java
type: Question
has body: I have a database with the following Javascript function. But when I try to execute the same function using Java, it doesn't work. And I'm trying to connect using this Java code: ODatabaseDocumentTx db = new ODatabaseDocumentTx("remote:localhost/localDBDocumentAPI").open("admin", "admin"); OFunction func = db.getMetadata().getFunctionLibrary().getFunction("CreateLinks"); func.execute(); When I ran the Java code, it ran without any error though. But no results.
has comment: http://stackoverflow.com/comment/47663626
possible better answer: http://stackoverflow.com/a/34351460

http://stackoverflow.com/a/29784644
score: 1
accepted answer of: http://stackoverflow.com/q/29784515
answers question: http://stackoverflow.com/q/29784515
has body: You need to wrap the code in a document ready statement like this. $(function() { $('a.select-all-current').click(function(e){ e.preventDefault(); alert(e); $('input:not(:checked)').each(function(index, element){ $(element).click(); }); return false; }); });
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0

http://stackoverflow.com/a/29805723
upvote count: 1
answers question: http://stackoverflow.com/q/29805476
has body: It happen because the this in the timeout refer to the window object. It can be easy fixed by keeping a reference outside the function like that : // Avoid Plugin.prototype conflicts $.extend(Plugin.prototype, { init: function () { console.log(this.settings.propertyName); var self = this; setTimeout(function(){ console.log(self.settings.propertyName); //Use your reference here. }, 1000); } }); If for some reason you prefer not having a variable with the reference, you can always use Function.prototype.bind. Be sure to check the compatibility before using it. What .bind does is simply returning a new function while altering the this value and the arguments. You can use it like that : // Avoid Plugin.prototype conflicts $.extend(Plugin.prototype, { init: function () { console.log(this.settings.propertyName); setTimeout(function(){ console.log(this.settings.propertyName); }.bind(this), 1000); } });
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/29772403
has title: Can't enumerate getters/setters properties
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/58681817
favorite count: 0
has answer: http://stackoverflow.com/a/36573531
type: Question
score: 4
tagged with: reflection
answer count: 2
has comment: http://stackoverflow.com/comment/56340530
has body: I am working on some reflections code to try to scrape out properties and functions, but I can't seem to get the getters/setters at all. The reflection code I have for properties is: Reflector = function() { }; Reflector.getProperties = function(obj) { var properties = []; var proto = obj; while (proto != Object.prototype) { console.log('Scrapping proto: ', proto); for (var prop in proto) { console.log('typeof ' + prop + ": ", typeof obj[prop]); if (typeof obj[prop] != 'function') { properties.push(prop); } } proto = Object.getPrototypeOf(proto); } return properties; }; And a sample of it running (with my debug messages) is: var SimpleTestObject = function() { this.value = "Test1"; this._hiddenVal = "Test2"; this._readOnlyVal = "Test3"; this._rwVal = "Test4"; }; SimpleTestObject.prototype = { get readOnlyVal() { return this._readOnlyVal; }, get rwVal() { return this._rwVal; }, set rwVal(value) { this._rwVal = value; }, func1: function() { // Test } }; SimpleTestObject.func2 = function(test) { /* Test */ }; SimpleTestObject.outsideVal = "Test5"; var props = Reflector.getProperties(SimpleTestObject); console.log('props: ', props); console.log('Object.getOwnPropertyNames: ', Object.getOwnPropertyNames(SimpleTestObject)); console.log('rwVal property descriptor: ', Object.getOwnPropertyDescriptor(SimpleTestObject, 'rwVal')); console.log('rwVal (2) property descriptor: ', Object.getOwnPropertyDescriptor(Object.getPrototypeOf(SimpleTestObject), 'rwVal')); What I expect to see as output to my Reflection.getProperties(SimpleTestObject) is ['readOnlyVal', 'rwVal', 'outsideVal'], but instead I am only seeing outsideVal. Further, when I tried to using getOwnPropertyDescriptor() to see if the rwVal was enumerable, it came back as undefined. So, thinking maybe it somehow got showed into the prototype above, I tried going up a level and still got undefined.
type: UnansweredQuestion
upvote count: 4

http://stackoverflow.com/comment/47558371
has text: @DominikAngerer lol I updated to an actual response haha
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29711234
score: 0

http://stackoverflow.com/comment/47584378
score: 0
type: Comment
type: QuestionComment
has text: but it's not, what I get is the actual ActionView object. returning as View("viewname") and partialview also does the same thing.
comment on: http://stackoverflow.com/q/29724931

http://stackoverflow.com/q/29834803
has comment: http://stackoverflow.com/comment/47796386
possible better answer: http://stackoverflow.com/a/29834868
has comment: http://stackoverflow.com/comment/47796414
has comment: http://stackoverflow.com/comment/47796869
type: Question
has comment: http://stackoverflow.com/comment/47796721
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47796685
has comment: http://stackoverflow.com/comment/47796435
has title: angular ng-show "object is not a function" but still adds ng-hide class
tagged with: javascript
has comment: http://stackoverflow.com/comment/47796396
has comment: http://stackoverflow.com/comment/47796776
has comment: http://stackoverflow.com/comment/47796548
score: 0
has answer: http://stackoverflow.com/a/29835883
answer count: 2
has comment: http://stackoverflow.com/comment/47796763
has body: Here is the html: Submit I know that there is a value finalize on the scope. I have checked with ng-inspect. It seems to be evaluating correctly because when I look at the generated source I see class="ng-hide". The problem is that on the console I see: 'TypeError: object is not a function'. I just don't get it. When I delete the ng-show clause, the error goes away... controller code: angular.element(document).ready( fucntion () { $scope.finalize = $("#Finalize")[0].value; } ) ..coming from the server Here is a fiddle, it is not working either: Jsfiddle
has comment: http://stackoverflow.com/comment/47796675
accepted answer: http://stackoverflow.com/a/29835883
has answer: http://stackoverflow.com/a/29834868
tagged with: angularjs

http://stackoverflow.com/q/29697402
score: 3
has body: I am trying to scroll a page completely using this code: JavascriptExecutor js = (JavascriptExecutor) Browser; js.executeScript("javascript:window.onload=toBottom();"+ "function toBottom(){" +"window.scrollTo(0,Math.max(document.documentElement.scrollHeight," +"document.body.scrollHeight,document.documentElement.clientHeight));" +"}"); js.executeScript("window.status = 'fail';"); //Attach the Ajax call back method js.executeScript( "$(document).ajaxComplete(function() {" + "status = 'success';});"); js.executeScript("window.status = 'fail';"); //Attach the Ajax call back method js.executeScript( "$(document).ajaxComplete(function() {" +"status = 'success';});"); This code works fine and scroll the page for the first attempt but when page is scrolled down, new data appears at the page and this code failed to scroll it again. So what I need is that someone will help me to scroll the page till end until scrolling is completed. Do I use any loop for this? Help/Suggestions/Response will be appreciated!
tagged with: java
tagged with: selenium
has comment: http://stackoverflow.com/comment/47532097
downvote count: 1
tagged with: webdriver
type: Question
has answer: http://stackoverflow.com/a/76975366
has answer: http://stackoverflow.com/a/54014777
tagged with: javascript
upvote count: 4
has title: Scrolling an ajax page completely using selenium webdriver
has comment: http://stackoverflow.com/comment/47532498
has comment: http://stackoverflow.com/comment/47532276
tagged with: windows
has comment: http://stackoverflow.com/comment/47532967
favorite count: 0
has comment: http://stackoverflow.com/comment/47532945
has answer: http://stackoverflow.com/a/29698535
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/28662524
has comment: http://stackoverflow.com/comment/47532257
answer count: 4
has answer: http://stackoverflow.com/a/29710830

http://stackoverflow.com/a/29908578
score: 0
has body: &lt;!-- @@Formula: if (issue.get("issuetype") == "Specials") { if (issue.get("resolutiondate") == null || issue.get("customfield_10007")==null) return null; else if ((issue.get("resolutiondate").getTime() - issue.get("customfield_10007").getTime()) / (1000*60*60*24) &lt;1) return 0; else return (issue.get("resolutiondate").getTime() - issue.get("customfield_10007").getTime()) / (1000*60*60*24); } else { if (issue.get("resolutiondate") == null || issue.get("customfield_10002")==null) return null; else if ((issue.get("resolutiondate").getTime() - issue.get("customfield_10002").getTime()) / (1000*60*60*24) &lt;1) return 0; else return (issue.get("resolutiondate").getTime() - issue.get("customfield_10002").getTime()) / (1000*60*60*24); } --&gt;
answers question: http://stackoverflow.com/q/29839392
type: Answer

http://stackoverflow.com/comment/47719443
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29794441
has text: no it shouldn't be if sending properly

http://stackoverflow.com/a/29730822
has comment: http://stackoverflow.com/comment/47617314
has body: For jQuery selectors you can combine multiple selectors with comma ( like css-seletors ): $(document).ready(function () { $('select').change(function () { $('select.fix1 option, select.fix2 option, select.fix3 option').attr('disabled', false); $('select.fix1,select.fix2,select.fix3').each(function(key, el) { var val = $(this).find('option:selected').val(); if (!val) return; $(el).find('option').filter(function() { return $(this).val() == val; }).attr('disabled', 'disabled'); }); }); }); But it's better to have some commot class to right selector only once like $(document).ready(function () { $('select').change(function () { $('select.commonClass option').attr('disabled', false); $('select.commonClass').each(function(key, el) { var val = $(this).find('option:selected').val(); if (!val) return; $(el).find('option').filter(function() { return $(this).val() == val; }).attr('disabled', 'disabled'); }); }); });
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29730758
has comment: http://stackoverflow.com/comment/47598237
answers question: http://stackoverflow.com/q/29730758

knockout-components
type: Tag
tags question: http://stackoverflow.com/q/29694908
tag name: knockout-components

http://stackoverflow.com/comment/47611768
type: AnswerComment
has text: This link may be help you .http://stackoverflow.com/questions/18467418/retain-html-table-styling-after-exporting-to-excel-using-javascript-jquery
comment on: http://stackoverflow.com/a/29717451
score: 0
type: Comment

http://stackoverflow.com/a/29769406
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47669432
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29769344
has body: Use .prop() property and add value checked instead of trigger click If you are using jQuery 1.6+ jQuery('#op5').click(function () { $('input[type=checkbox]').prop('checked', true); }); Docs: https://api.jquery.com/prop/
upvote count: 2
answers question: http://stackoverflow.com/q/29769344

http://stackoverflow.com/q/29760851
has body: So I'm making a website. I need to submit a form to a server to be processed. This is required to process login information. This server-side script needs to access a plain-text file which is stored on my Google Drive in order to confirm that the user input is valid. The only way that I know how to access a file on Google Drive is through Google Apps Script. Is there a way to handle forms on the server-side that are submitted from another website with HTML or JavaScript in Google Apps Script? or Is there a way to use PHP with Google Apps Script? or Is there another more efficient way that I can access and write to files on my Google Drive directly from my website?
tagged with: server-side-scripting
accepted answer: http://stackoverflow.com/a/29761121
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29761121
tagged with: php
type: AnsweredQuestion
has title: Accessing Google Drive Files On The Server Side Of A Website
type: Question
tagged with: google-apps-script

http://stackoverflow.com/comment/47604632
score: 1
type: QuestionComment
has text: It looks as though you're trying to change the content of the html using php *before* the document is even sent to the browser. Is this correct? Or are you indeed trying to change the document *after* it is sent to the browser?
type: Comment
comment on: http://stackoverflow.com/q/29735690

http://stackoverflow.com/comment/47755729
type: AnswerComment
score: 0
type: Comment
has text: Thanks. But Hour still not plus 7
comment on: http://stackoverflow.com/a/29813923

http://stackoverflow.com/q/29814839
has answer: http://stackoverflow.com/a/29814990
has comment: http://stackoverflow.com/comment/47757111
has body: I am making a note web app using localStorage, when user submits a note, the values from the input and textarea are saved in a object. Each note created is a object containing key/value pairs id: 0 title: value from input content: value from textarea After localStorage contains least one item with a string from then on in when a new note is created, I get/retrieve the localStorage string which will contain past entered notes in string format. Parse the localStorage string and save it into a variable/array to have the prior notes to add on to. Push new input values saved into input object each time, to the array before setting the localStorage item with the array(stringifying it of course). Below is the function that's responsible for saving the note into localStorage // User clicks to save note post_note_button.onclick = function() { // Get values from input and textarea var note_title = document.getElementById("note-title").value; var note_textarea = document.getElementById("note-textarea").value; // Each time note is created, new values from input will be saved var input = { id: note_id_count, title: note_title, content: note_textarea }; // ------------------------------------------------ switch(localStorage.getItem("note")) { // If retrieve for localStorage item returns false/doesn't exist // PURPOSE: Set localStorage string for first time // 1. Create localStorage item with values from user's input case null: localStorage.setItem("note", JSON.stringify(input)); break; // If retrieve for localStorage item returns true/exists // PURPOSE: To retrieve localStorage string and manipulate it // 1. Changing localStorage string, requires string to be retrieved and saved as array // 2. Add item to array // 3. Create/set localStorage item with values from array, convert to string default: var note_array = [JSON.parse(localStorage.getItem("note"))]; console.log(note_array); note_array.push(input); localStorage.setItem("note", JSON.stringify(note_array)); break; } // -------…
score: 0
tagged with: local-storage
answer count: 1
accepted answer: http://stackoverflow.com/a/29814990
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47757300
has comment: http://stackoverflow.com/comment/47757563
type: AnsweredQuestion
has title: Parsing retrieved localStorage item brings undesired result in console
tagged with: javascript
type: Question

http://stackoverflow.com/comment/47581438
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29722734
has text: yes my Mac is acting as the server and my Windows machine is acting as the client. a remote debugging session sounds like a great big pain - shouldn't i be able to get log messages to IE9's console? the other full blown swf application logs to the console via the code i posted so i was hoping i could reuse that.
score: 0

http://stackoverflow.com/comment/47721195
score: 0
type: Comment
type: AnswerComment
has text: @GibboK in that case you can take the `maxHeight` from that childs. Also you can check the childs position and you can decide if to `add` or not to the current height.
comment on: http://stackoverflow.com/a/29796480

http://stackoverflow.com/comment/47613570
score: 0
type: Comment
type: QuestionComment
has text: I am not sure this is the exact solution you are looking for but read this https://support.google.com/chrome/answer/2710225?hl=en and https://developers.google.com/chart/interactive/faq#notshowing i think you have to install a flash plugin manually and try.
comment on: http://stackoverflow.com/q/29740028

inheritance
tags question: http://stackoverflow.com/q/29840674
tags question: http://stackoverflow.com/q/29813074
tags question: http://stackoverflow.com/q/29799320
tag name: inheritance
tags question: http://stackoverflow.com/q/29714998
type: Tag
tags question: http://stackoverflow.com/q/29782259
tags question: http://stackoverflow.com/q/29831208

http://stackoverflow.com/comment/47710918
score: 0
has text: Please, if you have answered your own question, post an answer as opposed to editing the *question*. (Also, it may help if you update the question a bit with more details on how to repro things.)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29785623

http://stackoverflow.com/a/29716951
type: Answer
answers question: http://stackoverflow.com/q/29716754
has body: If you want to use just javascript you can do something like that: HTML 1 2 3 4 Javascript var nums = document.getElementById("ul"); // get the ul element var listItem = nums.getElementsByClassName("strange"); //fetch all elements inside the ul that have a class of strange var element; // loop through the list elements for (var i=0; i < listItem.length; i++) { // check whether list's inner html is equal to 3 if (parseInt( listItem[i].innerHTML) == 3) { // set the value of element equal to the list element element = listItem[i]; break; } } console.log(element); // logs out the element that has the required value, you can use element.innerHTML to check
score: 0

http://stackoverflow.com/a/29818652
has body: try var t = JSON.parse(json); var max_use = t[0]["max_use"]; var used = t[0]["used"]; var amount = t[0]["amount"];
score: 4
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/47764205
answers question: http://stackoverflow.com/q/29818541
has comment: http://stackoverflow.com/comment/47764503
downvote count: 0

jetty-9
tag name: jetty-9
type: Tag
tags question: http://stackoverflow.com/q/29844804

http://stackoverflow.com/comment/47797183
comment on: http://stackoverflow.com/q/29831568
has text: what does the code to add routes with ajax look like? Perhaps using a wildcard route would be better?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47676780
comment on: http://stackoverflow.com/q/29773092
score: 0
type: Comment
type: QuestionComment
has text: can you set up a fiddle?

http://stackoverflow.com/comment/47652650
type: AnswerComment
type: Comment
has text: Just add it to your JS file and your Style file. modify to your liking. I know the code i gave has text overlay as well (and a fade effect when hover over one of the elements on the other elements) but just remove those details from the HTML/JS/CSS. You can call it Via your function or your code, you call what ever style class or id you want it to affect. The JS is just to have a smooth transition between the images you are using, in this case fading.
comment on: http://stackoverflow.com/a/29759847
score: 0

http://stackoverflow.com/comment/48098260
score: 0
comment on: http://stackoverflow.com/a/29802862
type: AnswerComment
type: Comment
has text: @JamieBarker I've tried your solution and it doesn't work. i.e.: Loaded the page on my browser while online, then disconnected my wifi and load the page again, still says, `online`

http://stackoverflow.com/comment/47629070
type: AnswerComment
score: 0
has text: It may be worth asking this as a feature request. I did a brief overview of the bugtracker, there's a [very old request](https://code.google.com/p/chromium/issues/detail?id=75015) regarding this in extensions. I say it's worth to take another look, even if they only implement it for Chrome Apps (which is likely).
type: Comment
comment on: http://stackoverflow.com/a/29744907

http://stackoverflow.com/q/29755534
has title: Copying the neo4j browser visualisations with d3.js
type: Question
answer count: 1
tagged with: javascript
upvote count: 7
has answer: http://stackoverflow.com/a/29755988
accepted answer: http://stackoverflow.com/a/29755988
tagged with: neo4j
favorite count: 0
tagged with: grass
downvote count: 0
tagged with: css
has body: I'm looking to create some visualisations for my neo4j data, and there are some really nice settings in use in the browser that's bundled with it, but there seem less than straightforward to emulate when using d3 - my setup was based on the neo4j visualisation guide at http://neo4j.com/developer/guide-data-visualization/ but this guide doesn't really get you anywhere near what the browser achieves. For example, I'm looking to emulate: multiple curved path between nodes paths which end at the edge of the node, and not the center graph initialised in a static position (though could probably just hide until d3 presumably fires some event) I've not seen any official CSS/JS release to get the same effects, so I guess it's assumed the user will code from scratch. Are there any other options for quickly achieving this? Many thanks
type: AnsweredQuestion
score: 7

http://stackoverflow.com/q/29799230
has title: Json Filtering in jquery
favorite count: 0
type: UnansweredQuestion
answer count: 4
has body: Hello i want to filter json data like sql query without the help of plugins like alasql.js or linq.js or any plugins. for example { "Managing PCL": [ { "idItScreen": "1436", "topicName": "Managing PCL", "isFav": 0, "cdeItScreen": "ListActiveTarif", "busScreenName": "My Current Tarif" }, { "idItScreen": "1437", "topicName": "Managing PCL", "isFav": 0, "cdeItScreen": "ListTermineTarif", "busScreenName": "History Tarif" } ] } for example i need to get data where idItScreen>1430 so that json data must be displayed the main challenge is to do without plugins so please reccomend me a good solution to do this without plugins
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47726881
type: Question
has answer: http://stackoverflow.com/a/29799399
tagged with: javascript
has answer: http://stackoverflow.com/a/29799495
tagged with: sql
upvote count: 1
has answer: http://stackoverflow.com/a/29799690
has answer: http://stackoverflow.com/a/29799525
tagged with: jquery

http://stackoverflow.com/comment/47665482
has text: Check if `error` is set...
type: Comment
score: 2
comment on: http://stackoverflow.com/q/29767221
type: QuestionComment

http://stackoverflow.com/comment/47770561
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29817661
has text: @GeraldSchneider: if in HTML, which is generated from PHP, will be `alert("whatever \n content...")`, in alert will be two lines. Doens't matter if text in alert comes from PHP or not.
type: AnswerComment

horizontal-scrolling
tags question: http://stackoverflow.com/q/29708176
tag name: horizontal-scrolling
tags question: http://stackoverflow.com/q/29813330
type: Tag

http://stackoverflow.com/q/29815967
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29818988
favorite count: 0
has title: Datatable : Adding callback function on filter and get filtered data array
type: Question
tagged with: datatables
tagged with: datatable
upvote count: 2
answer count: 1
has body: I'm using Datatable 1.10.4. I'm sending the data array to the table to populate the table, Initialization is as follows: table = $('#dashboard-user-list-table').dataTable({ "data":window.MyApp.Model.userModel.getUsers(), //sourced JS Array "iDisplayLength": 4, --- --- }); I want to add a onfilter callback function and get the filtered data array and do some stuff. Even without callback function , is there any way to get a Filtered data array?. (Basically i need to get the array which i passed as a sourced data which is visible on page) Does the Datatables plugin allow me to do this? If so, I haven't found anything in the documentation that is intuitive. Can you please suggest me how to do it? refer JSFIDDLE
type: UnansweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/47764707

http://stackoverflow.com/q/29713562
has body: I would like to put a Slider inside an image (specifically an iMac), like they have on unbounce homepage. I think I need a div and then jQuery, but I have no idea where to start. The thing is the image inside the Mac changes, but not the iMac image itself. If that helps, I am using WordPress, so I could use any plugin too. Do you have any idea on how to do that? Thank you, https://i.sstatic.net/HVe98.png
answer count: 2
score: -11
downvote count: 12
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29726973
tagged with: slider
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/48951655
has title: Slider inside image
tagged with: wordpress
linked to: http://stackoverflow.com/q/6944382
type: Question

http://stackoverflow.com/comment/47559639
has text: Is there a way to do it with literal notation?
type: AnswerComment
comment on: http://stackoverflow.com/a/29712052
score: 0
type: Comment

http://stackoverflow.com/comment/47776077
type: Comment
type: QuestionComment
has text: In as concise a manner? Don't think so. You could write `foo = (category) -> if not (selectedCategory or category) or (selectedCategory is category) then "my-custom-class" else ""` to succeed when both are false-y, and otherwise compare them with strict equality.
comment on: http://stackoverflow.com/q/29824190
score: 0

http://stackoverflow.com/comment/47618506
type: Comment
type: QuestionComment
has text: You don't really need javascript for this. After the `@foreach` line add `var className = item.PJNO == "100" ? "selected" : null;` and then ` ` then add a css definition for `.selected { background-color: yellow; }`
score: 0
comment on: http://stackoverflow.com/q/29741623

http://stackoverflow.com/a/29816709
has body: You're using id's. You can't use an id on multiple divs, so you need to use class.
downvote count: 1
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/47760460
answers question: http://stackoverflow.com/q/29816414
score: -1
has comment: http://stackoverflow.com/comment/47760495

http://stackoverflow.com/q/29744893
has comment: http://stackoverflow.com/comment/47622424
has title: dynamically generated td tag not showing up in page
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47623071
type: Question
has comment: http://stackoverflow.com/comment/47622347
linked to: http://stackoverflow.com/q/8749236
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29745104
has comment: http://stackoverflow.com/comment/47622540
has answer: http://stackoverflow.com/a/29745104
has comment: http://stackoverflow.com/comment/47622374
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/29745537
tagged with: http://stackoverflow.com/tag/html
tagged with: web
has answer: http://stackoverflow.com/a/29744990
has comment: http://stackoverflow.com/comment/47622332
has comment: http://stackoverflow.com/comment/47622517
has comment: http://stackoverflow.com/comment/47622411
has answer: http://stackoverflow.com/a/29745537
has comment: http://stackoverflow.com/comment/47622610
has body: I have this HTML structure in one of my pages: Travelers Total I am trying to populate the #traveller-count with dynamic data, using javascript. However, the (javascript) generated tags fail to show up in the rendered page. As a result, the data shows up outside of the table, rather than inside the table. Any ideas on how I can resolve this issue will be really appreciated. Below is my javascript code: var passengers = { '1':{'age':'ad'}, '2':{'age':'ad'}, '3':{'age':'ch'}, '4':{'age':'in'} } var ts = ''; var adultCount = childCount = infantCount = 0; for(var x in passengers) { currPassenger = passengers[x]; ts += ' '; ts += ''; switch(currPassenger.age.toUpperCase()) { case 'AD' : ts += 'Adult-' + ++adultCount; break; case 'CH' : ts += 'Child-' + ++childCount; break; case 'IN' : ts += 'Infant-' + ++infantCount; break; } ts += ''; ts += ' '; } document.getElementById("traveller-count").innerHTML = ts;

http://stackoverflow.com/comment/48163302
has text: @Cyberpunk that might have probably been a old post... i have tested the sample test of the socketIO in jsb and it works.. Anyways good luck with the c++ :D
comment on: http://stackoverflow.com/a/29998584
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/a/43247385
type: Answer
answers question: http://stackoverflow.com/q/29829205
downvote count: 1
has body: Do it like: var arr = [a, b, null, d, null] foreach ($arr as $key =&gt; $value) { if($value == null) unset($arr[$key]); $arr[] = $value; } // rebuild array index $arr = array_values($arr); echo '&lt;pre&gt;';print_r($arr);die;
score: -1
upvote count: 0

http://stackoverflow.com/a/29697631
score: 0
has comment: http://stackoverflow.com/comment/47531306
has comment: http://stackoverflow.com/comment/47536042
has comment: http://stackoverflow.com/comment/47536796
has comment: http://stackoverflow.com/comment/47620751
has body: The reason for the error is you are still trying to quit the Original driver, not the forked one. Rather than forking, could you not do something like browser = new Browser(); hopefully with this your 'new' browser should quit. Another option as a solution would be using the WebDriver's driver.switchTo().frame() method You can select using a; A number. (0 based index) A name or ID. A previously found WebElement. (maybe the easiest for you) Once you have switched, you Should be able to quit.
has comment: http://stackoverflow.com/comment/47536440
answers question: http://stackoverflow.com/q/29696189
type: Answer

http://stackoverflow.com/q/29764989
accepted answer: http://stackoverflow.com/a/29765402
tagged with: css
type: AnsweredQuestion
has body: i have a it shows the tootltip while mouse over, now i would like to change the background color of the tooltip. is there any way of using CSS or JQuery or using class attribute &lt;td title="#487105 CLASSIC LOOSE RD124473 ENGINEERED 2X1-" class="tooltip" rowspan="10" style="white-space:nowrap;"&gt;
has answer: http://stackoverflow.com/a/29765402
score: 1
has answer: http://stackoverflow.com/a/29765322
type: Question
has comment: http://stackoverflow.com/comment/47661357
tagged with: jquery-ui
tagged with: javascript
upvote count: 2
tagged with: jquery-plugins
has title: How to change the tool tip background color, tooltip displays in td
answer count: 3
possible better answer: http://stackoverflow.com/a/29765288
downvote count: 1
has answer: http://stackoverflow.com/a/29765288
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/29814817
upvote count: 4
tagged with: browserify
has answer: http://stackoverflow.com/a/31290033
has body: I am in process of outlining a architecture of a fairly complex application based on angular. So I started with the angular-seed project and it seems to be a good starting point. What bothers me is that angular apps by nature involves loading everything upfront. With script loaders, there doesn't seems to be a clean way around. I came from a backbone.js background and there it was quiet straight to use the require.js for lazy loading based on the router callbacks. In angular routes are somewhat defined like the below: // Declare app level module which depends on views, and components angular.module('myApp', [ 'ngRoute' ]). config(['$routeProvider', function($routeProvider) { $routeProvider.when({templateURL:'../tmpl.html',controller:'view1Ctrl'}) .when({templateURL:'../tmpl.html',controller:'view1Ctrl'}) .otherwise({redirectTo: '/view1'}); }]); now here, $routeProvider.when({templateURL:'../tmpl.html',controller:'view1Ctrl'}) I would like to lazily load the controller and the template. I was tempted to use something like: $routeProvider.when({templateURL:'../tmpl.html',controller:require('view1Ctrl'}) using browserify but then it doesn't seems to be clean and not even with require. I know this question has been asked several times on SO some way or the other but i haven't found a emphatic answer to this. My preference here is to use the browserify as it supports the much loved cjs modules in browser.
downvote count: 0
favorite count: 0
tagged with: angularjs
type: Question
score: 4
has comment: http://stackoverflow.com/comment/49525249
has title: lazy loading of components in angular with browserify
answer count: 1
has comment: http://stackoverflow.com/comment/49525167
linked to: http://stackoverflow.com/q/21742495
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/a/29752912
answers question: http://stackoverflow.com/q/29752679
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29752679
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47639381
has comment: http://stackoverflow.com/comment/47638027
type: Answer
has body: The answer lies in looping over the keys and elements of each object. When a match is found, add it. http://jsfiddle.net/2x6Lws96/1/ var a = {"10167":"Hello", "10122":"World", "10245":"Hello2", "10035":"People"}; var b = {"A": "one", "B": "10122", "C": "Three"}; var akeys = Object.keys(a); for(bkey in b) { if(a[b[bkey]]) { b[bkey+'_Description'] = a[b[bkey]]; } } EDIT This will only work in IE9 and above (and pretty much any other browser) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys In JS you dont 'insert' values into objects. Just assign them myObject.newField = 'newValue' EDIT 2 Updated as per Felix's suggestions
has comment: http://stackoverflow.com/comment/47638173
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47639019

http://stackoverflow.com/a/29690831
score: 1
has body: You can add a callback for the animation. Without removing and adding class you can't repeat an animation. $(document).ready(function () { $('#test li').on('click', function () { var className = $(this).attr('class'); $('#test2 > li').each(function () { var prodName = $(this).data('prod'); if (prodName == className) { $('#test2 > li').removeClass('bounceInRight').addClass('bounceOutRight'); $this = $(this); $this.find('div').removeClass('fadeInDown'); setTimeout(function () { console.log(this); $('#test2 > li').addClass('hide') $this.removeClass('hide bounceOutRight').addClass('bounceInRight'); }, 400); } }); }) $('#test2 li').on('oanimationend animationend webkitAnimationEnd', function() { $(this).find('div').each(function(i){ var $this = $(this); setTimeout(function(){ $this.addClass('animated fadeInDown') },i*500); }) }); }); ul#test > li { display: inline-block; padding: 10px; cursor: pointer; } #test { position: fixed; top: 0; left: 0; } #test2 { position: fixed; top: 0; right: 0; list-style: none; } #test2 > li { background: yellow; width: 350px; height: 600px; /* transition: height 0.3s ease, width 0.2s ease;*/ overflow: hidden; margin-top: -30px; padding-top: 30px; margin-right: -50px; } .hide { display: none; } ul#test2 > li div { padding: 5px; transform: translate3d(0,-2000px,0)} 1 2 3 1 2 3 1 2 3 1 2 3
type: Answer
has comment: http://stackoverflow.com/comment/47518490
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29690489
answers question: http://stackoverflow.com/q/29690489
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/64049939
upvote count: 1
score: 1
has body: The solution which is repeated in many answers document.getElementById('someId').disabled won't work in newer versions of typescript though Check Typescript HTMLElement disabled 1.4 to 1.6 what happened (TS2339)? Try using let elementToCheck = document.getElementById('someId').attributes.getNamedItem('disabled'); if (elementToCheck !== null) { console.log(elementToCheck.value); }
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29765151
has comment: http://stackoverflow.com/comment/120575243

http://stackoverflow.com/comment/62417980
type: Comment
has text: For the benefit of those reading the question and its answers, could you please elaborate what you did in your code sample that resolves the original problem? Thank you!
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/37459345

http://stackoverflow.com/comment/47605313
comment on: http://stackoverflow.com/a/29736070
type: AnswerComment
has text: (disclaimer: untested. I assume node `fs` does expose all methods as enumerable, and there's nothing else)
type: Comment
score: 0

http://stackoverflow.com/comment/47665803
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29767380
has text: Are you using the 'active' class to make list-group-items active? And are you using jQuery?
score: 0

http://stackoverflow.com/a/29828208
answers question: http://stackoverflow.com/q/29827862
type: Answer
has body: var x = 100; var myCounter = setInterval(function(){ console.log(x); x = x+100; if(x == 110){ clearInterval(myCounter); //to clear interval } }, 2000);
score: 0

http://stackoverflow.com/a/29748388
downvote count: 0
answers question: http://stackoverflow.com/q/29748328
has body: Use .each function https://api.jquery.com/each/ $(this).find('.something').each(function( index ) { console.log( index + ": " + $( this ).text() ); });
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29748328
type: AcceptedAnswer

http://stackoverflow.com/comment/47684451
score: 1
type: AnswerComment
type: Comment
has text: Well the very reason I distinguished between type inference and late binding is because Late-binding is more to do with method resolution, javascript does not exhibit the typical v-table of methods or inheritance for one to use the term late-binding, instead it is a prototypical(object) language. Late-binding is mostly concerned at which point in time (just before it runs, for late-binding) the method resolutions happens for complex objects - which does not apply to javascript directly.
comment on: http://stackoverflow.com/a/29770534

http://stackoverflow.com/comment/47598328
has text: Can you post what you have tried, one simple solution is to use async library, another way is to call a recursive function
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29732539
score: 1

http://stackoverflow.com/q/29788628
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29789053
tagged with: css
has comment: http://stackoverflow.com/comment/47706730
has comment: http://stackoverflow.com/comment/47706458
upvote count: 0
score: -4
has comment: http://stackoverflow.com/comment/47706639
has answer: http://stackoverflow.com/a/29789053
has body: <apex:outputText value="Page " style="font-face:verdana;font-size:0.68em;"/> <apex:outputText value="of" style="font-face:verdana;font-size:0.68em;padding-left:2px;padding-right:2px"/> I need to repeat border on every page. Currently I'm getting the border only on the first page, and I need to get the border running on every page. How can I do that?
downvote count: 4
type: AnsweredQuestion
has title: Apply border to divs on every page
type: Question
has comment: http://stackoverflow.com/comment/47706536
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/47757948
score: 0
type: AnswerComment
type: Comment
has text: I've updated my answer now that I know what you want exactly. Feel free to mark it as a the good answer if it is what you want. Next time provide more details immediately so that the answers will be more accurate.
comment on: http://stackoverflow.com/a/29793536

http://stackoverflow.com/q/29701078
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47538614
has body: I have the following code that grabs the dimensions of the resulting image from a cropper tool, and based on the result of dividing height/width, generates a value which is used as the image aspect ratio. I then have this value inserted into the query string url: urlLocation + imageid.value + "/orientation/" + orientation + "/image/" + saveImage,. The issue is that the logic to find the image ratio is not operating correctly, and is seeing all images cropped(whether they are square(height = width), portrait or landscape) as "SQUARE". $submitButton = $(' ') .text('Submit ' + imageid.value).appendTo($(".submit-well")) .on('click', function () { //var USERNAME = "bob"; //var PASSWORD = "bobpass"; var urlLocation = "http://www.url.com/rest/v1/cms/story/"; var saveImage = encodeURIComponent(dataUrl); //USED IF ORIENTATION HAS TO BE MANUALLY SELECTED //var orientation = $("#orientation").val(); // var resultHeight = $("#result").height(); var resultWidth = $("#result").width(); var divide = resultHeight / resultWidth; var precision = divide.toFixed(1); if (precision == 1.77) { orientation = "PORTRAIT"; } if(precision == 0.56) { orientation = "LANDSCAPE"; } if(resultHeight === resultWidth){ orientation = "SQUARE"; console.log(orientation); } $.ajax({ method: "PUT", dataType: 'jsonp', /*headers: { "Authorization": "Basic " + btoa(USERNAME + ":" + PASSWORD) },*/ url: urlLocation + imageid.value + "/orientation/" + orientation + "/image/" + saveImage, /*data: { imageid: imageid.value, orientation: orientation, image: saveImage, },*/ success: function (data) { $(".share-link").html(" Success! " + imageid.value +" was posted. "); console.log(data); }, error: function (data) { $(".share-link").html(" Couldn't send photo: "+ imageid.value + " "); } }); });
score: 0
has title: Calculate image ratio and apply value to query string
accepted answer: http://stackoverflow.com/a/29701340
has comment: http://stackoverflow.com/comment/47538228
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29701340
has comment: http://stackoverflow.com/comment/47538605
has comment: http://stackoverflow.com/comment/47537955

http://stackoverflow.com/comment/47664920
has text: No, it is not normal behavior for Angular to activate all controllers. Show us the rest of your code (including the templates) to find out the issue. Otherwise it's just a guessing game...
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29766903
type: Comment

http://stackoverflow.com/a/29699229
has comment: http://stackoverflow.com/comment/47534276
downvote count: 0
answers question: http://stackoverflow.com/q/29699149
has comment: http://stackoverflow.com/comment/47534410
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47534381
has comment: http://stackoverflow.com/comment/47534443
has body: No you can't (not unless you use Eval() which you shouldn't...). As Justinas has commented, you could use a Multidimensional array. var array = []; array.push(new Array(4)); array.push(new Array(4)); array.push(new Array(4)); array.push(new Array(4)); array.push(new Array(4)); array.push(new Array(4)); array.push(new Array(4)); for(var a = 1; a &lt; 8; a++){ array[a] = new Array(4); }

http://stackoverflow.com/a/29721399
downvote count: 0
has comment: http://stackoverflow.com/comment/47578391
has comment: http://stackoverflow.com/comment/47578324
upvote count: 2
type: AcceptedAnswer
has body: Please change event that carousel listens from slid to slid.bs.carousel $(document).ready(function() { $('#myCarousel').carousel({ interval: 4000 }); var clickEvent = false; $('#myCarousel').on('click', '.nav a', function() { clickEvent = true; $('.nav li').removeClass('active'); $(this).parent().addClass('active'); }); $('#myCarousel').on('slid.bs.carousel', function() { // Get currently selected item var item = $('#myCarousel .carousel-inner .item.active'); // Deactivate all nav links $('#myCarousel .nav li').removeClass('active'); // Index is 1-based, use this to activate the nav link based on slide var index = item.index() + 1; $('#myCarousel .nav li:nth-child(' + index + ')').addClass('active'); }); }); #myCarousel .nav a small { display: block; } #myCarousel .nav { background: #eee; } .nav-justified > li > a { border-radius: 0px; } .nav-pills>li[data-slide-to="0"].active a { background-color: #16a085; } .nav-pills>li[data-slide-to="1"].active a { background-color: #e67e22; } .nav-pills>li[data-slide-to="2"].active a { background-color: #2980b9; } .nav-pills>li[data-slide-to="3"].active a { background-color: #8e44ad; } Headline Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscing elitr. Headline Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscing elitr. Headline Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscing elitr. Headline Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Lorem ipsum dolor sit amet,…
accepted answer of: http://stackoverflow.com/q/29720573
has comment: http://stackoverflow.com/comment/47577926
answers question: http://stackoverflow.com/q/29720573
has comment: http://stackoverflow.com/comment/47578201
type: Answer
score: 2

http://stackoverflow.com/comment/47659005
comment on: http://stackoverflow.com/q/29763461
score: 0
type: Comment
type: QuestionComment
has text: How does the value for 'id' in `showOverlay(id)` get passed in?

http://stackoverflow.com/a/29793121
score: 1
upvote count: 1
has body: In the end I used the suggestion from Qualcuno to use grunt-html-build. This works very well, I will potentially write another grunt task to write in the titles for the widgets on the page. This was my final code: htmlbuild: { dist: { src: 'kitchen_sink/kitchen-sink.shtml', dest: 'prod/kitchen_sink/kitchen-sink.shtml', options: { sections: { views: 'prod/templates/widgets/**/*.shtml', templates: 'prod/templates/widgets/**/*.shtml' } } } }
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29773091
answers question: http://stackoverflow.com/q/29773091

http://stackoverflow.com/comment/47899155
has text: Probably this might explain better: group's origin set to center: http://i.imgur.com/csLtv7U.png vs group's origin set to top/left(default): http://i.imgur.com/PY0JJfo.png
score: 1
comment on: http://stackoverflow.com/q/29829475
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47558080
comment on: http://stackoverflow.com/q/29711108
score: 0
type: Comment
type: QuestionComment
has text: Yes, it is. You are mixing faulty JavaScript with HTML - that's (I'm sorry) a total disaster. If you could provide a https://jsfiddle.net/ with more of your code (like the actual table you want to change), we could try to help better. And please take your time and start reading a bit here: http://www.w3schools.com/js/js_htmldom.asp and move on by clicking "next chapter"

http://stackoverflow.com/comment/47588145
type: Comment
type: QuestionComment
has text: I was wrong. When including an external script that asks for geolocation, the browser will display the host domain, not the CDN domain. My CDN was caching results, so it did not expire old code, which is what was throwing me off. Long day, sorry for wasting your time, everybody.
comment on: http://stackoverflow.com/q/29726613
score: 0

http://stackoverflow.com/comment/47577738
has text: If I'll comment line with `game.$remove()` and click remove button, it will delete all milestones without error (but not the game of course). Every milestone is assigned to game: `assignedToGame: {type: Schema.ObjectId, ref: 'Game'}`. I want to remove all milestones first, then remove game :-)
comment on: http://stackoverflow.com/q/29721522
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47691520
score: 0
has text: Nope, still doesn't work. @EJTH I think you're right, it might just be a scope problem
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29780124

http://stackoverflow.com/a/29819765
upvote count: 4
downvote count: 0
score: 4
has body: You could do; text = text.split('\n').map(function(el) {return el.split('').reverse().join('')}).join('\n'); First, we split the text by newlines and get an array of lines, then reverse every line, then join the array with a newline ('\n') and get a string.
type: Answer
has comment: http://stackoverflow.com/comment/47766526
has comment: http://stackoverflow.com/comment/47766335
answers question: http://stackoverflow.com/q/29819672
has comment: http://stackoverflow.com/comment/47766189
has comment: http://stackoverflow.com/comment/47766513

http://stackoverflow.com/comment/47656165
has text: Also what the code is doing right now, your code also want to do the same thing. What I want to achieve is not there !
type: Comment
comment on: http://stackoverflow.com/a/29761875
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47810902
has text: See this tutorial http://www.w3schools.com/jquery/jquery_dom_remove.asp
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29798342
score: 0

http://stackoverflow.com/comment/47743977
score: 0
has text: You changed my code in your fiddle... this works exactly as designed
type: Comment
comment on: http://stackoverflow.com/a/29804565
type: AnswerComment

http://stackoverflow.com/comment/47725474
comment on: http://stackoverflow.com/a/29797046
type: AnswerComment
type: Comment
has text: Updated the plunkr. check ii. http://plnkr.co/edit/IchoK4SwXsm0KaUdZEX1?p=preview
score: 0

http://stackoverflow.com/comment/47730737
type: QuestionComment
has text: @SpartakusMd downloading like this
comment on: http://stackoverflow.com/q/29801246
score: 0
type: Comment

http://stackoverflow.com/comment/47728378
has text: @jacoviza - It will still work in 5.0 but will not work from 5.1 onwards. Check the updated answer.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29798669
type: Comment

http://stackoverflow.com/a/29825979
score: 0
has body: From your answer to my comment above, I can assume that you are trying to achieve something that is far a way from the standards in CQ and you are not really talking about generation of dialogs in components. Design dialogs are template specific and used to store global settings and affect this way the component's behaviour. If you want to provide something such as dynamic dialogs feature, than you can implement for example some servlet filter which would be responsible for altering of the dialog definitions. From my experience, I can tell you that this would be case that you probably never have and there is mostly much ellegant solution for the requirements you have. I don't thing that I can provide you with fully quallified answer from the description you gave so far. Please post your full requierement if you expect such an answer.
accepted answer of: http://stackoverflow.com/q/29778160
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29778160
type: Answer
has comment: http://stackoverflow.com/comment/48068239

http://stackoverflow.com/comment/47761862
type: AnswerComment
type: Comment
has text: Please mark it as resolved if this answer helped you.
score: 0
comment on: http://stackoverflow.com/a/29816891

http://stackoverflow.com/q/29758696
upvote count: 0
has comment: http://stackoverflow.com/comment/47655878
accepted answer: http://stackoverflow.com/a/29759146
tagged with: javascript
has answer: http://stackoverflow.com/a/29758845
possible better answer: http://stackoverflow.com/a/29758832
has comment: http://stackoverflow.com/comment/47650058
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29758832
answer count: 4
has answer: http://stackoverflow.com/a/29758894
favorite count: 0
has answer: http://stackoverflow.com/a/29759146
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47649857
has body: project with these needs. (10 points) When a button is clicked, the appropriate points are added to the total score. (10 points) You are Not allowed to make any change to the HTML code provided above. In other words, you need to write unobtrusive JavaScript code, attaching event handlers in JavaScript rather than in HTML. (10 points) The window.onload event handler should be an anonymous function. (10 points) You should use the same event handler to handle the onclick event occurred on all of the four buttons on the webpage. In other words, you need to avoid code redundancy by using the this keyword. I would like if someone could tell me a way I can use "this" in both of my functions so it doesn't have to be repetative like it is now in the first function, something like what I commented out. Or a way to simplify the code so it works as it does now. 6 points (touchdown) 3 points (field goal) 2 points (safety/2-point conversion) 1 point (extra point)
has comment: http://stackoverflow.com/comment/47649797
score: -1
type: Question
has title: Is there a way to use this.onClick event and still be able to use "this" in function it calls?
has comment: http://stackoverflow.com/comment/47655924

http://stackoverflow.com/q/29696295
type: Question
tagged with: jquery-dialog
has body: I have built universal jQuery plugin using jQuery Dialog to displays messages. now this is called my jQuery $.ajax -->done function . I need to capture Dialog close event in .ajax function so that I can redirect page after that accordingly. How I achieve this?? Ajax function $('#NewFunctionNavigationForm').submit(function (e) { e.preventDefault(); var DataToPost = JSON.stringify($('#NewFunctionNavigationForm').serializeObject()); var formURL = $(this).attr("action"); $.ajax({ type: "POST", url: formURL, dataType: "JSON", contentType: "application/json; charset=utf-8", data: DataToPost, }) .done(function (data, textStatus, jqXHR) { alert("Success: " + data.Response); $(this).MyMessageDialog({ _messageBlockID: "_StatusMessage", _messageContent: "ccc" }); ????????????? i need to capture dialog close event here?? window.location = "/SystemCore/SystemCoreHome"; }) .fail(function (jqXHR, textStatus, errorThrown) { alert("Error"); }) .always(function (jqXHROrData, textStatus, jqXHROrErrorThrown) { alert("complete"); }); }); message Dialog plugin function ($) { var _messageWrap = { _messageBlockID: "", _messageContent: "" }; $.fn.MyMessageDialog = function (_messageWrap) { alert("from plugin "+_messageWrap._messageBlockID + " " + _messageWrap._messageContent); $("#" + _messageWrap._messageBlockID).text(_messageWrap._messageContent); if($("#"+_messageWrap._messageBlockID).length) //check if div with given ID exists { $("#" + _messageWrap._messageBlockID).dialog({ modal: true, autoOpen: false, buttons: { Ok: function () { $(this).dialog("close"); } }, width: "50%", }); //clear existing content if there are any in given Div $("#" + _messageWrap._messageBlockID).html(""); //add content to div $("#" + _messageWrap._messageBlockID).append(_messageWrap._messageContent); $("#" + _messageWrap._messageBlockID).dialog("open"); } else { alert("not exist"); } }; }(jQuery));
score: 0
has answer: http://stackoverflow.com/a/29696778
upvote count: 1
answer count: 1
downvote count: 1
tagged with: asp.net-mvc
has title: Capture jQuery Dialog close event in $.Ajax done function
tagged with: javascript
type: UnansweredQuestion
tagged with: ajax
linked to: http://stackoverflow.com/q/171928
tagged with: asp.net-ajax
duplicate of: http://stackoverflow.com/q/171928
favorite count: 0

http://stackoverflow.com/q/29780299
tagged with: meteor
has answer: http://stackoverflow.com/a/35194857
type: UnansweredQuestion
has title: EasySearch not working property, but it worked before
type: Question
tagged with: mongodb
answer count: 1
tagged with: javascript
has body: I use Meteor and it is the best thing ever. I really enjoy web development now and javascript become so much fun. I am currently implementing the EasySearch solution for my site and for some reason it s not working anymore, it worked before. https://github.com/matteodem/meteor-easy-search During those time, I works mainly on implementing Collectionsfs, changed the field setting for data. Template code: {{> esInput index="posts" id="search" placeholder="Search Listing..." convertnumber=true }} {{#ifEsIsSearching index="posts" id="search" logic="OR" }} Searching... {{/ifEsIsSearching}} {{#ifEsInputIsEmpty index="posts" id="search"}} {{#each posts}} {{> postItem}} {{/each}} {{else}} {{#esEach index="posts" id="search"}} {{> postItem}} {{/esEach}} {{/ifEsInputIsEmpty}} {{#ifEsHasNoResults index="posts" id="search" logic="OR" }} No results found! {{/ifEsHasNoResults}} Mongodb code: Posts = new Mongo.Collection('posts'); Posts.initEasySearch(['firstName', 'lastName', 'university'], { 'limit' : 20, 'use' : 'mongo-db' }); Posts.allow({ update: function(userId, post) { return ownsDocument(userId, post); }, remove: function(userId, post) { return ownsDocument(userId, post); }, }); Meteor.methods({ postInsert2: function(postAttributes) { check(Meteor.userId(), String); check(postAttributes, { firstName: String, lastName: String, address: String, phone: String, university: String, loanPeriod: String, loanRate: String, loanAmount: String, job: String }); ...........
tagged with: meteorite
tagged with: meteor-helper
score: 0

http://stackoverflow.com/a/29763626
type: Answer
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/29763437
downvote count: 0
has body: This is a common 'flickering' issue, you also see with frameworks like AngularJS. The solution is rather simple. You can hide the contents, until the initialization is done. CSS body { display: none; } body.initialized { display: block; } JS // Initialization like loading the stylesheet, then document.body.classList.add('initialized');

http://stackoverflow.com/a/29777228
score: 0
answers question: http://stackoverflow.com/q/29777001
type: Answer
has body: You could use $broadcast or $emit (bubble up, vs down), but I think a better pattern is to move this into it's own directive. Then you can include that directive into any html that you want. Include a ng-click with that directive and whenever the user clicks that element the dropdown will appear. But without more information/code it's hard to fully understand what your intent is as this is only a config object, and a function from a controller. But here's a link to the kindo tree view angular page for more info: http://demos.telerik.com/kendo-ui/treeview/angular

http://stackoverflow.com/q/29726770
has body: I am using $.ajax to get content from a .php page which returns something similar to the following Item Name Content here Here is my fetching code: $.ajax( { type: "GET", url: appletGet, data: { 'name': this.name }, success: function (data) { console.log(data.replace('\n', '')); $(element).append(data.replace('\n', '')); } }); and I try to append it using $(element).append(data); but I get the error: Uncaught SyntaxError: Unexpected token < I look at some other posts and they all talked about the new lines causing the issue. Because of that, I attempted to remove new lines. $(element).append(data.replace('\n', '')); Which did not work. So, how do I go about fixing this? Edit: Kepi gave an answer earlier which proposed that I use $.parseHTML(data) and then append that. He/She removed his/her answer due to second-guessing himself/herself. Since I do not think you can give credit when it is removed (I am correct right?) I am putting this solution here for future reference. Kepi! Come get your credit!
has comment: http://stackoverflow.com/comment/47587582
has comment: http://stackoverflow.com/comment/47587653
favorite count: 0
has comment: http://stackoverflow.com/comment/47587458
has comment: http://stackoverflow.com/comment/47587535
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/47587470
has comment: http://stackoverflow.com/comment/47587580
has comment: http://stackoverflow.com/comment/47587614
has comment: http://stackoverflow.com/comment/47587590
has title: JQuery Append Unexpected Token "<"
has comment: http://stackoverflow.com/comment/47587509
has comment: http://stackoverflow.com/comment/47587609
has comment: http://stackoverflow.com/comment/47587564
type: Question
has comment: http://stackoverflow.com/comment/47587483
upvote count: 0
score: -2
answer count: 1
has answer: http://stackoverflow.com/a/29726835
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47587432
has comment: http://stackoverflow.com/comment/47587536
has comment: http://stackoverflow.com/comment/47587505
linked to: http://stackoverflow.com/q/11047670

http://stackoverflow.com/comment/47775113
has text: try printing $_POST alone to see if there is anything else inside it. However if you do exactly as @Ayyanar G says you should be doing fine
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29823476
score: 0

http://stackoverflow.com/comment/47620177
comment on: http://stackoverflow.com/a/29742953
score: 0
type: AnswerComment
type: Comment
has text: If your intention is to create fragile code that constantly needs updating, then browser detection by UA string is the ticket. There are thousands of different strings, with new browsers and versions being released all the time, should the OP keep testing and updating every day? week? month?

http://stackoverflow.com/q/29735185
has answer: http://stackoverflow.com/a/29735313
tagged with: javascript
has answer: http://stackoverflow.com/a/29735347
accepted answer: http://stackoverflow.com/a/29735347
has comment: http://stackoverflow.com/comment/47603797
tagged with: jquery
has comment: http://stackoverflow.com/comment/47603564
upvote count: 2
possible better answer: http://stackoverflow.com/a/29735298
answer count: 3
has answer: http://stackoverflow.com/a/29735298
favorite count: 0
has title: javascript jquery accessing the element being clicked
has body: I've got the following list of semibuttons loaded using javascript: var html =' '; html +=' '+this.my.user+' '; var users = this.my.community_users; for (i=0;i<users.length;i++) { if (users[i].user != this.my.user) html +=' '+users[i].user+' '; }; html +=' '; $(html).appendTo("#Dashboard"); Note, that the first item in the list is active. I am getting something like this: Ok, now i code he onclick event to do something when a button is clicked: $(document).on('click', 'a[data-toggle=tab_'+self.my.id+']', function(e){ // whatever here }); What I need now is to set active the tab being clicked and set inactive the tab that was active. How can I access both elements to addclass and removeclass active?
score: 2
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/47603489
has comment: http://stackoverflow.com/comment/47603468
type: Question

http://stackoverflow.com/q/29742457
tagged with: javascript
answer count: 1
downvote count: 0
has title: Different JavaScript behavior in WebBrowser with Doctype
favorite count: 0
has body: I have a Windows Phone 8 project, where I show some data in a WebBrowser component. The WebBworser in Windows Phone 8 does not show a scrollbar, so I implement one on my own. To do this, I need t know the total height of the document (I use document.body.scrollHeight to get it) and the height of the currently shown windows (I use document.body.clientHeight to get it). The complete HTML template is {1} So far so good, my solution works fine. The problem is, I want to use CSS3 so I had to add before the tag to make it work. But adding completely changed the JavaScript behavior, document.body.scrollHeight now does not return the height of the whole document, just a number slightly higher than document.body.scrollHeight. Any ideas how to fix this?
has answer: http://stackoverflow.com/a/29743722
upvote count: 1
type: AnsweredQuestion
score: 1
tagged with: windows-phone-8
tagged with: xaml
type: Question
tagged with: c#
accepted answer: http://stackoverflow.com/a/29743722

http://stackoverflow.com/comment/47573304
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29719278
has text: We're going to have to see your HTML in your offline file. Can you post it to like pastebin.com?

http://stackoverflow.com/a/29864404
has body: In the beginning of the create-method before weapons is filled, i forgot to empty the array. The funny thing is: I tried emptying the array before and it didn't work. When i logged the length of weapons it suddenly started to work as expected. Maybe the cause was a strange optimization made by the javascript-engine.
type: Answer
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29787845
answers question: http://stackoverflow.com/q/29787845
score: 0

http://stackoverflow.com/comment/47754547
comment on: http://stackoverflow.com/q/29802833
has text: AFAIK, there is no way to *tell the browser that the point-in-time of the first manifest is fine*. BTW, since **ServiceWorker - Cache API** is considered as the replacement for appcache in near future, I recommend you to spend your time with it instead of appcache.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47598473
type: Comment
type: QuestionComment
has text: I thought the default was to render the View specified in the URL ( in this case /json_test/main)
comment on: http://stackoverflow.com/q/29732616
score: 0

http://stackoverflow.com/q/29760049
tagged with: javascript
tagged with: jquery
score: 4
favorite count: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47653957
has answer: http://stackoverflow.com/a/29761220
has answer: http://stackoverflow.com/a/29761007
tagged with: css
has body: My code looks like this: ... ... ... The element #arrow has position: fixed, and I'm trying to make the window scroll to the next section when a.next is clicked. Ex: The first time a.next is clicked, the window scrolls to section#first, the second time, the window scrolls to section#second, etc. The same thing happens to a.previous. Does someone know how to solve this problem? Thanks a lot! EDIT My JS code: $('#arrows a.previous').click(function() { $.scrollTo($(this).closest('section').prev(),800); }); $('#arrows a.next').click(function() { $.scrollTo($(this).closest('section').next(),800); });
has answer: http://stackoverflow.com/a/29760879
type: UnansweredQuestion
tagged with: scroll
has comment: http://stackoverflow.com/comment/47652521
linked to: http://stackoverflow.com/q/15125703
type: Question
has title: Scroll to next section
upvote count: 4
has comment: http://stackoverflow.com/comment/47652603
downvote count: 0
has comment: http://stackoverflow.com/comment/47652593

http://stackoverflow.com/comment/47639086
has text: Even though I do not totally agree with it as an anti pattern, I eventually can see something where you get into "return hell". I do see the point how an error could get swallowed, which has made me change the code. But my opinion will not change promises anytime soon.
comment on: http://stackoverflow.com/a/29738794
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29842444
answers question: http://stackoverflow.com/q/29842284
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47811101
type: Answer
upvote count: 1
has body: Put this in your Controller method: return new HttpStatusCodeResult(HttpStatusCode.NotFound);
score: 1
accepted answer of: http://stackoverflow.com/q/29842284
downvote count: 0

http://stackoverflow.com/q/29769930
has comment: http://stackoverflow.com/comment/47671070
has title: json_encode to send data back to js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47670414
has answer: http://stackoverflow.com/a/29769966
type: Question
accepted answer: http://stackoverflow.com/a/29769969
has answer: http://stackoverflow.com/a/29770076
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47671020
has comment: http://stackoverflow.com/comment/47670536
score: 0
has answer: http://stackoverflow.com/a/29769969
answer count: 3
possible better answer: http://stackoverflow.com/a/29769966
tagged with: ajax
has body: Im creating a simple upload script. I use a simple form to let people upload a picture and then a external php script will upload the picture and return some vars to the upload page. But I cant get the part to return some vars to work. currently im using this: The page that also contains the form: form_data.append('file', file_data); $.ajax({ url: 'upload.php', // point to server-side PHP script dataType: 'text', // what to expect back from the PHP script, if anything cache: false, contentType: false, processData: false, data: form_data, type: 'post', success: function(response){ document.getElementById("titel" + amount).innerHTML = response['naam']; }); The upload page that should return some data: echo json_encode(array('naam'=&gt;$naam)); This scripts returns undefined.. If I remove the ['naam'] after response on the form page it will print out: {"naam":"test.png"} Hope someone know what im doing wrong. Thanx in advance!
has comment: http://stackoverflow.com/comment/47670466

http://stackoverflow.com/q/29716171
accepted answer: http://stackoverflow.com/a/29716223
has body: I'm passing a value to codeigniter function for getting a result. But the ajax value does not pass to the php function. My script function follows : &lt;script src="http://code.jquery.com/jquery-1.11.1.min.js"&gt;&lt;/script&gt; &lt;Script&gt; $(document).ready(function() { $("#up").on('click',function(){ if ($("#incdec").val() &lt; $(this).data("max")) { $("#incdec").val(parseInt($("#incdec").val())+1); } }); $("#down").on('click',function(){ if ($("#incdec").val() &gt; $(this).data("min")) { $("#incdec").val(parseInt($("#incdec").val())-1); } }); }); $(document).ready(function() { $(".butt").on('click',function(){ var e=$(".aa").val(); alert(e); $.ajax({ type:"POST", data:"id="+e, url:"&lt;?php echo site_url('pages/getit');?&gt;", success: function(html){ $('#'+dataprocess).html(html); } }); }); }); &lt;/script&gt; My HTML code : &lt;input type="text" name="incdec" id="incdec" value="0" class="aa"/&gt; &lt;input type="button" class="butt" id="up" value="Up" data-max="5" /&gt; &lt;input type="button" id="down" value="Down" data-min="0" class="butt"/&gt; &lt;div id="dataprocess"&gt;&lt;/div&gt; But I'm getting an error as follows: Uncaught Error: Syntax error, unrecognized expression: #[object HTMLDivElement] Please help me find my mistake.
score: 1
has title: Uncaught Error: Syntax error, unrecognized expression: #[object HTMLDivElement]
answer count: 2
has comment: http://stackoverflow.com/comment/47567065
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29716223
tagged with: php
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29716820
tagged with: codeigniter
upvote count: 1
has answer: http://stackoverflow.com/a/29716820
type: Question

http://stackoverflow.com/comment/47678889
has text: that is not possible. If I store it a BLOB (whether it's raster or SVG), how can I store changes made in real time
comment on: http://stackoverflow.com/a/29774121
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29746873
type: Answer
answers question: http://stackoverflow.com/q/29746406
score: 0
has body: The text inside your span is not changing becuse, it is beging declared everytime when change() is being called! Here is the Solution: WORKING DEMO $( document ).ready(function() { setInterval(change, 3000); }); var counter = 0; function change() { var text = ["Fysioterapeut", "Kiropraktor", "Praktiserende læge"]; var elem = document.getElementById("changeText"); elem.innerHTML = text[counter]; counter++; if(counter &gt;= text.length) { counter = 0; } }

http://stackoverflow.com/a/29763607
type: Answer
has comment: http://stackoverflow.com/comment/47685256
has comment: http://stackoverflow.com/comment/47659127
has comment: http://stackoverflow.com/comment/47726880
has comment: http://stackoverflow.com/comment/47661253
has comment: http://stackoverflow.com/comment/47943097
answers question: http://stackoverflow.com/q/29761763
has comment: http://stackoverflow.com/comment/47770822
has comment: http://stackoverflow.com/comment/47664076
has comment: http://stackoverflow.com/comment/47692439
has body: Select Your Option : Car Name Bike Name Laptop Name Place Name Mobile Name Enter your query // I want to change this also Submit Query I have used jquery here some few changes in html try it out this one Select Your Option : Car Name Bike Name Laptop Name Place Name Mobile Name Enter your query // I want to change this also Submit Query And for Jquery you can use this one This works perfectly for me Enjoy :)
has comment: http://stackoverflow.com/comment/47659596
score: 0
has comment: http://stackoverflow.com/comment/47692775
has comment: http://stackoverflow.com/comment/47692493
has comment: http://stackoverflow.com/comment/47664091

http://stackoverflow.com/comment/47552488
has text: Your answer really really helped me to understand in depth. Also your concern is correct I have to check duplicates between all of the groups and I am not allow to extract the csTags array from the main array. So is there any way I can do this keeping my array the way it already have ? any example ?
comment on: http://stackoverflow.com/a/29708191
score: 0
type: AnswerComment
type: Comment

tag-it
tags question: http://stackoverflow.com/q/29812251
type: Tag
tag name: tag-it

http://stackoverflow.com/a/29721201
score: 4
answers question: http://stackoverflow.com/q/29721161
upvote count: 4
has comment: http://stackoverflow.com/comment/47577534
has body: You can bind a mousedown event to document and check if the element clicked on is not div[name="comments"] like so: $(document).mousedown(function(event) { var commentSection = $('div[name="comments"]'); if(!$(commentSection).is($(event.target)) &amp;&amp; !$(event.target).closest($(commentSection)).length) $(commentSection).fadeOut(); });
has comment: http://stackoverflow.com/comment/47577604
has comment: http://stackoverflow.com/comment/47577621
accepted answer of: http://stackoverflow.com/q/29721161
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47577457
downvote count: 0
has comment: http://stackoverflow.com/comment/47577278
has comment: http://stackoverflow.com/comment/47577170
has comment: http://stackoverflow.com/comment/47577774
has comment: http://stackoverflow.com/comment/47577836
has comment: http://stackoverflow.com/comment/47577330
has comment: http://stackoverflow.com/comment/47577291
type: Answer
has comment: http://stackoverflow.com/comment/47577491
has comment: http://stackoverflow.com/comment/47577649
has comment: http://stackoverflow.com/comment/47580172
has comment: http://stackoverflow.com/comment/47577083

http://stackoverflow.com/q/29821792
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47769878
upvote count: 0
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/29821914
has title: Calling function in JavaScript
answer count: 2
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/47769715
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29821904
has body: I use an HTML button to run a function called start_KEMT in my recorder.js script. var recording = false; var button = document.getElementById('button'); function start_KEMT() { if(!recording) { init(); toggleRecording(button); } toggleRecording(button); recording = !recording; } function toggleRecording(button) { var run = parseInt(button.getAttribute('data-run')); if(run === 1) { recorder &amp;&amp; recorder.stop(); recorder &amp;&amp; recorder.exportWAV(function(blob) { uploadAudioFromBlob(blob); }); __log('Recording is stopped'); button.setAttribute('data-run', 0); } recorder &amp;&amp; recorder.clear(); recorder &amp;&amp; recorder.record(); __log('Speak'); button.setAttribute('data-run', 1); } } ...... &lt;button type="submit" class="btn btn-info" id="button" onclick="start_KEMT(this)" data-run="0"&gt;&lt;i class="fa fa-dot-circle-o fa-fw"&gt;&lt;/i&gt;&amp;nbsp;&lt;/button&gt; After clicking on the button the init() function runs. There is problem with toggleRecording(button). I think that problem is because of the button element. After clicking on the button there is also an error in the console: Uncaught TypeError: Cannot read property 'getAttribute' of null Can you please give me an whole example how to modify it? I am really new to JS. I am just trying to modify this script. It wasn't created by me.

http://stackoverflow.com/a/29771559
answers question: http://stackoverflow.com/q/29770893
has body: Pure javacript: data = {"2234":0,"4563":0,"4555":0}; keys = Object.keys(data); // ["2234", "4563", "4555"] for(i = 0; i &lt; keys.length; i++){ console.log(data[keys[i]]); // 0, 0, 0 } and for set the values: for(i = 0; i &lt; keys.length; i++){ data[keys[i]] = 1 } console.log(data); // Object { 2234=1, 4563=1, 4555=1}
type: Answer
score: 0

http://stackoverflow.com/comment/47600008
comment on: http://stackoverflow.com/q/29733016
score: 0
type: Comment
type: QuestionComment
has text: It work here: http://plnkr.co/edit/J5jdqEL5BOvu2fRRw8Ej?p=preview

http://stackoverflow.com/a/29791975
score: 3
upvote count: 3
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29791527
accepted answer of: http://stackoverflow.com/q/29791527
type: Answer
downvote count: 0
has body: You can append anything to your new item, including other elements which you create with jQuery. And before adding your entry to the existing list, you can wrap the added elements into another tag: var list = document.querySelector('ul'); $('&lt;li&gt;') .append('some data') // add text .append($('&lt;h3&gt;', { text: 'some more data' })) // add h3 with text .wrapInner('&lt;div&gt;') // wrap everything in div .appendTo(list); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;ul&gt;&lt;/ul&gt;

http://stackoverflow.com/a/29783911
has comment: http://stackoverflow.com/comment/47697866
score: 1
answers question: http://stackoverflow.com/q/29783044
accepted answer of: http://stackoverflow.com/q/29783044
has body: The window.create callback function is called prior to the execution of the created windows onload event (see here). So presumably the DOM is not yet available at this stage. What you can do is, bind your modifications to the created windows onload event, thus ensuring the DOM is available. chrome.app.window.create( 'index.html', { PARAMETERS }, function (createdWindow) { var contentWindow = createdWindow.contentWindow; contentWindow.onload = function() { var thisWindow = contentWindow.document.querySelector("webview"); thisWindow.setAttribute("src", request.url); } } );
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/q/29817824
accepted answer: http://stackoverflow.com/a/29821199
upvote count: 1
type: AnsweredQuestion
score: 1
tagged with: vaadin
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I would like to call javascript function in vaadin. Its a AbstractJavaScriptExtension. this.callFunction("removeNode"); does not fire the javascript function. Is this a bug or am I doing something wrong? @Override public void remove() { super.remove(); fireRemoveNode(); this.callFunction("removeNode"); } JavaScript code: window.vaadin_components_graph_Node = function() { var self = this; var state = this.getState(); ... this.removeNode = function() { console.log("CALL FUNCTION", "remove node") $(node).remove(); } };
has answer: http://stackoverflow.com/a/29821199
has title: Call JavaScript function in AbstractJavaScriptExtension class
possible better answer: http://stackoverflow.com/a/29863310
has comment: http://stackoverflow.com/comment/47763199
favorite count: 0
has answer: http://stackoverflow.com/a/29863310

http://stackoverflow.com/comment/47598833
comment on: http://stackoverflow.com/q/29732180
has text: @VinayBanakar on link you posted: `Because you only have scripting access to pages that are hosted in the same domain, you can only access the properties to the pages that are hosted within the same domain (for example, Cross Frame Scripting). Therefore, the source document of the IFrame must be from the same domain as the page that contains the IFrame.`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47714248
type: Comment
comment on: http://stackoverflow.com/a/29792792
has text: this is the task assigned to me in my company
score: 0
type: AnswerComment

http://stackoverflow.com/q/29842937
upvote count: 7
has answer: http://stackoverflow.com/a/29894215
answer count: 3
has title: How to template data into the Ajax version of Smart Admin theme?
has answer: http://stackoverflow.com/a/30054386
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
tagged with: smartadmin
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29843311
accepted answer: http://stackoverflow.com/a/30054386
score: 7
has answer: http://stackoverflow.com/a/29843311
favorite count: 0
tagged with: laravel-5
has body: I am building an application for a client where I am developing a web service using Laravel5 on the beck end and I will consume it with the Smart Admin Theme, particularly the Ajax version. I have already worked with the HTML version of this theme and I was still using Laravel as the back end. I could simply use the Blade templating engine provided by Laravel and inject the data into the views. But now since I will be using the Ajax version, how am I supposed to template the data into the views. I can request the web service for the data and it will return it in JSON format. That part is clear to me as I have done it before. Most of the widgets have inbuilt integration such as the jquery data tables and the full calendar library used in the theme. I can see the data will be injected here but what about the forum and other things. Am I supposed to manipulate the DOM by using Jquery or is there a better way around. Angular provides a way in which I can two way data bind the incoming data and I can use ng-repeat to inject it into tables and unordered lists but how will I accomplish this here. Is there a templating system I can use for this?

http://stackoverflow.com/comment/47678165
comment on: http://stackoverflow.com/a/29773457
type: Comment
type: AnswerComment
has text: the first one desappears "text1_contact1" because it's the one set in the textarea and the second one is in the attribute data-default it doesn't disappear
score: 0

http://stackoverflow.com/comment/47725669
has text: `Math.random()` returns a number in the range [0, 1). As written, the last element will never be picked.
type: Comment
comment on: http://stackoverflow.com/a/29798715
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47739198
comment on: http://stackoverflow.com/a/29805424
score: 0
type: Comment
has text: May I recommend you to learn pure javascript before you do it with jQuery? The other way around is a lot more pain :) http://www.codecademy.com/tracks/javascript
type: AnswerComment

http://stackoverflow.com/comment/47741221
comment on: http://stackoverflow.com/q/29806318
score: 0
type: Comment
has text: @Huangism I'm posting my own solution here per request and somebody can feel free to explain below. I had another script designed to remove the decimal `$('.bannerContent td').html($('.bannerContent td').html().replace(".",""));`. This targeted the same `td`, but didn't identify it by its class. This successfully removed the decimal, but for some reason it broke the .each() method. Why?
type: QuestionComment

http://stackoverflow.com/comment/47792262
comment on: http://stackoverflow.com/a/29832074
has text: Thanks for the information. I gave the answer to boombox because he beat you by a few minutes, but you were both helpful.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/34809403
type: Answer
has body: A small hack 1) search glyphicons-halflings-regular.woff 2) Copy glyphicons-halflings-regular.woff as glyphicons-halflings-regular.woff2 3) Put this is required folder. It worked in my case.
score: 0
answers question: http://stackoverflow.com/q/29842583

http://stackoverflow.com/q/29738535
has body: arr = [1,2,3]; arr.forEach(function(i){ // last iteration }); How to catch when the loop ending? I can do if(i == 3) but I might don't know what is the number of my array.
type: Question
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/50688391
upvote count: 136
has answer: http://stackoverflow.com/a/29738635
accepted answer: http://stackoverflow.com/a/29738635
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/71018867
has answer: http://stackoverflow.com/a/58576829
has title: catch forEach last iteration
has answer: http://stackoverflow.com/a/50688391
type: AnsweredQuestion
score: 136
downvote count: 0
has comment: http://stackoverflow.com/comment/126096071

http://stackoverflow.com/q/29728056
has comment: http://stackoverflow.com/comment/47590147
has answer: http://stackoverflow.com/a/29733688
type: Question
answer count: 2
tagged with: google-maps
tagged with: javascript
has body: following this tutorial I've added a google maps component to my rails 4 project. Now when I open my page in the browser (the map is on the landing/index page), the map shows, but when I use the navigation to move around, and come back the map is not there. I am new to rails and have no idea how to fix it, or why it happens. There are no errors in the console. Here is the html of the page I'm talking about: Lokacija <br/ > Institut Jožef Stefan Knjižnica Jamova 39 1000 Ljubljana Telefonske številke informacije: izposoja: bibliografije: vodja knjižnice: fax: +386 1 477-3304 +386 1 477-3304 +386 1 477-3247 +386 1 477-3258 +386 1 477-3152 Delovni Čas ponedeljek-četrtek: petek: 8.00-19.00 8.00-17.00 <%= link_to 'Cenik', zic_cenik_path %> Everything gmaps related is on here. If you need more info please let me know and I'll edit the main post. I also have a gitHub repo of the whole page. The relevant view here would be zic/index .
accepted answer: http://stackoverflow.com/a/29733688
has comment: http://stackoverflow.com/comment/47592012
score: 0
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
possible better answer: http://stackoverflow.com/a/31898507
has comment: http://stackoverflow.com/comment/47593919
has title: Google Maps script only loads the first time I open page
has answer: http://stackoverflow.com/a/31898507
linked to: http://stackoverflow.com/q/7811985
upvote count: 1
has comment: http://stackoverflow.com/comment/47590193
downvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/comment/47545372
type: Comment
type: QuestionComment
has text: Check the JSFiddle link please @Mouser
comment on: http://stackoverflow.com/q/29704907
score: 0

http://stackoverflow.com/q/29722812
linked to: http://stackoverflow.com/q/19761241
tagged with: javascript
score: 0
has body: I’m developing a small web app, and I want to add a ‘close’ button. The app runs inside Chrome window, and runs from a desktop shortcut (there's no opening window). I’m using AngularJS on client side &amp; NodeJS backend. Every solution I've tried: $window.close(); $window.self.close(); $window.open(‘’, ‘_self’, ‘’); $window.close(); Returns this error: "Scripts may close only the windows that were opened by it." Any other creative idea how to bypass/hack this restriction without setting the browser’s configuration? Thanks.
tagged with: node.js
has title: Closing current browser window/tab using JS
has comment: http://stackoverflow.com/comment/47580913
answer count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47579985
has comment: http://stackoverflow.com/comment/47589346
has comment: http://stackoverflow.com/comment/47580898
type: Question
tagged with: browser
has comment: http://stackoverflow.com/comment/47579953

http://stackoverflow.com/a/29761989
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29761837
has body: A little creative reading of the documentation for parseInt() provides an answer for this. Here's what's happening: parseInt expects its first argument to be a string. If it isn't, it converts it to a string. This is actually hilarious, because it appears to do that by...wrapping it in quotes and passing it through .toString(), which is more or less the converse of parseInt() in this case. In your example, parseInt(123123123123123123123123); becomes parseInt("1.2312312312312312e+29"). THEN it takes the converted-to-string value and passes it through parseInt(). As the documentation tells us, if it encounters a non-numeric character, it aborts and goes with what it has so far...and it truncates to an integer. So it's taking "1.2312312312312312e+29", reaching the +, aborting, parsing "1.2312312312312312" instead, and coming up with 1. Unintended consequences! You'll only see this problem with ints large enough that when converted to strings, they render in exponential notation. The underlying problem is that even though you'd think parseInt() and Number.toString() would mirror each other...they don't, quite, because int values passed through toString() can generate strings that parseInt() doesn't understand.
type: Answer
answers question: http://stackoverflow.com/q/29761837
upvote count: 6
has comment: http://stackoverflow.com/comment/48610697
score: 6
type: AcceptedAnswer

http://stackoverflow.com/comment/47589927
comment on: http://stackoverflow.com/a/29727434
type: AnswerComment
score: 0
type: Comment
has text: I have updated my answer using both jquery and pure JS. Good luck

http://stackoverflow.com/comment/47738179
comment on: http://stackoverflow.com/a/29799548
has text: the solution proposed here completely avoids the 1minute delay and the quotas issue. See here https://developers.google.com/gmail/api/v1/reference/quota which is the only quota you will have to deal with (tldr: 250 calls per second and a billion calls daily). Reading the spreadsheet on each change will require much less api calls as you will only do them when the sheet actually changes. Its imposible to make this more effcient with the restrictions you are giving.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/29742548
downvote count: 0
score: 1
has body: Demo You need to assign the filter to $scope, so that it can be used as a filter for your music album list: $scope.selectArtist = function(value){ //pass from ng-click $scope.filterByArtist = value; alert(filterBy); } $scope.selectGenre = function(value){ //pass from ng-click $scope.filterByGenre = value; alert(filterBy); } Then, apply the filter to your music album list: &lt;div class="item" ng-repeat="artist in music | filter:{ artist: filterByArtist, genre: filterByGenre } | orderBy:'-views'"&gt;
has comment: http://stackoverflow.com/comment/47621631
has comment: http://stackoverflow.com/comment/47623024
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29742087
type: Answer
answers question: http://stackoverflow.com/q/29742087

http://stackoverflow.com/a/29763905
type: Answer
has comment: http://stackoverflow.com/comment/47659535
has body: try to use JQuery Library Example 1: $.ajax({ url: "http://fiddle.jshell.net/favicon.png", beforeSend: function( xhr ) { xhr.overrideMimeType( "text/plain; charset=x-user-defined" ); } }) .done(function( data ) { if ( console &amp;&amp; console.log ) { console.log( "Sample of data:", data.slice( 0, 100 ) ); } }); example 2: var jqxhr = $.ajax( "example.php" ) .done(function() { alert( "success" ); }) .fail(function() { alert( "error" ); }) .always(function() { alert( "complete" ); }); // Perform other work here ... // Set another completion function for the request above jqxhr.always(function() { alert( "second complete" ); });
score: 1
has comment: http://stackoverflow.com/comment/47659444
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47659400
answers question: http://stackoverflow.com/q/29763856

web-sql
tags question: http://stackoverflow.com/q/29792412
tags question: http://stackoverflow.com/q/29748370
type: Tag
tags question: http://stackoverflow.com/q/29789124
tag name: web-sql
tags question: http://stackoverflow.com/q/29689052
tags question: http://stackoverflow.com/q/29715052
tags question: http://stackoverflow.com/q/29758354

http://stackoverflow.com/comment/47647697
comment on: http://stackoverflow.com/a/29756386
score: 0
type: AnswerComment
has text: I could give first days in month a _first_ class. And the javascript could detect when scrolled past a _first_ class. But how do i then know which month the _first_ class'ed div represent?
type: Comment

http://stackoverflow.com/q/29826771
has comment: http://stackoverflow.com/comment/47779890
upvote count: 8
has comment: http://stackoverflow.com/comment/47780298
type: UnansweredQuestion
has title: Why modifying `Array.prototype` doesn't work?
linked to: http://stackoverflow.com/q/948358
has comment: http://stackoverflow.com/comment/47779899
has comment: http://stackoverflow.com/comment/47780071
has comment: http://stackoverflow.com/comment/47780194
has comment: http://stackoverflow.com/comment/47780138
has comment: http://stackoverflow.com/comment/47780594
has answer: http://stackoverflow.com/a/29827644
has answer: http://stackoverflow.com/a/29827575
linked to: http://stackoverflow.com/q/2846283
has comment: http://stackoverflow.com/comment/47780428
type: Question
has comment: http://stackoverflow.com/comment/47780446
answer count: 2
linked to: http://stackoverflow.com/q/3561043
has comment: http://stackoverflow.com/comment/47779863
tagged with: javascript
has comment: http://stackoverflow.com/comment/47779929
score: 4
has comment: http://stackoverflow.com/comment/47781046
has comment: http://stackoverflow.com/comment/47780469
has comment: http://stackoverflow.com/comment/47780273
downvote count: 4
has comment: http://stackoverflow.com/comment/47779851
has comment: http://stackoverflow.com/comment/47780343
has body: Please refer - https://jsfiddle.net/53ranmn5/1 Array.prototype.method1 = function() { console.log("method1 called"); } [1,2,3,4].method1(); I get the following error, TypeError: Cannot read property 'method1' of undefined Why so? How can I fix this?
favorite count: 0

http://stackoverflow.com/comment/47784692
has text: @Jack Those conditions will always be met.
score: 0
comment on: http://stackoverflow.com/q/29828831
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47778758
score: 0
type: Comment
has text: http://jsfiddle.net/0pzcr4rx/
type: QuestionComment
comment on: http://stackoverflow.com/q/29825893

http://stackoverflow.com/a/36223731
upvote count: 24
has comment: http://stackoverflow.com/comment/129711157
score: 23
has comment: http://stackoverflow.com/comment/122854141
has body: In latest browsers, Event.isTrusted is available for this particular use-case. As per its MDN document: The isTrusted read-only property of the Event interface is a boolean that is true when the event was generated by a user action, and false when the event was created or modified by a script or dispatched via dispatchEvent. You can simply check inside any event handler: if (e.isTrusted) { /* The event is trusted. */ } else { /* The event is not trusted. */ } Browser Support: Chrome 46.0, Firefox (latest), Opera 33, Safari &amp; IE (no support)
type: Answer
answers question: http://stackoverflow.com/q/29798010
has comment: http://stackoverflow.com/comment/124861327
downvote count: 1

http://stackoverflow.com/comment/47529806
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29696709
has text: @Doodlebunch $looper.data("looperdata",{id:"invitationsLooper"}); does work, that's why you can read [object Object] in the console (in the actual console is clicable and you can see the content). Anyways, when I tried converting it to JSON string first, I had the same issue later on.
score: 0

http://stackoverflow.com/comment/47635532
has text: Use Google chrome source to debug your controller: https://developer.chrome.com/devtools/docs/javascript-debugging
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29751608

http://stackoverflow.com/q/29738649
favorite count: 0
tagged with: html5-canvas
accepted answer: http://stackoverflow.com/a/29738681
has body: I have the following function which prints out a few squares in the shape of a pixel letter. Right now you'll notice I've only got letters a and b in there. Eventually I'll add all the characters but first I need to know how to write this function so that I can pass a parameter to it, and it will print out the shapes to look like the letter you passed into the function as the parameter. Here is the function now: function make_letter() { var c = document.getElementById("myCanvas"); var context = c.getContext("2d"); var w = parseInt(getComputedStyle(c).width); var h = parseInt(getComputedStyle(c).height); var full = Math.floor(h / 16); var unit = full - 0.75; var inv = { a: [[0, 2], [1, 1], [1, 3], [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [3, 0], [3, 4], [4, 0], [4, 4]], b: [[0, 0], [0, 1], [0, 2], [0, 3], [1, 0], [1, 4], [2, 0], [2, 1], [2, 2], [2, 3], [3, 0], [3,4], [4,0], [4,1], [4,2], [4,3]] }; for (i = 0; i &lt;= inv.b.length; i++) { var x = inv.b[i][1] * full; var y = inv.b[i][0] * full; context.beginPath(); context.rect(x, y, unit, unit); context.fillStyle = 'black'; context.fill(); } } I'd like to call the function with make_letter('a'); and have it print a letter that matches the letter that you pass, but at some points in the function I'm not sure how to incorporate the parameter variable correctly. Like in this line: for (i = 0; i &lt;= inv.b.length; i++) { how do I tell it to use inv.param.length assuming 'param' is the name of the parameter variable passed into the function? Here is a fiddle of the original function: http://jsfiddle.net/po74m2ut/
upvote count: 1
type: AnsweredQuestion
has title: How to use parameters for this JS function?
score: 1
has answer: http://stackoverflow.com/a/29738681
has comment: http://stackoverflow.com/comment/47610485
type: Question
tagged with: function
downvote count: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/29713890
has body: It's good practice using the type parameter when you have mixed data types in your dom, however in this case it's better not to use type at all. echo "&lt;script&gt; alert('Username or password incorrect'); &lt;/script&gt;";
answers question: http://stackoverflow.com/q/29713268
score: 0
type: Answer

http://stackoverflow.com/comment/47569710
score: 0
type: AnswerComment
type: Comment
has text: That worked.... It saved the values to db. One more question, when I select the next date, it is not showing from the start time
comment on: http://stackoverflow.com/a/29717355

http://stackoverflow.com/comment/47659787
type: Comment
has text: Thanks. Got it now. Appreciate your help.
comment on: http://stackoverflow.com/a/29763646
score: 0
type: AnswerComment

http://stackoverflow.com/a/29739039
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29739022
answers question: http://stackoverflow.com/q/29739022
type: AcceptedAnswer
has body: this within the uploader.on callback probably isn't the button. Remember the button and then use it in the callback: $('form .button').click(function() { var btn = $(this); // do stuff uploader.on('select', function() { btn.prev().val('text to put'); } }); Side note: Whenever I see an event handler hooked up from within another event handler, it raises a flag for me. If the button is clicked twice, you'll end up with two handlers on uploader for the select event. You might want to check whether that's really what you want... Side note 2: CSS selectors can do more than just ids and classes, you may not need that class="button" on the button. You can select it via form input[type=button] (in your CSS for styling, and in a jQuery $() call and similar to locate it).
upvote count: 3
type: Answer
score: 3

http://stackoverflow.com/comment/47804300
score: 0
type: AnswerComment
type: Comment
has text: [fiddle](http://jsfiddle.net/4aqhB/247/) , just have a look at it, you'll get an idea of what i wanted to achieve....
comment on: http://stackoverflow.com/a/29818308

http://stackoverflow.com/comment/114904789
type: QuestionComment
has text: I thought the issue here is that it doesn't throw a proper error. Hence why you see examples like: _.attempt(JSON.parse.bind(null, str));
comment on: http://stackoverflow.com/q/29797946
score: 0
type: Comment

http://stackoverflow.com/a/29721531
upvote count: 2
has body: CasperJS and PhantomJS have two contexts. The inner context which is programmed through casper.evaluate() is sandboxed. It means that it has no access to variables defined outside. You need to explicitly pass those variables in: var index = 'div.list &gt; div &gt; a[href*=&quot;' + tier + '&quot;]'; function getBattles(innerIndex) { var battles = document.querySelectorAll(innerIndex); return Array.prototype.map.call(battles, function(e) { return e.getAttribute('href'); }); } ... battles = casper.evaluate(getBattles, index); The PhantomJS documentation of evaluate() has an important note: Note: The arguments and the return value to the evaluate function must be a simple primitive object. The rule of thumb: if it can be serialized via JSON, then it is fine. Closures, functions, DOM nodes, etc. will not work!
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47577577
accepted answer of: http://stackoverflow.com/q/29721176
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29721176
downvote count: 0

http://stackoverflow.com/q/29723088
linked to: http://stackoverflow.com/q/29721044
type: Question
has body: So here is what I am trying to accomplish, I have a ul with 10 li in it. By using the DOM, I have targeted the li's and have converted them into an array. (When I say I, I actually mean myself and the Stackoverflow community, still a beginner). Now I need to sort the array of list items and then replace the list of bugs with the new sorted list. My markup is below: Bugs in the DOM Bugs in the DOM Horse Flies Bed bugs Mosquito Ants Mites Cricket Woolly Bear Caterpillar Fleas Worms Leeches And now my JS: var list = document.getElementsByTagName("ul"); for (var i = 0; i < list.length; i++) { var items = list[i].getElementsByTagName("li"); for (var j = 0; j < items.length; j++) { console.log(items[j]); } } var newList = Array.prototype.slice.call(document.getElementsByTagName("li"), 0); newList.forEach(function(item) { console.log(item); }); I am really unsure as to how to sort DOM elements. I know that the sort() method will not work as this is not a typical array. Thank you all in advance!
tagged with: arrays
tagged with: javascript
has title: Sort DOM elements and reinsert them into a UL
tagged with: sorting
has comment: http://stackoverflow.com/comment/47602036
score: 0
has comment: http://stackoverflow.com/comment/47581168
linked to: http://stackoverflow.com/q/24342242
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
duplicate of: http://stackoverflow.com/q/24342242
answer count: 0
tagged with: dom

http://stackoverflow.com/comment/47679399
type: Comment
has text: This is not working neither. But actually I think it's because my SVG is in a different file. I'm including it into my html using a ` ` so I'm not sure how to achieve this.
type: AnswerComment
comment on: http://stackoverflow.com/a/29755830
score: 0

http://stackoverflow.com/comment/47678568
comment on: http://stackoverflow.com/q/29774072
type: QuestionComment
has text: `val` is used for getting value of form controls not a `label` element. Use the `.text()` method instead.
type: Comment
score: 1

http://stackoverflow.com/comment/47639234
has text: Are websockets supported by all modern browsers? If there are hundreds of people connected would it be any faster? I feel like writing the same string to 100 sockets is slower than writing it to one application variable that 100 users read from. I'm not familiar with any pre built chat libraries or services, if you know of any that would be more efficient than what I'm using now I would appreciate that. This is my first time creating any kind of web chat so I'm trying to tackle it however I can.
score: 0
comment on: http://stackoverflow.com/q/29709170
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29694686
has comment: http://stackoverflow.com/comment/47624230
has comment: http://stackoverflow.com/comment/47610103
type: AcceptedAnswer
downvote count: 0
upvote count: 2
has body: Did you try to assign classes? Either with pure Javascript: document.getElementById('selector').className = 'active'; or with jQuery: jQuery('#selector').addClass('active'); This way you can use CSS classes and not hardcode the colour in your Javascript code. See implementation of addClass and removeClass in Javascript: http://jaketrent.com/post/addremove-classes-raw-javascript/
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29694361
answers question: http://stackoverflow.com/q/29694361

http://stackoverflow.com/q/29737939
tagged with: primitive
score: 1
has comment: http://stackoverflow.com/comment/47651831
type: Question
has comment: http://stackoverflow.com/comment/47632770
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47609287
favorite count: 0
has comment: http://stackoverflow.com/comment/47651841
has body: var obj = {x:5, y:new Number(5)}; function value(value) { //using == would result in false positives for value.call(obj.y, new Number(5)); return this === value; } console.log(value.call(obj.x, obj.x)); //False console.log(value.call(obj.y, obj.y)); //True Javascript (for obvious reasons), wraps primitives in temporary objects when they are assigned to this. Are there any ways to determine whether the object referenced via this is user-created and permanent vs. system-created and transient?
has comment: http://stackoverflow.com/comment/47610115
has comment: http://stackoverflow.com/comment/47610253
has title: Determine whether object-wrapped primitive was user created
has answer: http://stackoverflow.com/a/29738032
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/comment/47668020
comment on: http://stackoverflow.com/a/29768587
score: 0
type: Comment
has text: Ah, so if I change everything to have `<?php echo` before and `; ?>` after it should work?
type: AnswerComment

http://stackoverflow.com/comment/47624015
type: Comment
comment on: http://stackoverflow.com/a/29745185
type: AnswerComment
score: 0
has text: @Alex: Glad you got it sorted. I was looking through that plugin and couldn't see any reason why this wouldn't work. :)

http://stackoverflow.com/comment/47550333
type: AnswerComment
has text: well that makes sense. however, I tried that and nothing changed. the postback still happened, I've also tried e.stopPropogation() and also passing the event into spanClick.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29707191

http://stackoverflow.com/comment/47622208
comment on: http://stackoverflow.com/q/29744558
type: Comment
has text: there is a simpler solution. That is keep a hidden field with the id of the field and do an ajax post. Hence you can retrieve the data using input method. Do you want me to show how its done?
score: 0
type: QuestionComment

http://stackoverflow.com/a/29829689
upvote count: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47787532
downvote count: 0
has body: You need to go through and read documentation learn how sails works. Try https://Sailsjs.org and / or http://irlnathan.github.io/sailscasts/blog/2015/01/01/lets-start-a-new-adventure/ For starters your controller is not written correctly module.exports = { post : function (req, res) { var val = req.param('val'); return res.send ({'val': val}); } } This should help a little, but your code was written in a way that says that your very unfamiliar with how sails works in general. You should read the docs or watch those videos linked above to get you started.
score: 4
answers question: http://stackoverflow.com/q/29828918
has comment: http://stackoverflow.com/comment/47786244
accepted answer of: http://stackoverflow.com/q/29828918
type: Answer
has comment: http://stackoverflow.com/comment/47786326
has comment: http://stackoverflow.com/comment/47787830

http://stackoverflow.com/a/29755599
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47644179
answers question: http://stackoverflow.com/q/29755350
has comment: http://stackoverflow.com/comment/47643549
has body: replace delete stars[0]; with stars.splice(i,1); i--; I don't see anything else that is wrong.
downvote count: 0
has comment: http://stackoverflow.com/comment/47643909

http://stackoverflow.com/comment/47552933
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29708508
score: 0
has text: because of the wonderful effects that can be done with jquery

vote
type: Tag
tag name: vote
tags question: http://stackoverflow.com/q/29715794

http://stackoverflow.com/comment/47649314
type: Comment
comment on: http://stackoverflow.com/q/29758283
score: 0
has text: I have the javascript code in a separate js file. It is listed in the js links at the bottom of the actual page. I only included the HTML that I am currently working on in the question. Sorry. Also, what do you mean the tag is mandatory? Do you see it missing somewhere? Thanks.
type: QuestionComment

http://stackoverflow.com/comment/47781185
has text: If the data is being pulled down for each row as separate requests then a directive for the chart makes the most sense. The directive would download the data and upon completion would crate the chart for it
comment on: http://stackoverflow.com/q/29826182
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29696428
upvote count: 1
answers question: http://stackoverflow.com/q/29695523
has comment: http://stackoverflow.com/comment/47529449
type: Answer
downvote count: 0
score: 1
has body: I have added a class glow to your div and add the same on the click and removed the same when overlay. $("#overlay").on("click", function(){ this.style.display = "none"; $("#clk").show(); $("#maincont").removeClass("glow"); }); $("#clk").on("click", function(){ $("#overlay").show(); $("#maincont").addClass("glow"); $("#clk").hide(); }); *{ margin: 0px; padding: 0px; } #overlay{ font-family: "Comic Sans MS", cursive, sans-serif; position: fixed; width: 100%; height: 100%; z-index: 1; background-color: #000; opacity:0.5; -webkit-transition: all 0.3s ease-out; -moz-transition: all 0.3s ease-out; -ms-transition: all 0.3s ease-out; -o-transition: all 0.3s ease-out; transition: all 0.3s ease-out; } #overlay p, #overlay img{ position: relative; } #overlay p{ color: blue; } #instruction1{ top: 50px; left: 400px; } #arrow1{ width: 100px; position: relative; top: 100px; left: 150px; } #instruction2{ top: 100px; left: 225px; } #dismiss{ font-size: 12px; } .shome{ display: block; } main{ z-index: 0; } main div{ padding: 50px; background: rgb(0,120,170);color:#fff; z-index: 1; opacity: 0.8; } .glow{ opacity: 1; z-index: 2; color: white; position: relative; } This is some instruction. (tap to dismiss) This is something cool! This is my main content. Click to see Instructions. PS. Your image of the arrow is blocked in this snippet sorry for that

http://stackoverflow.com/comment/47628168
comment on: http://stackoverflow.com/a/29747779
score: 0
type: AnswerComment
has text: Glad I could provide some additional info (since there was an accepted answer already). :-)
type: Comment

http://stackoverflow.com/comment/47744485
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29807909
has text: Okay, it works on firefox(yay!), but not IE11. What might be the reason for that? I gave you an upvote. :)

http://stackoverflow.com/q/29739521
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to create a dropdown navigation with Jquery Tabs. My problem is finding a way to hide the default open panel. I want the dropdown to show only when I hover it or click. I can't find a good way. Help is needed. HTML Departments Faculties New Courses Science Biology Government Science Biology Government Science Biology Government Science Biology Government Science Biology Government Science Biology Government Science Biology Government Science Science Biology Government Science Biology Government JS $(document).ready(function(){ $("#tabs").tabs({ event:'mouseover', }); }); Thanks, guys
type: UnansweredQuestion
tagged with: css
has answer: http://stackoverflow.com/a/29739600
has title: JQuery Tabs To Create DropDown Menu :Help Needed
has answer: http://stackoverflow.com/a/29739663
type: Question
has answer: http://stackoverflow.com/a/29739909
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/31168006
score: 0
has body: My situation is a little different, but it might be similar enough to be helpful to you or someone else. I have gulp + browserSync set up like this: .task('serve', ['clean', 'lint', 'sass', 'js', 'server'], function () { return gulp.watch([paths.js, paths.html, paths.sass], ['lint', 'sass', 'js', browserSync.reload]); }) This would start up and open the page once. If I made a change to the HTML page and save it, I could see lint, sass, js, and browserSync.reload run, but the browser didn't refresh. My HTML was very simple; this: TEST I changed the HTML to this finally and it started working: TEST HELLO-TEST
type: Answer
answers question: http://stackoverflow.com/q/29801070

http://stackoverflow.com/a/29810483
accepted answer of: http://stackoverflow.com/q/29810359
score: 2
answers question: http://stackoverflow.com/q/29810359
has body: JavaScript numbers have a toString method which takes a radix. Using toString(16) will get you the number in hex. Is this what you're looking for?
downvote count: 0
has comment: http://stackoverflow.com/comment/47753061
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47749115
upvote count: 2
type: Answer

http://stackoverflow.com/comment/47621447
type: Comment
comment on: http://stackoverflow.com/a/29743119
type: AnswerComment
has text: If it says `Session is not defined`, it just means it's not available at the time of execution in the scope.
score: 0

http://stackoverflow.com/q/29793689
accepted answer: http://stackoverflow.com/a/29802985
has comment: http://stackoverflow.com/comment/47721619
has title: Safari createPattern fails with SVGs: suggestions for alternatives?
type: Question
tagged with: safari
type: AnsweredQuestion
upvote count: 4
tagged with: canvas
has body: I am using an SVG image as a background pattern for an HTML5 canvas element, using the following syntax: var img = new Image(); img.onload = function() { var pattern = badge.createPattern(img, 'repeat'); badge.fillStyle = pattern; // draw 'badge' shape badge.fill(); }; img.src = '../flags/iso/'+country+'.svg'; This works as expected in Firefox and Chrome, but in Safari (7.0.3) the background is blank (white). Using a png or jpg for the background image works as expected in Safari et al - it's only SVGs that render incorrectly. Any pointers gratefully received. There are many other reports of Safari SVG bugs around, but I'm unsure if this is specific to that, or something to do with Canvas implementation. UPDATE: This is a previously reported bug in Safari, but no action seems to have been taken. Problem is using SVG to createPattern. If Safari cannot load SVGs with createPattern, are there any other alternatives to loading images into irregular shapes (polygons) in the canvas, acting as background images?
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29802985
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/47718136
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: http://stackoverflow.com/tag/svg

http://stackoverflow.com/comment/47671783
type: AnswerComment
type: Comment
has text: If you want to show the percentage from 1 to 100. Use **complete** method in jquery Ajax for each service request.
comment on: http://stackoverflow.com/a/29770432
score: 0

http://stackoverflow.com/a/29823718
score: 0
has comment: http://stackoverflow.com/comment/47776292
answers question: http://stackoverflow.com/q/29821946
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47776012
has body: DEMO PAGE / GIST I have solved working by logic, so I would first look inside the elements, then their siblings, and last, if there are still unfound items, I would do a recursive search on the parents. JS CODE: jQuery.fn.findClosest = function (selector) { // If we have a :this selector var output = $(), down = this.find(selector), siblings, recSearch, foundCount = 0; if(down.length) { output = output.add(down); foundCount += down.length; } // if all elements were found, return at this point if( foundCount == this.length ) return output; siblings = this.siblings(selector); if( siblings.length) { output = output.add(siblings); foundCount += siblings.length; } // this is the expensive search path if there are still unfound elements if(foundCount < this.length){ recSearch = rec(this.parent().parent()); if( recSearch ) output = output.add(recSearch); } function rec(elm){ var result = elm.find(selector); if( result.length ) return result; else rec(elm.parent()); } return output; }; // Test case var buttons = $('a').findClosest('button'); console.log(buttons); buttons.click(function(){ this.style.outline = "1px solid red"; })
accepted answer of: http://stackoverflow.com/q/29821946
has comment: http://stackoverflow.com/comment/47777499
type: Answer
has comment: http://stackoverflow.com/comment/47778439
has comment: http://stackoverflow.com/comment/47775067

http://stackoverflow.com/q/29829505
favorite count: 0
has title: Error handling for special types of $resource request errors
tagged with: angularjs
type: Question
tagged with: angular-resource
linked to: http://stackoverflow.com/q/29738039
has body: I have a working Angular app that makes requests to a REST API through a $resource service I have set up. Everything works well - I have callbacks for my success and error conditions, and if it is an "expected" error I have a service that knows how to parse the httpResponse to show a message that will be meaningful to the user - HTTP codes, special application error codes, etc. There are some types of errors (unknown server, CORS-related error when running in the wrong environment, a server timeout, etc.) that hit the error handling callback function, but do not seem to have enough data in them to give a meaningful message to the user, or it is highly browser-dependent - IE has details in the message and description fields, but I don't see anything analogous in Chrome/Firefox. In these cases the error shows up in the browser console, but 99.9% of my users will never have the console open to see the specific message like: XMLHttpRequest cannot load http://myserver/v1/job/submit. Request header field Content-Type is not allowed by Access-Control-Allow-Headers. In Chrome/Firefox I see lots of fields in the httpResponse object, like config.data, config.headers, etc. related to my request, but I can't find anything related to what I see in the console message anywhere. I have had a suggestion to use an interceptor, but for $resource it appears that interceptors only handle responses and response errors, and I am already handling both of these cases - it doesn't appear to me that using an interceptor would have any extra information available to its handler. Does the error just live "outside the scope" of the httpResponse or is there somewhere I can find it so that I can show it to the user? $scope.submitJob = function(job) { $scope.submitting = true; jobService.submit({}, job, function (response) { $scope.submissionResponse = response; $scope.submitting = false; $scope.submitSuccess = true; }, function (httpResponse) { // gets hit, but I don't see anything in it related …
upvote count: 1
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47786502
has comment: http://stackoverflow.com/comment/47785462
answer count: 0
downvote count: 0
score: 1

http://stackoverflow.com/comment/47905528
score: 0
comment on: http://stackoverflow.com/q/29748405
has text: @halex - Thanks for your answer , could you please explain about "with all newlines removed as an literal" ?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47550110
comment on: http://stackoverflow.com/q/29707110
type: Comment
type: QuestionComment
score: 0
has text: Dont know if it's possible that's why im trying.

http://stackoverflow.com/q/29731688
has body: function newCheckbox(){ var aLabel = document.form1.getElementsByTagName('label'); var last = aLabel[aLabel.length-1]; var label = document.createElement('label'); label.appendChild(Box(aLabel.length)); label.appendChild(document.createTextNode(' '+document.getElementById('text').value)); last.parentNode.insertBefore(label, last); document.getElementById('text').value = ''; } function Box(num){ var elm = null; try { elm=document.createElement(' '); } catch(e) { elm = document.createElement('input'); elm.setAttribute('type', 'checkbox'); elm.id='chk'+num; } return elm; } function delBoxes(){ var texts = document.form1.getElementsByTagName('label'); for(var i = 0; i<texts.length-1; i++){ var chbox=Box[i]; txt = texts[i]; if(chbox.checked){ chbox.parentNode.removeChild(chbox); txt.parentNode.removeChild(txt); } } } form{ color:blue; font-weight:bold; margin:100 0 0 50; font-weight:bold; margin-left:120; padding:100; } label{ display:block; } input{ color:blue; background-color:pink; } Checkbox text: I want to have a dynamic page that allows a user to add checkboxes to the page. Checkbox content is the input in the textbox. When the user pushes the “add”-button checkboxes are created and shown. The user must have the ability to remove checkboxes by marking them. The code can add a new checkbox to the form but the deleting function does not work. It seems that chbox is not created and the if-statement does nothing in the function delBoxes. Any suggestions?
has comment: http://stackoverflow.com/comment/47597157
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47597034
tagged with: checkbox
has comment: http://stackoverflow.com/comment/47596847
type: UnansweredQuestion
tagged with: dom
type: Question
has title: How to remove checkboxes in the form
has answer: http://stackoverflow.com/a/29732075
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47596854
has comment: http://stackoverflow.com/comment/47597179
answer count: 1

http://stackoverflow.com/comment/47563527
has text: i think replace this tag... datepicker2:{ required:true, date:true }
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29714185
type: QuestionComment

http://stackoverflow.com/comment/47764319
score: 0
type: QuestionComment
type: Comment
has text: mentioned jquery is working? and u want the same in javascript?
comment on: http://stackoverflow.com/q/29818689

http://stackoverflow.com/a/29831070
answers question: http://stackoverflow.com/q/29830648
has comment: http://stackoverflow.com/comment/47789793
upvote count: 2
has body: If tags is a simple array of strings, you can query this field to match a particular value using this syntax : Posts.find({ tags: "value" }); $in is used when you want to search for documents having a particular field value among a set of values defined in an array. Posts.find({ tags: { $in: ["value1","value2","value3"] } }); This query would return posts having a tags array containing at least one of the specified value, which would be useful if you want to filter posts using multiple tag values. http://docs.mongodb.org/manual/reference/operator/query/in/#op._S_in If you want to define a route displaying only posts having a particular tag value, use this controller : Router.route("/posts/:tag", { name: "postList", waitOn:function(){ return Meteor.subscribe("postsByTag",this.params.tag); }, data: function() { return Posts.find({ tags:this.params.tag }); } });
type: Answer
has comment: http://stackoverflow.com/comment/47789515
score: 2
downvote count: 0

http://stackoverflow.com/q/29709388
has body: I am using the Reflux.connectFilter mixin to have a bunch of Graph components listen to changes in my GraphStore. Using the filter, they should only re-render when an element in the GraphStore's graphs array matching their ID is changed (or added/removed). However, when I update the a single element of the array, say by setting a name variable, I am still seeing all the listening Graphs re-render. Am I doing something wrong? GraphStore var Reflux = require('reflux'); var GraphActions = require('./graphActions').GraphActions; var GraphStore = Reflux.createStore({ listenables: [GraphActions], init: function() { this.graphs = []; this.metricMetaData = {}; }, onAddGraph: function(graphId, name) { // Called only by the Dashboard component that is a parent to all Graphs this.graphs.push( { id: graphId, name: "" } ); this.updateGraphs(); }, onSetName: function(graphId, name) { // Called only by the Dashboard component that is a parent to all Graphs for(var i = 0, gl = this.graphs.length; i < gl; ++i) { if(this.graphs[i].id === graphId) { this.graphs[i].name = name; this.updateGraphs(); return; } } }, ... updateGraphs: function() { this.trigger(this.graphs); // This is the only place in the store where trigger is called }, getInitialState: function() { return this.graphs; } }); module.exports = {GraphStore: GraphStore}; Graph /** @jsx React.DOM */ var React = require('react'); var Reflux = require('reflux'); var GraphActions = require('./graphActions').GraphActions; var GraphStore = require('./graphStore').GraphStore; var Graph = React.createClass({ mixins: [Reflux.connectFilter(GraphStore, "graph", function(graphs) { return graphs.filter(function(graph) { return graph.id === this.props.id; }.bind(this))[0]; })], propTypes: { id: React.PropTypes.string.isRequired }, ... render: function() { if(typeof this.state.graph === "undefined") { return ( The graph has not been created in the store yet ); } else { return ( Graph name: {this.state.graph.name} ); } } }; module.exports =…
has comment: http://stackoverflow.com/comment/86001025
tagged with: reactjs
answer count: 1
downvote count: 0
tagged with: refluxjs
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29774051
tagged with: datastore
score: 2
type: AnsweredQuestion
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/86050830
accepted answer: http://stackoverflow.com/a/29774051
has title: Reflux connectFilter still sending updates to all listening components

http://stackoverflow.com/a/29754136
upvote count: 2
has body: The closure is surely messing up your code. Here is the shortest and simplest solution I can think of: function SomeClass () { this.someFunction = function() { alert("done"); }; var cached_function = this.someFunction; this.someFunction = function() { alert("new code"); cached_function.apply(this, arguments); } }
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29753865
score: 2

http://stackoverflow.com/a/29913913
answers question: http://stackoverflow.com/q/29836997
has body: Since posting this question I've simplified things a bit (although there's a little double-handling, which I'm not entirely happy about): &lt;div data-generate-popover="key" data-popover="{{tooltip}}"&gt;&lt;/div&gt; module.directive('generatePopover', ['myService', function(myService) { return { restrict: 'A', priority: 10, link: function (scope, element, attrs) { var key = scope.$eval(attrs.generatePopover); element.removeAttr(attrs.$attr.generatePopover); scope.tooltip = myService.getPopoverText(key); }, }; }]); (In this case I know that there will only be one of these per scope defined higher up by ngRepeat, so I don't need to worry about multiple tooltips overwriting each other.) Having said that, this is still a hack and I'm looking forward to replacing it with a one-time binding when I can upgrade AngularJS.
score: 0
type: Answer

http://stackoverflow.com/comment/47531729
has text: Make sure your HTML file is also encoded in UTF-8. And try to use file directly from Highcharts CDN, not local files - maybe when saving file it was converted to CP1250 or something similar.
comment on: http://stackoverflow.com/q/29697091
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29790060
score: 1
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: couchdb
favorite count: 0
tagged with: pouchdb
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29797031
type: UnansweredQuestion
has title: how to store large files (pdfs) into the browser file system
upvote count: 1
tagged with: local-storage
has body: Background: I have built an offline HTML5 application that stores some data into the local browser db using pouchdb. Now the requirements have changed and I have to store large pdf documents(around 200 of them, each with 5mb - 8mb size) into the local browser so the user can view it offline when required. Issue: I don't think that it is a good idea to put these large documents received from server into my in browser database using pouchdb. I would like to know if there is a way to put these documents into my device some how and then get a url reference pointing to the location within the local device ?.
has answer: http://stackoverflow.com/a/29790295

http://stackoverflow.com/comment/47749607
comment on: http://stackoverflow.com/a/29810754
score: 0
type: Comment
has text: so if i change where the ` ` page is run from so instead of the head tag, to a footer tag that i may fix it?
type: AnswerComment

http://stackoverflow.com/q/29694302
score: 1
has comment: http://stackoverflow.com/comment/47525205
has answer: http://stackoverflow.com/a/29694450
type: Question
tagged with: javascript
tagged with: date
has answer: http://stackoverflow.com/a/29694488
answer count: 3
has comment: http://stackoverflow.com/comment/47525079
upvote count: 1
favorite count: 0
has body: I am trying to use the fullcalendar.io jquery plugin in my web application. For that, I parse a set of event data into fullcallendar's format like this: Date.prototype.addHours = function(h) { this.setHours(this.getHours() + h); return this; } Date.prototype.addMins = function(h) { this.setMinutes(this.getMinutes() + h); return this; } data.forEach(function(entry) { events[i] = { title : 'Clase', start : new Date(entry.date), end : new Date(entry.date).addHours(entry.hours).addMins(entry.mins) } i++; }); Now my data is formated like this: [{"date":"2015-05-01T15:00:00.000","hours":4,"mins":30},{"date":"2015-05-04T15:00:00.000","hours":4,"mins":30}, ... ] However when I create a Date object for 15:00 hours, I get a 17:00 time. I am sure this is related to timezone (I am currently in GMT+2 due to summer time), but I'm not sure how to fix it.
has title: Wrong Date in Javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29694475
downvote count: 0

http://stackoverflow.com/q/29732039
type: AnsweredQuestion
has title: Why is setTimeout executing timeExpired with no delay?
tagged with: settimeout
has comment: http://stackoverflow.com/comment/47597543
type: Question
has comment: http://stackoverflow.com/comment/47597990
has answer: http://stackoverflow.com/a/29732635
accepted answer: http://stackoverflow.com/a/29732635
tagged with: javascript
score: 0
answer count: 1
has body: I am learning javascript, and have come across a problem that leaves me completely stumped. When I call setTimeout the function parameter runs immediately with no delay. Overall program (segment) purpose: User inputs a number of minutes they want to set a timer for. Inputed value is passed to a submitName(), which sets the timer and calls timeExpired() when the timer goes off. Relevant HTML: Name: How many minutes do you want to set the alarm for? Submit Relevnt Javascript: What I've tried: √ Comparing examples on MDN, W3schools, and other questions on stack overflow to try to find a solution. √ Wrapping in anonymous function (as above). Many variations with and without anonymous function adding/removing the brackets() and semi-colon(); of timeExpired on function call. √ Debugging with the built in firefox debugger (no errors found). √ Checking the value submitted by the user is properly assigned to x, and multiple assigned to num. NOTES: -I am aware of the dubious reputation of W3schools, and am keeping my eyes open. -I am aware that document.write() overwrites the contents of the fully-loaded screen. I am only using it in a limited capacity in (user-invoked) pop-up windows.
has comment: http://stackoverflow.com/comment/47597628
has comment: http://stackoverflow.com/comment/47598287
has comment: http://stackoverflow.com/comment/47598200

http://stackoverflow.com/comment/47643806
comment on: http://stackoverflow.com/q/29755686
score: 0
type: Comment
type: QuestionComment
has text: You're going to have to be a lot more clear with what you're asking - @bloodyKnuckles's solution will return the location (index) of "Hello World" if it exists anywhere in the HTML of the page, or `-1` if it isn't found.

http://stackoverflow.com/comment/47652945
score: 0
type: AnswerComment
has text: thx Matt Johnson for reply , look i have website for just time zone , so i see setTimezone from server its ok , becouse the time server is update the time every second and DST transitions its also update that , sorry if u dont understand becouse my english isnt so good :)
comment on: http://stackoverflow.com/a/29759831
type: Comment

http://stackoverflow.com/comment/47753861
score: 1
type: QuestionComment
has text: If this is plain JS, `var locations=[10];` would only declare an array with one element (`10`) in it, not an "empty" array with 10 slots.
type: Comment
comment on: http://stackoverflow.com/q/29812938

http://stackoverflow.com/comment/47571697
type: Comment
type: AnswerComment
has text: @RaviPK the callback is in my answer, it will be called when state will change and it get the text when http request is finish.
comment on: http://stackoverflow.com/a/29718448
score: 0

http://stackoverflow.com/a/29830261
type: Answer
upvote count: 1
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29830168
has comment: http://stackoverflow.com/comment/47844042
has body: I use date inputs with FireFox. It does not matter. When the form is submitted I still use strtotime() on the submitted date. $date = strtotime ($_POST['date']); I have a PHP script that calculates the day between two dates. Days Between Two Dates This image is from FireFox: &lt;?php $to = strtotime($_GET['to']); $from = strtotime($_GET['from']); if (!$from &amp;&amp; !$to){ $from = '8/21/2001'; $to = '5/27/2014'; $answer = "&lt;h2&gt;Number of days between&lt;br/&gt;Tuesday the 21st of August 2001 and&lt;br/&gt;Tuesday the 27th of May 2014 is&lt;br/&gt;4,662 days&lt;/h2&gt;"; } else { $days = number_format(intval(($to - $from) / 86400)); $d1 = date('l \t\h\e jS \of F Y ',$from); $d2 = date('l \t\h\e jS \of F Y ',$to); $answer = "&lt;h2&gt;Number of days between&lt;br/&gt;$d1 and&lt;br/&gt;$d2 is&lt;br/&gt;$days days&lt;/h2&gt;"; $to = $_GET['to']; $from = $_GET['from']; } echo &lt;&lt;&lt;EOT &lt;form method="get" action-"dates2days.php"&gt; From: &lt;input type="date" name="from" value="$from"/&gt;&lt;br/&gt; To:&amp;emsp;&amp;ensp;&lt;input type="date" name="to" value="$to" /&gt;&lt;br/&gt; &lt;input type="submit" value="&amp;emsp;Get Days Between Dates&amp;emsp;"/&gt; $answer &lt;/form&gt; EOT; ?&gt;

http://stackoverflow.com/a/33626997
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29780701
type: Answer
has body: To Export High charts to png You can use Html2Canvas library, which can take a screenshot of your high charts and generate a PNG Image. using Html2Canvas its not possible then you can use CANVG library,which is convert your svg element to PNG Image.

http://stackoverflow.com/comment/48596906
type: QuestionComment
has text: Your jsfiddle is working, please post a non-working jsfiddle to help you.
type: Comment
comment on: http://stackoverflow.com/q/29756835
score: 0

http://stackoverflow.com/comment/47772398
type: Comment
has text: Well I always thought of filters to use them for interpolations or directives. To format output for the user. Not to transform the underlying data.
comment on: http://stackoverflow.com/a/29822692
type: AnswerComment
score: 0

http://stackoverflow.com/a/29736490
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29735574
has body: You can just add some padding to your div's : #top, #middle, #bottom{height:500px;border-top:1px solid; padding-top: 30px}

http://stackoverflow.com/a/29847201
answers question: http://stackoverflow.com/q/29841854
score: 2
has body: There are few problems with the code you have there: where the callbacks got called. where res.redirect() got call. the for loop. save() is asynchronous. Regular for loop will just continue without waiting for all save() calls to finish. That's why destinationsArray is empty. As you said, you cannot use async.eachSeries() since you're iterating through numeric property. However, you're on the right track there. Async.whilst() does just that. Here is the revised code with Async.whilst() and proper calling locations of the callbacks: async.waterfall([ function(callback){ var itemLength = req.body.itemLength; var itemProp,itemComponent; var destination; var destinationsArray =[]; var k = 1; // 1st part of for loop: for(k=1; k&lt;=itemLength; k++) async.whilst( function() { return k &lt;= itemLength; // 2nd part of for loop: for(k=1; k&lt;=itemLength; k++) }, function(whilstCb) { destination = new Destination({ name: req.body['destinationName'+k] }); itemComponent = { "itemCompProp" : req.body['itemCompProp'+k] }; itemProp = new ItemProp({ itemComponent: itemComponent }); itemProp.save(function(err,itemPropSaved){ destination.newProperty = itemPropSaved._id destination.save(function(err,destinationSaved){ if(err){ console.log("Error== " + err); } else { destinationsArray.push(destinationSaved._id); } k++; // 3rd part of for loop: for(k=1; k&lt;=itemLength; k++) whilstCb(null); }); }); }, function(err) { // It gets here once the loop is done console.log(destinationsArray); // This array should have all the values pushed callback(null, destinationsArray); } ); }, function(destinationsArray,callback){ var brand = new Brand({ name : req.body.brandName }); brand.save(function(err,brandSaved){ if(err){ console.log("Error== " + err); } else { console.log('Brand Saved'); } callback(null); }); } ], function (err, status) { if(err){ req.flash('error', { msg: 'Error Saving Brands' }); console.log("Error : " + err); } else { console.log("Brand Saved."); req.flash('success', { msg: …
downvote count: 0
has comment: http://stackoverflow.com/comment/47826820
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29841854
type: Answer

http://stackoverflow.com/q/29843220
type: AnsweredQuestion
has title: requirejs module containing modules
has answer: http://stackoverflow.com/a/29980223
type: Question
possible better answer: http://stackoverflow.com/a/29843367
has answer: http://stackoverflow.com/a/29843367
tagged with: javascript
has answer: http://stackoverflow.com/a/29845521
score: 0
accepted answer: http://stackoverflow.com/a/29980223
has comment: http://stackoverflow.com/comment/47812748
answer count: 4
has comment: http://stackoverflow.com/comment/47812667
has answer: http://stackoverflow.com/a/29843384
tagged with: requirejs
has body: I have a library which internally uses AMD modules (requirejs). I want to return some methods from those modules as a public API. At the moment i'm using a sychronous require call to do this. eg: // library define("a", function(){ define("b", ['somedep','anotherdep'], function(dep, dep2){ return { something: "x"}; }); return { b: require('b').something }; }); // then to use it. require(['a'], function(a){ }); However this gives the error. Error: Module name "b" has not been loaded yet for context: _. Use require([]) I don't want to expose the internal define calls externally (by flattening out all the defines) since i don't want library consumers to be able to use those internal modules.
has comment: http://stackoverflow.com/comment/47812763

http://stackoverflow.com/q/29712614
score: 0
possible better answer: http://stackoverflow.com/a/29712674
answer count: 2
has comment: http://stackoverflow.com/comment/47560848
has body: im confused with window['Map']. im using window['Map'] on leaflet maps to show layer, and it works fine. script below : layerUrl = 'http://service-tms.local-server.link/?token='+token+'&amp;z={z}&amp;x={x}&amp;y={y}'; window['Map' + 'test'] = L.tileLayer(layerUrl, {opacity: 0.8}); My question is .. : in http://www.w3schools.com/jsref/obj_window.asp, i dont find 'Map' as window object properties. Why? Whether 'Map' is not part of window object? Where i find reference about window['Map'] ..?
upvote count: 1
has answer: http://stackoverflow.com/a/29712639
has answer: http://stackoverflow.com/a/29712674
accepted answer: http://stackoverflow.com/a/29712639
downvote count: 1
tagged with: javascript
favorite count: 0
tagged with: dictionary
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47560730
has comment: http://stackoverflow.com/comment/47560701
has comment: http://stackoverflow.com/comment/47560997
type: Question
has title: whats mean window['Map'] in Javascript
tagged with: leaflet
has comment: http://stackoverflow.com/comment/47560844

http://stackoverflow.com/comment/47684618
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29775768
type: AnswerComment
has text: @EsseTi yes you can use $scope.$on instead. It's cleaner that way too. Good catch.

http://stackoverflow.com/comment/47564825
comment on: http://stackoverflow.com/q/29714598
has text: Have you required the `dojo/query` module? Try to store a single node in the `connectId` i.e `query('.list-container')[0]`. Also change the selector to a string i.e `selector:'.list-container-item'`
type: Comment
score: 1
type: QuestionComment

typeahead.js
tags question: http://stackoverflow.com/q/29737777
tags question: http://stackoverflow.com/q/29789767
tags question: http://stackoverflow.com/q/29747791
tags question: http://stackoverflow.com/q/29774195
tag name: typeahead.js
type: Tag

http://stackoverflow.com/comment/47786906
comment on: http://stackoverflow.com/q/29829023
has text: mdn [map](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29713121
has comment: http://stackoverflow.com/comment/47561588
type: Answer
upvote count: 1
score: 1
has body: One approach that comes to my mind is to pre-populate arrays with the valid css values, and then search - var validValues = { 'textAlign': ['left', 'right', 'center', 'justify', 'start'] }; var userSpecifiedCSSValue = documet.getElementById('foo').style.textAlign.toLower(); if (validValues.textAlign.indexOf(userSpecifiedCSSValue) &gt; -1) { // valid } Note: indexOf is not available for IE &lt;= 8. If you want to make it generic - var userStyle = document.getElementById('foo').style, userSpecifiedValue, allowedCSSValues; for (cssProperty in userStyle) { if (userStyle.hasOwnProperty(cssProperty) &amp;&amp; validValues.hasOwnProperty(cssProperty)) { userSpecifiedValue = userStyle[cssProperty].toLower(); allowedCSSValues = validValues[cssProperty] if (allowedCSSValues.indexOf(userSpecifiedValue) &gt; -1) { // valid } else { // invalid } } } If you also want to include browser-specific validation, then you can create list of valid values based on the browser type. Just create another layer in your object - var validValues = { 'chrome': { 'textAlign': []// arrays with values } } However to me this still seems like a hacky solution.
downvote count: 0
has comment: http://stackoverflow.com/comment/47561461
has comment: http://stackoverflow.com/comment/47561595
answers question: http://stackoverflow.com/q/29713037

http://stackoverflow.com/q/29839752
has answer: http://stackoverflow.com/a/29839822
type: Question
has body: I'm sending some information via AJAX to a PHP-Script to get some text, which should be displayed. So far there is no problem. But if the user is logged out, the result would be false and a modal with a login-form is shown. If the user gets logged in, the first information (var data) should be send one more time, as the first sending wasn't accepted. $.ajax({ url: "script.php", type: "POST", data: data, dataType: "json" }) .done(function( json ) { if (json.result === false) { showModal("login"); return; } else { $('#result').html(json.result); } }); The showModal function is also connected to an ajax request, so the user is getting logged in... After that the first data should be send one more time... function showModal() { $('body').append('&lt;form&gt;...'); // Show Modal with form to login } // With submit form, the user will be logged in $('body').on('submit','#loginform',function(event){ $.ajax({ url: "login.php", type: "POST", data: { 'username': username, 'password': password }, dataType: "json" }) .done(function( json ) { // User is now logged in // Now repeat first request }); });
tagged with: javascript
answer count: 2
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/47806423
possible better answer: http://stackoverflow.com/a/29840827
favorite count: 0
has title: Repeating an AJAX request after login
upvote count: 6
accepted answer: http://stackoverflow.com/a/29839822
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47805850
score: 6
has comment: http://stackoverflow.com/comment/47805782
has answer: http://stackoverflow.com/a/29840827

http://stackoverflow.com/a/29806492
downvote count: 0
has comment: http://stackoverflow.com/comment/47741223
type: AcceptedAnswer
upvote count: 3
type: Answer
answers question: http://stackoverflow.com/q/29806404
accepted answer of: http://stackoverflow.com/q/29806404
has comment: http://stackoverflow.com/comment/47741156
has body: You want types to be its own function, then you can just pass in the object to the Troop constructor. function types(a, b, c, d) { this.a= a; this.b= b; this.c= c; this.d= d; } function Troop(rss, time, offense, defense){ this.rss= rss; this.time= time; this.offense= offense; this.defense= defense; } Dwarf = new Troop(1,2,3, new types(11,22,33,44)); // these lines are right alert(Dwarf.defense.a) // it's the function definition that was wrong :) In general I would capitalize the class names like Types, and keep the variables like dwarf lower-case, but that's more just a question of style, not functionality.
score: 3

http://stackoverflow.com/a/29836240
type: Answer
has body: Calculate a random number from 0 to 100. Then loop through the players adding their probability to a total, until the total is higher than the random number: var activeGame = { id: 12324, type: 1, active: true, players: [{ id: 5032, name: "Joe", foo: true, winProbability: 56.32 //% }, { id: 98243, name: "Jane", foo: true, winProbability: 22.68 //% }, { id: 10943, name: "Fred", foo: false, winProbability: 21.00 //% }], }; function pickPlayer() { var randPct = Math.random() * 100; var total = 0; var players = activeGame.players; var selectedPlayer; for (var i = 0; i < players.length; i++) { total += players[i].winProbability; if (randPct < total) { selectedPlayer = players[i]; break; } } return selectedPlayer; } var results = document.getElementById("results"); var resultObj = {}; for (var i = 0; i < 1000; i++) { var playerName = pickPlayer().name; if (resultObj[playerName]) { resultObj[playerName] ++; } else { resultObj[playerName] = 1; } } for (name in resultObj) { results.innerHTML += " " + name + " " + resultObj[name] + " "; } Results of picking 1000 players: Name Count
score: 4
answers question: http://stackoverflow.com/q/29836122
upvote count: 4
accepted answer of: http://stackoverflow.com/q/29836122
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/88077410
score: 2
has text: Thanks Aikeru. Ah ok so you are saying if you declare the foo method as an arrow function on the class itself, then reference it using the this context then its only created once instead of declaring it inside the onClick where its creating the same function every time you click the button. Is that correct in my thinking.
type: AnswerComment
comment on: http://stackoverflow.com/a/35748912
type: Comment

http://stackoverflow.com/comment/47552238
comment on: http://stackoverflow.com/q/29708181
score: 0
type: QuestionComment
type: Comment
has text: It is most likely because this.options is never set. Although you define default options, you never assign them in case argument[0] is not an object. So maybe add after line 18: `else{ this.options = defaults; }`

http://stackoverflow.com/q/29742209
has comment: http://stackoverflow.com/comment/47617618
tagged with: unique
has answer: http://stackoverflow.com/a/29767133
type: AnsweredQuestion
has body: I am using Data Tables and want to show only unique data for a column day. This is my table: # Day Count --------------------- 1 Friday 2 2 Friday 2 3 Saturday 4 . . . . . . JS: var myTable = $('.table').DataTable({ "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]], "oLanguage": { "oPaginate": { "sPrevious": "&amp;larr;", // This is the link to the previous page "sNext": "&amp;rarr;", // This is the link to the next page } } }); How can I filter the data to show only unique days data in table ? I know there is unique() function there but thats for only selecting unique column data from the table, instead I need the (by rebuilding may be) table show the column with unique data. Thanks for any help.
accepted answer: http://stackoverflow.com/a/29767133
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47617716
score: 0
has title: Show only unique data for a column - jQuery data tables
tagged with: datatables

http://stackoverflow.com/a/29939812
type: Answer
has body: I found the solutions, not perfect but nearly. Wrong working in Firefox(too small), but right in Chrome: afterLoad: function() { this.content[0].contentDocument.images[0].style = ('width: auto; height: auto;'); this.width = this.content[0].contentDocument.images[0].width; this.height = this.content[0].contentDocument.images[0].height; }
answers question: http://stackoverflow.com/q/29787533
score: 0

http://stackoverflow.com/a/29770604
has comment: http://stackoverflow.com/comment/47698035
has body: If JavaScript generators just detected expression statements yielding promises and automatically yielded that, it would be awesome. It would be terrible. Or is there some other way to avoid explicitly yielding on every single line but still get exceptions to be caught? Not really. But for your use case I would recommed to use an asynchronous helper function to decrease the number of yields to use: var paragraph = q.async(function*(lines) { for (let line of lines) yield tw.type(...line); yield tw.breakLine(); }); q.spawn(function*() { tw.clear(); yield paragraph([ [{d:100}, "August 3, 9:47 AM", {w:500}], ["District Court"], ["Defendant Lobby No. 2", {w:2000}] ]); yield paragraph([ [{who:"Phoenix"}, {dh:true}, {d:30}, "(Boy am I nervous!)", {w:1500}] ]); throw new Error("BOOM!"); yield paragraph([ [{who:"Mia"}, {dh:true}, {d:40}, "Wright!", {w:1250}], [{di:true}, {d:50}, "Did you", {w:1000}, {d:0}, " ", {d:30}, "turn off the lights?", {w:1000}], [{di:true}, {d:400}, ". . .", {w:1000}], [{di:true}, {d:40}, "I can't see a thing!", {w:1000}] ]); process.exit(); });
has comment: http://stackoverflow.com/comment/47699536
type: Answer
has comment: http://stackoverflow.com/comment/47696921
has comment: http://stackoverflow.com/comment/47699646
score: 0
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29767548
downvote count: 1
answers question: http://stackoverflow.com/q/29767548
has comment: http://stackoverflow.com/comment/47698540
type: AcceptedAnswer

http://stackoverflow.com/q/29776085
has answer: http://stackoverflow.com/a/29776174
score: 1
linked to: http://stackoverflow.com/q/24588708
tagged with: data-binding
duplicate of: http://stackoverflow.com/q/24588708
upvote count: 1
has body: In Short: In Polymer, I can't make this.$[id] work to query elements which have been dynamically generated, while this.shadowRoot.querySelector("#"+id) does the job without any problem. Why? In Details What I have: A published array elements Another array modifiedElements which contains data based on the first one HTML blocks generated by repeat over the 2nd array What I want: Update modifiedElements whenever elements is changed (✓) Update the HTML accordingly (✓) Query the new blocks (for some interactions) (not quite ✓) My Polymer elements: {{devices.name}} {{el.info}} ... and its script: Polymer('my-element', { ready: function() { this.modifiedElements = []; this.modifyElements(); }, elementsChanged: function() { this.modifyElements(); }, modifyElements: function() { for (var e in this.elements) { el = this.elements[e]; // ... do stuff on el ... this.modifiedElements.push(el); } }, toggle: function(event, detail, sender) { // This works: this.shadowRoot.querySelector("#"+sender.attributes['target'].value).toggle(); // This doesn't (not found): this.$[sender.attributes['target'].value].toggle(); } }) Any idea why the second method doesn't work in toggle? Should I somehow update this.$, or is there a better way to do the whole thing?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29776174
type: Question
tagged with: polymer
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: shadow-dom
tagged with: web-component
has title: Polymer - this.$[id] not working for dynamically-generated elements

http://stackoverflow.com/comment/47675203
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29767801
has text: No, it doesn't solved( I don't understand, how to get link with active class and put it to the first position on select. And most of all I don't understand how not to double this link in select then
score: 0

http://stackoverflow.com/q/29830584
tagged with: javascript
has answer: http://stackoverflow.com/a/29831288
answer count: 3
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/29830634
has answer: http://stackoverflow.com/a/29830711
linked to: http://stackoverflow.com/q/9267451
type: AnsweredQuestion
upvote count: 3
has title: Run a function if a ajax get/post is fired
linked to: http://stackoverflow.com/q/9515704
has body: As my title indicates, I need to run a function if any ajax get/post is fired. I tried using $(document).ajaxStart(function () { console.log('a'); }); $(document).ajaxComplete(function () { console.log('c'); }); but it runs only for the first time. Later it does not log anything. What am I doing wrong? I need to do this in chrome extension and on google image search page, so after 100 images it fire a ajax function to get more image data and show on page.
type: Question
accepted answer: http://stackoverflow.com/a/29831288
score: 3
possible better answer: http://stackoverflow.com/a/29830634

http://stackoverflow.com/a/29827559
has comment: http://stackoverflow.com/comment/47783374
answers question: http://stackoverflow.com/q/29819382
has comment: http://stackoverflow.com/comment/47786540
score: 0
has comment: http://stackoverflow.com/comment/47781870
type: Answer
has body: The docs at Mozilla say the value must be positive.

http://stackoverflow.com/comment/47713610
comment on: http://stackoverflow.com/q/29792437
type: Comment
type: QuestionComment
has text: Btw I tried to remove all the injections from home.js so that the code is pretty much the same as notifications.js but even then the problem still occurs.
score: 0

http://stackoverflow.com/comment/47752836
has text: No disrespect intended, but... Manual JavaScript DFS vs. direct C API of `getElementById`... I wouldn't call it an alternative. This is only useful as an educational exercise, I would never use this in production. (It's not even a proper DFS, it's limited to searching for the ID on the second level, so it is not even as general as `getElementById`.)
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29812373
type: AnswerComment

http://stackoverflow.com/a/29715431
score: 0
answers question: http://stackoverflow.com/q/29715222
type: Answer
has body: You can try this : var dt = new Date('2014/03/05'); And you do this to format your date Ext.Date.format(dt,'d-m-Y'); or whatever format you want. :)

http://stackoverflow.com/a/29722904
answers question: http://stackoverflow.com/q/29716165
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2
has body: The solution that I will finally adopt is using these custom filters: (function () { function isNullOrEmpty(str) { return str === '' || str === undefined || str === null; } angular.module('CustomFilters', []) .filter('okOrderBy', ['$filter', function ($filter) { return function (array, predicate, reverse) { if (isNullOrEmpty(predicate)) return array; return $filter('orderBy')(array, predicate, reverse); }; } ]) .filter('arrayOrderBy', [function () { function Comparator(predicate, reverse) { return reverse ? function (a, b) { a = a[predicate]; b = b[predicate]; if (a === b) return 0; return a &lt; b ? 1 : -1; } : function (a, b) { a = a[predicate]; b = b[predicate]; if (a === b) return 0; return a &lt; b ? -1 : 1; }; } return function (array, predicate, reverse) { if (isNullOrEmpty(predicate)) return array; return array.slice(0).sort(new Comparator(predicate, reverse)); }; } ]); })(); The second one is independent of Angular filters and I like it more. But it works only for arrays of objects, with predicates that are property names only, and does not allow "multiple column" sorts. While the first should work for everything (I guess). I had a great dilemma on which answer I should accept because all other answers were helpful and interesting. I wish I could vote them more than once out of appreciation. I am thinking of choosing this answer (I know... I am selfish...) just because it solves the problem and it is shorter to use than the one provided by user "YOU".
has comment: http://stackoverflow.com/comment/47585206
accepted answer of: http://stackoverflow.com/q/29716165

http://stackoverflow.com/comment/47605939
comment on: http://stackoverflow.com/q/29736310
has text: What type is the `verification_areas` variable in the second piece of code in the question? What type is the `internal_verification_areas` attribute in the very first piece of code in the question? Please answer both.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47609898
type: Comment
score: 0
has text: You can change its innerHTML. That'll change all of the elements inside of it. `someForm.innerHTML = someMarkup`. You can also 'empty' it's content with innerHTML, and append elements to it with appendChild.
type: QuestionComment
comment on: http://stackoverflow.com/q/29738046

http://stackoverflow.com/a/67757663
has comment: http://stackoverflow.com/comment/119789070
has body: Try this, import React from 'react'; import {useState} from 'react'; import TextField from '@material-ui/core/TextField'; const Input = () => { const [textInput, setTextInput] = useState(''); const handleTextInputChange = event => { setTextInput(event.target.value); }; return( <TextField label="Text Input" value= {textInput} onChange= {handleTextInputChange} /> ); } export default Input; Explanation if the above code was not clear. First we create a state to store the text input called textInput and assign it the value ''. Then we return a material UI <TextField /> component whose value attribute is set to the textInput state. Doing this we display the current value of the textInput in the <TextField />. Any changes to the value of textInput will change the value attribute of the <TextField />, courtesy of React. Then we use the onChange attribute of <TextField /> to run a handler function every time the value of the <TextField /> value attribute changes. This handler function is an arrow function stored in the constant handleTextInputChange. It takes an event as an argument. When the onChange attribute runs the handler function, it sends the event as an argument to the handler function. The value of the <TextField /> is stored in event.target.value. We then use the setTextInput method of the state to set the state to the value attribute of the <TextField />. Thus this change is reflected in the <TextField /> whose value attribute is the value of the textInput state. Thus the data input into the <TextField /> is stored in the state textInput, ready to be used when required.
type: Answer
upvote count: 15
answers question: http://stackoverflow.com/q/29791721
has comment: http://stackoverflow.com/comment/119766021
downvote count: 0
has comment: http://stackoverflow.com/comment/127973570
score: 15

http://stackoverflow.com/comment/47554779
score: 0
type: AnswerComment
has text: Can you check to make sure? Also can you tell me where UpdateNoteStatus is located? Consider that you can use `/` as the root, you dont have to use `..`
type: Comment
comment on: http://stackoverflow.com/a/29704421

http://stackoverflow.com/comment/47629011
type: QuestionComment
comment on: http://stackoverflow.com/q/29747933
score: 0
has text: yes it does. But eventController, in event.js doesnt trigger at all. It throws the generic `Argument 'eventController' is not a function, got undefined` error
type: Comment

http://stackoverflow.com/comment/47600237
comment on: http://stackoverflow.com/q/29731653
has text: I have a script I want to run with PhantomJS, but I want to break it into modules and join it back together into one script with Browserify. Unfortunately, I have no way to tell Browserify which imports it should try to read and which are provided by PhantomJS.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29760614
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29760824
accepted answer: http://stackoverflow.com/a/29760824
answer count: 1
tagged with: asynchronous
favorite count: 0
has body: I been playing along with Node.JS and I found this great async library https://github.com/caolan/async. I want to replace the traditional callback model with this, as it looks a bit more pleasing and easier to understand. This is my code for sql query function query_mssql(config, sql_string){ var connection = new sql.Connection(config, function(err) { // ... error checks if (err) { console.log('connection to mssql has failed'); //throw err; }else{ // Query var request = new sql.Request(connection); // or: var request = connection.request(); request.query(sql_string, function(err, recordset) { // ... error checks should go here : // output query result to console: console.log(recordset); return recordset; }); } }); } I am wondering how to make this async, like the example given in the library. async.series([ function(callback){ // do some stuff ... callback(null, 'one'); }, function(callback){ // do some more stuff ... callback(null, 'two'); } ], // optional callback function(err, results){ // results is now equal to ['one', 'two'] }); Can someone help me with this? I don't quite understand how the error reporting works. Based on Chris's comment, how exactly will the waterfall method help if called in multi layered? function computeCurrentDefinitionResult(database, node_name) { async.waterfall([ function(callback) { var leaf_sql_query = "SELECT * FROM "+ JSON.stringify(database) +".dbo.LeafNode WHERE NodeName=" + "'" + node_name + "'"; query_mssql_internal(leaf_sql_query, callback); console.log('Might BE HAPPY'); }, ], function(err, recordset) { // ... error checks should go here : if (err) { console.log('mssql query has failed'); } // output query result to console: console.log(recordset); return recordset; }); function query_mssql_internal(sql_string){ return query_mssql(config, sql_string); } the "query_mssql()" call your function. How do pass on result back to top calling function or the error back?
has title: Nodejs SQL connections and async module
upvote count: 1
tagged with: node.js
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/47667553
comment on: http://stackoverflow.com/q/29765650
type: QuestionComment
has text: http://stackoverflow.com/questions/23803743/what-is-the-deferred-antipattern-and-how-do-i-avoid-it
type: Comment
score: 0

alert
tags question: http://stackoverflow.com/q/29798856
type: Tag
tags question: http://stackoverflow.com/q/29827533
tag name: alert
tags question: http://stackoverflow.com/q/29696727
tags question: http://stackoverflow.com/q/29826519

http://stackoverflow.com/q/29844904
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/588004
has title: Getting different output from loop
favorite count: 0
has answer: http://stackoverflow.com/a/29844983
answer count: 1
accepted answer: http://stackoverflow.com/a/29844983
upvote count: 1
has body: I am learning Javascript and not getting my desired output. I will be helpful if you can correct my thinking. This is my simple code: &lt;script&gt; window.onload = myFunction ; function myFunction(){ var i = 0 ; var counter = 1 ; while(i &lt; counter){ alert(counter); counter = counter - 0.1 ; } } &lt;/script&gt; My desired output: 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 But real output: 1 0.9 0.8 0.7000000000000001 0.6000000000000001 0.5000000000000001 0.40000000000000013 0.30000000000000016 0.20000000000000015 0.10000000000000014 1.3877787807814457e-16
type: AnsweredQuestion
score: 1
type: Question
has comment: http://stackoverflow.com/comment/47815741

http://stackoverflow.com/comment/47711789
has text: $('input#check-word').HTML("")
comment on: http://stackoverflow.com/a/29737346
type: Comment
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47717457
type: QuestionComment
score: 0
has text: Have a look at https://api.jquery.com/event.type/
comment on: http://stackoverflow.com/q/29794552
type: Comment

http://stackoverflow.com/a/29786119
has comment: http://stackoverflow.com/comment/47702630
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29785132
type: Answer
has comment: http://stackoverflow.com/comment/47702442
has comment: http://stackoverflow.com/comment/47702743
score: 3
has comment: http://stackoverflow.com/comment/47702484
has comment: http://stackoverflow.com/comment/47702597
upvote count: 3
has comment: http://stackoverflow.com/comment/47702564
accepted answer of: http://stackoverflow.com/q/29785132
has body: Issues: strlen does not count Unicode characters as expected. ord not work with unicode as expected. chr not work with unicode as expected. Problem with strlen '㬁愃膘ƘჀ䚐⦀飠噋&amp;ӡ๨㏃棱쌌ص䌠'.length returns 17 and strlen('㬁愃膘ƘჀ䚐⦀飠噋&amp;ӡ๨㏃棱쌌ص䌠') returns 46, for fix it, use: $j = preg_match_all('/.{1}/us', $string, $data); Problem with ord Using '㬁'.charCodeAt(0) returns 15105 and ord('㬁') returns 227, for fix use: function unicode_ord($char) { list(, $ord) = unpack('N', mb_convert_encoding($char, 'UCS-4BE', 'UTF-8')); return $ord; } Source: https://stackoverflow.com/a/10333307/1518921 Problem with chr Using String.fromCharCode(15104) returns 㬁 and chr(15104) return empty/blank, for fix use: function unicode_chr($u) { return mb_convert_encoding('&amp;#' . intval($u) . ';', 'UTF-8', 'HTML-ENTITIES'); } Source: https://stackoverflow.com/a/9878531/1518921 Full code: &lt;?php function unicode_ord($char) { list(, $ord) = unpack('N', mb_convert_encoding($char, 'UCS-4BE', 'UTF-8')); return $ord; } function unicode_chr($u) { return mb_convert_encoding('&amp;#' . intval($u) . ';', 'UTF-8', 'HTML-ENTITIES'); } function bytesToWords($bytes) { $str = ''; $j = count($bytes); for($i = 0; $i &lt; $j; $i += 2) { $char = $bytes[$i] &lt;&lt; 8; if ($bytes[$i + 1]) { $char |= $bytes[$i + 1]; } $str .= unicode_chr($char); } return $str; } function bytesFromWords($string) { $bytes = array(); $j = preg_match_all('/.{1}/us', $string, $data); $data = $data[0]; foreach ($data as $char) { $char = unicode_ord($char); $bytes[] = $char &gt;&gt; 8; $bytes[] = $char &amp; 0xFF; } return $bytes; } $data = bytesFromWords('㬁愃膘ƘჀ䚐⦀飠噋&amp;ӡ๨㏃棱쌌ص䌠'); echo implode(', ', $data), '&lt;br&gt;'; echo bytesToWords($data);

http://stackoverflow.com/a/29829047
has comment: http://stackoverflow.com/comment/47823995
type: Answer
answers question: http://stackoverflow.com/q/29827058
has body: Why don't you use data-confirm? &lt;%=link_to 'Delete', url, date: {confirm: 'Are you sure?'} %&gt; This is in Rails default installation by default. Then you can do your server stuff after they confirm they want to delete the object.
score: 0

http://stackoverflow.com/comment/47960011
type: QuestionComment
comment on: http://stackoverflow.com/q/29709320
has text: possible duplicate of [.playVideo() - not a function?](http://stackoverflow.com/questions/2217543/cant-control-youtube-embed-even-with-document-getelementbyidxyz-playvideo) or [playVideo doesn't work](http://stackoverflow.com/questions/9287170/youtube-player-iframe-api-playvideo-doesnt-work-on-firefox-9-0-1)
score: 0
type: Comment

http://stackoverflow.com/comment/76576078
type: Comment
has text: Well, this is very good, this functionality will be achieved in my next project in sha Allah. Thanks, @Syed.
comment on: http://stackoverflow.com/a/44775491
score: 0
type: AnswerComment

http://stackoverflow.com/comment/90365657
type: Comment
score: 1
has text: Note that srcElement is not available in Firefox.
type: AnswerComment
comment on: http://stackoverflow.com/a/29726000

http://stackoverflow.com/a/29698759
type: Answer
has body: Use jquery-form-builder-plugin Its a nice example to create control and drag drop .. also you can create modification after draggin a control.. Sample link
answers question: http://stackoverflow.com/q/29695004
score: 0

http://stackoverflow.com/q/29797245
has comment: http://stackoverflow.com/comment/47724914
has comment: http://stackoverflow.com/comment/47724090
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29797362
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/7958292
has answer: http://stackoverflow.com/a/29798470
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Pop up alert messages in Javascript
has comment: http://stackoverflow.com/comment/47723804
type: UnansweredQuestion
has body: My code should pop up an alert if radio button is not selected. My problem is that it only pops up if you have choosen one question. For example, i selected an answer in question 1 but not on question 2. So it gives an alert: Must select question number two! But my problem is that, if you don't select any, it doesn't alert me anything. If i haven't selected anything, it should pop up, 2 alerts, Must select question number one and after that, another alert, must select question number 2! any help would be appreciated, thanks! QUESTIONS Question No. 1.) What makes you smile? A. Burger B. Pizza C.Sunrise D. Kitkat Question No. 2.) What's your favorite day? A. Hi B. Hello C. Ahh D. Kitkat

http://stackoverflow.com/comment/47586712
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29726391
has text: also, http is a lot better for broadcasting media than sockets, at least at this point...

http://stackoverflow.com/a/29721373
has comment: http://stackoverflow.com/comment/47938512
has comment: http://stackoverflow.com/comment/47936389
has comment: http://stackoverflow.com/comment/48035247
has comment: http://stackoverflow.com/comment/48033481
has comment: http://stackoverflow.com/comment/47940903
has comment: http://stackoverflow.com/comment/48124931
has comment: http://stackoverflow.com/comment/47699120
type: Answer
has comment: http://stackoverflow.com/comment/48033829
has comment: http://stackoverflow.com/comment/122720063
has comment: http://stackoverflow.com/comment/48034249
has comment: http://stackoverflow.com/comment/48114236
downvote count: 0
has comment: http://stackoverflow.com/comment/47750766
has comment: http://stackoverflow.com/comment/47982186
has body: You could use window.onfocus and window.onblur for this instead of that wall of code. It is supported by all the main browsers and works perfectly fine for the purpose you want. It detects when you change tabs, for example, or open another application as you said. Example: window.onfocus = function() { console.log('Focused'); }; window.onblur = function() { console.log('Not focused'); };
has comment: http://stackoverflow.com/comment/48115075
has comment: http://stackoverflow.com/comment/48033748
answers question: http://stackoverflow.com/q/29720294
has comment: http://stackoverflow.com/comment/48034423
has comment: http://stackoverflow.com/comment/47938855
score: 1
has comment: http://stackoverflow.com/comment/47578101
has comment: http://stackoverflow.com/comment/47697164
accepted answer of: http://stackoverflow.com/q/29720294
has comment: http://stackoverflow.com/comment/47577865
has comment: http://stackoverflow.com/comment/47578707
has comment: http://stackoverflow.com/comment/47986472
has comment: http://stackoverflow.com/comment/47577557
upvote count: 1
has comment: http://stackoverflow.com/comment/47939228
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48035005
has comment: http://stackoverflow.com/comment/47939126
has comment: http://stackoverflow.com/comment/48033968

http://stackoverflow.com/a/29845982
accepted answer of: http://stackoverflow.com/q/29744355
upvote count: 1
answers question: http://stackoverflow.com/q/29744355
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: If you have zero values outside the range where your data has non-zero values the graph will connect those (valid) datapoints with diagonal lines. If you want to end the graph at a specific point change the values after that point to null. This is described in the documentation: If a null is specified as a point or if one of the coordinates is null or couldn't be converted to a number, the point is ignored when drawing. As a special case, a null value for lines is interpreted as a line segment end, i.e. the points before and after the null value are not connected.
score: 1

http://stackoverflow.com/q/29766626
tagged with: validation
favorite count: 0
accepted answer: http://stackoverflow.com/a/29766705
has answer: http://stackoverflow.com/a/29768067
tagged with: php
has comment: http://stackoverflow.com/comment/47664617
upvote count: 6
answer count: 4
type: AnsweredQuestion
has title: Is it safe that everybody can see my JavaScript validation functions?
has body: In my signup page, I do validation using both JavaScript and PHP. However, people can see my JavaScript validation functions by viewing the source of the web page. It contains input fields names, ids etc. So, is it safe that anybody can see them ?
has comment: http://stackoverflow.com/comment/47664597
has answer: http://stackoverflow.com/a/29766748
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29766759
has answer: http://stackoverflow.com/a/29766705
possible better answer: http://stackoverflow.com/a/29766748
tagged with: javascript
tagged with: security
score: 5
has comment: http://stackoverflow.com/comment/47664468

ruby-on-rails-4
type: Tag
tags question: http://stackoverflow.com/q/29801739
tags question: http://stackoverflow.com/q/29842798
tags question: http://stackoverflow.com/q/29724885
tags question: http://stackoverflow.com/q/29775484
tag name: ruby-on-rails-4
tags question: http://stackoverflow.com/q/29768119
tags question: http://stackoverflow.com/q/29712189

http://stackoverflow.com/q/29776797
has answer: http://stackoverflow.com/a/29777100
downvote count: 1
has comment: http://stackoverflow.com/comment/47684088
accepted answer: http://stackoverflow.com/a/29777167
has comment: http://stackoverflow.com/comment/47684185
has answer: http://stackoverflow.com/a/29777159
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47683915
upvote count: 0
has title: How to parse a string into an array
tagged with: javascript
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/47684738
has comment: http://stackoverflow.com/comment/47684803
has answer: http://stackoverflow.com/a/29777167
score: -1
has body: If a have a string in this format: $parsethis = 'string[1][2]'; How do I parse it so my result is an array like: $parsed = ['string', 1 , 2]
possible better answer: http://stackoverflow.com/a/29777100
answer count: 3

http://stackoverflow.com/comment/47705256
type: Comment
comment on: http://stackoverflow.com/a/29786628
has text: yes. its a server side script. as long as it is installed on the server it will work on all bowsers.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47761663
has text: @FerdinandBalbin Using like `item[][name]` will not fetch the value from `item[][name]` and assign it to input name field. Rather your input filed name will be set to `item[][name]`. Are you trying to loop the array and assign it's values as name of input field ?
comment on: http://stackoverflow.com/q/29817196
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/47692989
type: Comment
comment on: http://stackoverflow.com/a/29766118
score: 0
type: AnswerComment
has text: Unfortunately none of this helped :(

http://stackoverflow.com/q/29817796
tagged with: webmethod
has body: Im trying to stringify a javascript object and then pass the string as a parameter to a WebMethod in Code Behind. I can't get it to work as I get a Internal Server Error of 500 and the stacktrace says that value is missing for parameter. Here is the javascript code: var jSon = JSON.stringify(javascriptObject); // "{"Foretagsnamn":"Avector","BGFarg":"000000","TextColor":"fafafa","FooterFarg":"ffffff","FooterColor":"000000","FooterLinkColor":"050505","FeaturedBorderColor":"","HoverFarg":"12ebeb","RutFarg":"0d0d0d","SelectedRutFarg":"","RutColor":"FFFFFF","LankColor":"","DelaMedSig":"1","PersonalSida":"0","StartpageTitle":"","StartpageDescription":"","GoogleMaps":"&lt;iframe width=\"425\" height=\"350\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src=\"https://maps.google.se/maps?f=q&amp;amp;source=embed&amp;amp;hl=sv&amp;amp;geocode=&amp;amp;q=Avector AB&amp;amp;aq=&amp;amp;sll=56.225986,12.870827&amp;amp;sspn=0.076248,0.154324&amp;amp;ie=UTF8&amp;amp;hq=Avector AB&amp;amp;hnear=&amp;amp;t=m&amp;amp;cid=645910733081021950&amp;amp;iwloc=A&amp;amp;ll=56.224594,12.859229&amp;amp;spn=0,0&amp;amp;output=embed\"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;small&gt;&lt;a href=\"https://maps.google.se/maps?f=q&amp;amp;source=embed&amp;amp;hl=sv&amp;amp;geocode=&amp;amp;q=Avector AB&amp;amp;aq=&amp;amp;sll=56.225986,12.870827&amp;amp;sspn=0.076248,0.154324&amp;amp;ie=UTF8&amp;amp;hq=Avector AB&amp;amp;hnear=&amp;amp;t=m&amp;amp;cid=645910733081021950&amp;amp;iwloc=A&amp;amp;ll=56.224594,12.859229&amp;amp;spn=0,0\" style=\"text-align:left\"&gt;Visa större karta&lt;/a&gt;&lt;/small&gt;","HittaKartaUrl":"http://www.hitta.se/avector ab/ängelholm/hxTP-4v1HG?vad=Avector AB","EniroKartaUrl":"http://kartor.eniro.se/m/aKkhi","Ikoner":"2","Email":"info@avector.com","AdressSida":"1","shadowColor":"ffffff","lineColor":"2b292b","MenuHoverIcon":"Välj bild från server","fontFamily":"Verdana","supportText":"Support Avector","captcha":true,"metaKeywords":"","ShowSupportInFoot…
upvote count: 7
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/29829468
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/8946695
has title: How to pass json string to webmethod c# ASP.NET
downvote count: 0
has comment: http://stackoverflow.com/comment/47762502
accepted answer: http://stackoverflow.com/a/29829468
score: 7
has comment: http://stackoverflow.com/comment/47763119
tagged with: asp.net
favorite count: 0
type: Question
possible better answer: http://stackoverflow.com/a/29818038
answer count: 2
has answer: http://stackoverflow.com/a/29818038
has comment: http://stackoverflow.com/comment/47762925
has comment: http://stackoverflow.com/comment/47762773
has comment: http://stackoverflow.com/comment/47762594

http://stackoverflow.com/q/29770874
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has title: NgImgCrop net::ERR_INVALID_URL but valid URI
type: Question
has body: I'm using this plugin : https://github.com/alexk111/ngImgCrop After a crop, I upload my image as a base64 URI image in my database. (I know it's not the best way to do it, but it's the easiest, I already tried to save only the path, but it involves to much other functions) Then I want to display directly the image from this URI and I get the following error : jquery.js:4380 GET data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAgAElEQ…XgEqi9EedtfVj2wSuh70q2NjrCzAfaJLRsS37CgnNscsuYb+oMZJNRFnx3KnWINRP6GbxzWaFJ net::ERR_INVALID_URL The thing is this URI is valid. When I copy link address and I print it in a webservice base64-image-converter such as http://www.askapache.com/online-tools/base64-image-converter/ it works fine ! Here is my html element before the rendering : &lt;img ng-src="{{myCroppedImage}}" alt="img artiste"&gt; Here is my html element after the rendering : &lt;img ng-src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAgAElEQVR4Xmy915ct6XHlF3n[...]yZB5X7pp2aDQGlgSo4Vrzt5KURDcyJAiSoye98EnzrBE5lDQUNQAIEGhz+9Gpo8sGbxzWaFJ" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAgAElEQVR4Xmy915ct6XHlF3n[...]yZB5X7pp2aDQGlgSo4Vrzt5KURDcyJAiSoye98EnzrBE5lDQUNQAIEGhz+9Gpo8sGbxzWaFJ" alt="img artiste"&gt; Obviously NgImgCrop add the attribut src instead of managing ng-src only, and I think it's the cause of the error, but it's nearly impossible to edit the plugin... Do you have better idea or a piece of code which could show me how to simply crop an image and upload it on server side as a path to the image (I'm using CakePHP by the way).
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29793931
tagged with: image
score: 0

meteor
tags question: http://stackoverflow.com/q/29711849
tags question: http://stackoverflow.com/q/29753641
tags question: http://stackoverflow.com/q/29830648
tags question: http://stackoverflow.com/q/29730045
tags question: http://stackoverflow.com/q/29713648
tags question: http://stackoverflow.com/q/29693249
tags question: http://stackoverflow.com/q/29780298
tags question: http://stackoverflow.com/q/29835752
tags question: http://stackoverflow.com/q/29742993
tags question: http://stackoverflow.com/q/29729876
tags question: http://stackoverflow.com/q/29828673
tags question: http://stackoverflow.com/q/29764311
tags question: http://stackoverflow.com/q/29838183
tags question: http://stackoverflow.com/q/29725845
tags question: http://stackoverflow.com/q/29763173
tags question: http://stackoverflow.com/q/29782509
tags question: http://stackoverflow.com/q/29735997
tags question: http://stackoverflow.com/q/29802947
tags question: http://stackoverflow.com/q/29718038
tags question: http://stackoverflow.com/q/29717605
tags question: http://stackoverflow.com/q/29823674
tags question: http://stackoverflow.com/q/29729993
tags question: http://stackoverflow.com/q/29824288
tags question: http://stackoverflow.com/q/29839755
tags question: http://stackoverflow.com/q/29795428
tags question: http://stackoverflow.com/q/29814250
tags question: http://stackoverflow.com/q/29739516
tags question: http://stackoverflow.com/q/29761749
tags question: http://stackoverflow.com/q/29838726
tags question: http://stackoverflow.com/q/29812914
tags question: http://stackoverflow.com/q/29715471
tags question: http://stackoverflow.com/q/29826519
tags question: http://stackoverflow.com/q/29693785
tags question: http://stackoverflow.com/q/29776273
tags question: http://stackoverflow.com/q/29829444
tags question: http://stackoverflow.com/q/29722721
tags question: http://stackoverflow.com/q/29802779
tags question: http://stackoverflow.com/q/29837048
tags question: http://stackoverflow.com/q/29728161
tags question: http://stackoverflow.com/q/29799392
type: Tag
tags question: http://stackoverflow.com/q/29691074
tags question: http://stackoverflow.com/q/29694909
tags question: http://stackoverflow.com/q/29720211
tags question: http://stackoverflow.com/q/29784668
tags question: http://stackoverflow.com/q/29712261
tags question: http://stackoverflow.com/q/29733397
tags question: http://stackoverflow.com/q/29692261
tags question: http://stackoverflow.com/q/29778919
tags question: http://stackoverflow.com/q/29732915
tags question: http://stackoverflow.com/q/29832371
tags question: http://stackoverflow.com/q/29699959
tags question: http://stackoverflow.com/q/29833481
tags question: http://stackoverflow.com/q/29839317
tags question: http://stackoverflow.com/q/29788763
tags question: http://stackoverflow.com/q/29815409
tags question: http://stackoverflow.com/q/29723827
tags question: http://stackoverflow.com/q/29779952
tags question: http://stackoverflow.com/q/29799634
tags question: http://stackoverflow.com/q/29721027
tags question: http://stackoverflow.com/q/29777824
tags question: http://stackoverflow.com/q/29815310
tags question: http://stackoverflow.com/q/29754736
tags question: http://stackoverflow.com/q/29779561
tags question: http://stackoverflow.com/q/29843042
tags question: http://stackoverflow.com/q/29724650
tags question: http://stackoverflow.com/q/29718660
tags question: http://stackoverflow.com/q/29743680
tags question: http://stackoverflow.com/q/29752824
tags question: http://stackoverflow.com/q/29839734
tags question: http://stackoverflow.com/q/29780299
tags question: http://stackoverflow.com/q/29781327
tags question: http://stackoverflow.com/q/29759597
tag name: meteor
tags question: http://stackoverflow.com/q/29834393
tags question: http://stackoverflow.com/q/29706346
tags question: http://stackoverflow.com/q/29762624
tags question: http://stackoverflow.com/q/29798256

http://stackoverflow.com/q/29741671
downvote count: 1
has comment: http://stackoverflow.com/comment/47617402
tagged with: session
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
linked to: http://stackoverflow.com/q/8199936
has comment: http://stackoverflow.com/comment/47617355
has answer: http://stackoverflow.com/a/29743107
has answer: http://stackoverflow.com/a/70204935
has comment: http://stackoverflow.com/comment/47617009
score: 1
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/47616967
has comment: http://stackoverflow.com/comment/47616796
has title: PHP Session not working in sub directories
has body: I face this weird problem. I have a PHP page where I set the session variable. Then I load another page into the DIV tag of this page using $('').load(URL); But the page being loaded doesnt retain the session and destroys the current one as soon as its loaded. But the same page retains the session if its kept in the same directory along with the main page. I saw a similar question here. But it doesn't provide any solution. Here is my code Main Page: sample.php <?php session_start(); echo session_id(); echo " "; $_SESSION['test'] = "hello"; var_dump($_SESSION); echo " "; ?> <?php echo $_SESSION["test"]; ?> The Second Page: sample1.php <?php ob_start(); if(!isset($_SESSION)) session_start(); echo session_id(); echo " "; var_dump($_SESSION); ob_flush(); ?> You can see here I have 2 load calls in Main page $('#samedir').load("sample1.php"); this one loads from the same directory and dumps output array(1) { ["test"]=> string(5) "hello" } Whereas the second call $('#subdir').load("forms/sample1.php"); dumps this: array(0) { } But everything works fine in my localhost (MAMP) but not in my hosting server. Thank you guys.
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47617252
tagged with: php
upvote count: 2
answer count: 2

http://stackoverflow.com/q/29769515
tagged with: codeigniter
has comment: http://stackoverflow.com/comment/47670450
tagged with: php
has body: im using window.open to log in using google below are my codes. $('window').ready(function() { $('#googlebtn').click(function() { mywindow = window.open("'&lt;?php echo base_url();?&gt;'+authenticate/google","Auth","height=470,width=430") window.setInterval(function(){ if(mywindow.closed == true){ window.location.href = '&lt;?php echo base_url();?&gt;'+'checklogin/email'; } },3000); }); }); but what i want is to verify the data from the new window opened after close. i already tried declaring variable to the parent then in my new window window.opener.varFromParent = '1'; window.close(); then try to verify my variable to my parent inside the timer if(varFromParent == '1'){alert(1);} i cant get it working.
has comment: http://stackoverflow.com/comment/47670379
score: 2
has answer: http://stackoverflow.com/a/29769970
downvote count: 0
has comment: http://stackoverflow.com/comment/47670625
tagged with: javascript
tagged with: jquery
has title: Pass data back to parent using javascript
accepted answer: http://stackoverflow.com/a/29769970
has comment: http://stackoverflow.com/comment/47670851
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29769950
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/47670710
possible better answer: http://stackoverflow.com/a/29769950
answer count: 2

http://stackoverflow.com/comment/47531739
comment on: http://stackoverflow.com/a/29697222
score: 0
type: Comment
has text: I tried both options the second breaks it, the first works once and then doesn't work again. Any idea why this might be?
type: AnswerComment

http://stackoverflow.com/comment/47800851
comment on: http://stackoverflow.com/a/29837061
score: 0
type: AnswerComment
type: Comment
has text: Thank you so much. Can you please send me the code for exact caret in a 'reverse V' format? Sorry to ask you. I'm not a CSS expert.

http://stackoverflow.com/comment/47763577
score: 0
has text: Some code will help us to debug.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29818319

http://stackoverflow.com/comment/47819156
comment on: http://stackoverflow.com/q/29844569
type: Comment
type: QuestionComment
has text: If you look in (for example) Google Chrome Developer tools, is the ajax call executed twice in quick succession?
score: 0

http://stackoverflow.com/comment/47822541
has text: I've made it work with manual json parsing. Posted the whole thing at the bottom of question. Wondering if there is more elegant way. A big "thank you".
score: 0
comment on: http://stackoverflow.com/a/29838160
type: Comment
type: AnswerComment

model
tags question: http://stackoverflow.com/q/29838829
tag name: model
type: Tag
tags question: http://stackoverflow.com/q/29721385
tags question: http://stackoverflow.com/q/29826443
tags question: http://stackoverflow.com/q/29823842

http://stackoverflow.com/q/29822673
has body: So i am a new to angular. Trying to make a simple modal using angular directives only. The reasons for making this: No need to use bootstrap No need for a controller and Thus no dependency injection function modalTrigger() { return { restrict: 'A', transclude: true, link: function(scope, element, attrs) { scope.show = false; scope.toggleModal = function() { console.log(scope); scope.show = !scope.show; }; }, template: '&lt;div class="modal-trigger" ng-click="toggleModal()" ng-transclude&gt;&lt;/div&gt;' }; } function modalDialog() { return { restrict: 'E', transclude: true, link: function(scope, element, attrs) { scope.dialogStyle = {}; if (attrs.width) scope.dialogStyle.width = attrs.width; if (attrs.height) scope.dialogStyle.height = attrs.height; scope.hideModal = function() { console.log("called hide modal"); scope.show = false; }; }, template: "&lt;div class='ng-modal' ng-show='show'&gt;&lt;div class='modal-backdrop' ng-click='hideModal()'&gt;&lt;/div&gt;&lt;div class='container' ng-style='dialogStyle'&gt;&lt;div class='ng-modal-close' ng-click='hideModal()'&gt;&lt;a href=''&gt;&amp;times;&lt;/a&gt;&lt;/div&gt;&lt;div class='modal-content' ng-transclude&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;" }; } "modal-trigger" directive is used to trigger the "modal-dialog" directive by setting "show" to true. here are the two directives Right now, if you click any of the triggers, both the modals show up. how do i make the triggers specific to their own modals? To make things more clear, here is an example on plunker: http://plnkr.co/edit/lNwTy3ddFFBBm2DPHUGA?p=preview
tagged with: angularjs
has answer: http://stackoverflow.com/a/29823341
has title: Making a simple directive only modal dynamic
type: AnsweredQuestion
type: Question
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/29823341
answer count: 1

http://stackoverflow.com/comment/54351390
type: QuestionComment
comment on: http://stackoverflow.com/q/29764260
has text: @GoldAge: would you add a solution below for this old question? There tends to be a view here, and on other help sites, that the price for asking a question is to offer a solution if you resolve it yourself. It may be of help to future readers! Thanks.
score: 0
type: Comment

http://stackoverflow.com/q/29701216
has title: Alternative to exit() function?
has answer: http://stackoverflow.com/a/29702510
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47538532
has comment: http://stackoverflow.com/comment/47538411
has comment: http://stackoverflow.com/comment/47538460
has comment: http://stackoverflow.com/comment/47538313
answer count: 2
has comment: http://stackoverflow.com/comment/47538958
possible better answer: http://stackoverflow.com/a/29702510
has comment: http://stackoverflow.com/comment/47538445
upvote count: 0
has comment: http://stackoverflow.com/comment/47538423
has comment: http://stackoverflow.com/comment/47538926
favorite count: 0
has comment: http://stackoverflow.com/comment/47538415
has answer: http://stackoverflow.com/a/29701679
has comment: http://stackoverflow.com/comment/47538500
has comment: http://stackoverflow.com/comment/47538484
tagged with: php
type: AnsweredQuestion
has body: I am trying to change the class of a button if a conditon is not met ( if(strlen($username) < 5) ) this is my code : if( strlen($username) < 5 ){ echo ' More then 4 caracters '; $buttonClass = 'btn btn-primary disabled'; exit(); } elseif( is_numeric($username[0]) ) { echo ' First character mst be a letter '; $buttonClass = 'btn btn-primary disabled'; exit(); } elseif($check < 1){ echo ' ' . $username . ' is available'; }else{ echo ' This username is already taken '; $buttonClass = 'btn btn-primary disabled'; exit(); } } ?> Now i know there is something to do with the exit() function but if i don't put it then the html apears on the page twice,how can i stop that from happening ? Please can someone help ?
accepted answer: http://stackoverflow.com/a/29701679
has comment: http://stackoverflow.com/comment/47538410
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47538413

http://stackoverflow.com/q/29700342
score: 1
has comment: http://stackoverflow.com/comment/47536558
linked to: http://stackoverflow.com/q/5613834
type: Question
tagged with: typeof
has answer: http://stackoverflow.com/a/29700479
tagged with: javascript
has comment: http://stackoverflow.com/comment/47537239
has comment: http://stackoverflow.com/comment/47536896
answer count: 2
possible better answer: http://stackoverflow.com/a/29700489
tagged with: eval
has answer: http://stackoverflow.com/a/29700489
downvote count: 0
tagged with: string
has comment: http://stackoverflow.com/comment/47537141
has title: Can't get typeof of a string evaluated with eval()
favorite count: 0
accepted answer: http://stackoverflow.com/a/29700479
upvote count: 1
has comment: http://stackoverflow.com/comment/47536500
tagged with: object
type: AnsweredQuestion
has body: I'm trying to get the type of of a string evaluated with eval() with no success. The variable is a string stored in an array with the name of a possible object which I want to know if is defined. Can someone give a hand please? The troubling line is if ( typeof eval( x[i][0] ) !== 'undefined' ) and this is my code: var infoslider = [ ["revapi5", "el-masnou", "sant-andreu-de-llavaneres"], ["revapi3", "sant-andreu-de-llavaneres", "cardedeu"], ["revapi10", "cardedeu", "eudald-carbonell"], ["revapi9", "arenys-de-mar", "canet-de-mar"] ]; var x = infoslider; for (var i = 0; i &lt; x.length; i++) { if ( typeof eval( x[i][0] ) !== 'undefined' ) { vesa(x[i][0], x[i][2]); } } I get "ReferenceError: revapi5 is not defined"

http://stackoverflow.com/comment/47590211
comment on: http://stackoverflow.com/a/29727434
type: AnswerComment
score: 0
type: Comment
has text: Actually Yes! because your form is being submitted and the page is being refreshed! If you want to prevent submitting your form, always return false instead of returning **r**

http://stackoverflow.com/a/29791141
upvote count: 2
has body: One possibility is, without changing much of your code, as follows: var config = function(){ var name = ["john", "lucy", "lily"], age = ["22", "21", "22"], gender = ["male", "female", "female"]; return { people: function(index){ return { name: name[index], age: age[index], gender: gender[index] } } }; }();
downvote count: 0
answers question: http://stackoverflow.com/q/29791063
type: Answer
score: 2

http://stackoverflow.com/comment/47779890
score: 1
has text: Your code works just fine, although `console.log([1,2,3,4].method1());` prints out undefined (in your fiddle) since method1 does not return any string itself.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29826771

http://stackoverflow.com/comment/47756007
type: AnswerComment
score: 0
type: Comment
has text: Check the console to see if there is an `ERR: FILE NOT FOUND`. If not, it means there is something wrong with your code, and not your file loading.
comment on: http://stackoverflow.com/a/29814027

http://stackoverflow.com/comment/47824062
type: Comment
comment on: http://stackoverflow.com/a/29842780
score: 0
type: AnswerComment
has text: I think [observe-js](https://github.com/Polymer/observe-js) does exactly what you want. I have not yet used it so I can't guide you there. Good luck

http://stackoverflow.com/comment/47550167
score: 0
type: QuestionComment
type: Comment
has text: Could you be more specific? Do you want to encode each value as base64 but still have the values comma separated or do you want to base64 encode the entire csv file as a single base64 string?
comment on: http://stackoverflow.com/q/29706570

http://stackoverflow.com/q/29707083
has answer: http://stackoverflow.com/a/29708467
answer count: 1
tagged with: jquery
score: 1
favorite count: 0
tagged with: angularjs
has body: I am getting the below error when loading my page. Error: initialize is not defined @http://localhost:8082/js/vendor/jquery-1.11.2.js line 339 > eval:4:3 I want to replace the jqLite with the full version of jquery. I have read several stackoverflow questions on this subject and they imply that all that is required is to load jquery before angularjs. I have done this by simply moving the declaration for jquery above the angular.js. When I do this that is when the above error occurs. It does not give the error when I move the jquery below angularjs but then I cannot use such things as angular.element. What am I doing wrong? As far as loading the javascript for each library all I am doing is. &lt;script type='text/javascript' src="js/vendor/jquery-1.11.2.js"&gt;&lt;/script&gt; &lt;script type='text/javascript' src="js/vendor/angular.js"&gt;&lt;/script&gt; as far as using jquery instead of lqlite, I am simply trying to use angular.element var someElement = angular.element('#someelement'); I read a blurb to load jquery before DOMContentLoaded. I am not sure how to do this. I know how to write an event handler for DOMContentLoaded, but what do I do then.
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47550124
accepted answer: http://stackoverflow.com/a/29708467
type: AnsweredQuestion
upvote count: 2
downvote count: 1
type: Question
has title: AngularJS complains that initialization not defined for jquery
tagged with: javascript

http://stackoverflow.com/a/29770125
has comment: http://stackoverflow.com/comment/47673442
has body: Set the Visible property to true to actually get the control (and, by extension, its client-side object) on the page in the browser Wrap your server code blocks in RadCodeBlock tags: http://www.telerik.com/help/aspnet-ajax/ajax-radscriptblock-radcodeblock.html. Here is your snippet working fine for me: <telerik:RadDatePicker ID="RadDatePicker1" runat="server" Culture="el-GR" Visible="true" Skin="WebBlue" AutoPostBack="True"> <ClientEvents OnFocus="ShowDatePopup" /> </telerik:RadDatePicker> <telerik:RadCodeBlock runat="server" ID="RadCodeBlock1"> </telerik:RadCodeBlock>
accepted answer of: http://stackoverflow.com/q/29764078
answers question: http://stackoverflow.com/q/29764078
has comment: http://stackoverflow.com/comment/47675109
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/47697125
has text: @levi Thanks for replying. The index.html is in the same directory as the script. As I understand, the first parameter refers to this index file, which contains the webview tag. Also, it does show the page when there is an app window already open.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29783044
score: 0

http://stackoverflow.com/q/29781469
type: Question
has comment: http://stackoverflow.com/comment/47693032
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47693054
has comment: http://stackoverflow.com/comment/47693136
has comment: http://stackoverflow.com/comment/47692969
has comment: http://stackoverflow.com/comment/47693028
answer count: 1
has answer: http://stackoverflow.com/a/29781592
favorite count: 0
has comment: http://stackoverflow.com/comment/47694563
type: UnansweredQuestion
has title: One button submit, only submitted the last form
has comment: http://stackoverflow.com/comment/47693075
has body: Two forms exist, it doesn't matter which one is last, always the last one is submitted. &lt;script&gt; function submitall() { document.getElementById("form2").submit(); document.getElementById("form1").submit(); } &lt;/script&gt;
score: -1
tagged with: forms
downvote count: 1

http://stackoverflow.com/q/29819840
has answer: http://stackoverflow.com/a/29822789
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/19444592
type: Question
answer count: 1
accepted answer: http://stackoverflow.com/a/29822789
tagged with: javascript
score: 0
tagged with: three.js
tagged with: http://stackoverflow.com/tag/html
has body: I am starting a project in Three.js and I have correctly imported the library OrbitControls.js, but when I open the console to test it, I see the following error: Cannot read property 'prototype' of undefined And it is related to the following line code inside OrbitConstrols.js: THREE.OrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype ); I found similar examples that research a solution for this problem, like this one, but it is made for Typescript. Do you know a possible way to solve this issue? Or it is simply a bug of the library and even if I get an error, the object will be properly rendered?
has title: OrbitControls.js - Cannot read property 'prototype' of undefined

http://stackoverflow.com/comment/47540755
has text: @AvinashRaj: Yours had the ground covered, mine was nearly a duplicate. Figured what value it had could be served by the comment above. :-)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29701522
type: Comment

http://stackoverflow.com/comment/47551409
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29707878
has text: Works fine in Chrome

http://stackoverflow.com/a/29745423
has comment: http://stackoverflow.com/comment/47623291
has comment: http://stackoverflow.com/comment/47624266
downvote count: 0
answers question: http://stackoverflow.com/q/29745371
has body: you need to echo content on the php page then this will return success message .Ajax call will get the response if there is html or some printed data in the php file or any target file. try like this function NewUser(){ $data = mysqli_query($query)or die(mysql_error()); if($data){ $response_array['status'] = 'success'; }else { $response_array['status'] = 'error'; } return $response_array; } $data=NewUser(); echo json_encode($data); and update the ajax function $("#usignupform").validate({ submitHandler:function() { var $form = $(form), $messageSuccess = $('#mesSuccess'), $messageError = $('#mesError'); $.ajax({ url: "investor-invite.php", type: "POST", data: $(this).serialize(), dataType: 'json', //add this to get the json response complete: function(data) { if (data.status == 'success') { $messageSuccess.removeClass('hidden'); $messageError.addClass('hidden'); // Reset Form $form.reset(); return; } else { $messageError.removeClass('hidden'); $messageSuccess.addClass('hidden'); } } }); return false; } }); Update please remove Depricated mysql_* from your code and use mysqli_* or pdo queries
type: Answer
has comment: http://stackoverflow.com/comment/47626079
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47623311

http://stackoverflow.com/a/29839369
has body: This is because we use multi views, which are nested in one state. That means, that we have to use absolute naming. This way, we can instruct UI-Router, that the second view, should be placed into current state other view. It is not obvious what is the name of your state, but let's imagine that it would be 'shell' 'views': { 'master': { ... }, 'globalNavigationPanel@shell': { .... } }, Now, the template of our 'shell' state should be (I mean the templateUrl: 'core/views/shell.html',) And the index.html should contain just: Because the master will contain a placeholder for the 'globalNavigationPanel' Also check the doc View Names - Relative vs. Absolute Names Behind the scenes, every view gets assigned an absolute name that follows a scheme of viewname@statename, where viewname is the name used in the view directive and state name is the state's absolute name, e.g. contact.item. You can also choose to write your view names in the absolute syntax. For example, the previous example could also be written as: .state('report',{ views: { 'filters@': { }, 'tabledata@': { }, 'graph@': { } } }) Notice that the view names are now specified as absolute names, as opposed to the relative name. It is targeting the 'filters', 'tabledata', and 'graph' views located in the root unnamed template. Since it's unnamed, there is nothing following the '@'. The root unnamed template is your index.html. EXTEND - There is a working example This is the state definition: .state('shell', { url: '/shell', views: { 'master' : { templateUrl: 'core/views/shell.html', controller: 'shellcontroller', controllerAs: 'vm', }, 'globalNavigationPanel@shell': { templateUrl: 'core/views/globalNavigationPanel.html', controller: 'globalNavigationPanelController', controllerAs: 'gpvm', } } }) These are the views The templateUrl: 'core/views/shell.html', shell {{text}} The templateUrl: 'core/views/globalNavigationPanel.html', globalNavigationPanel {{text}} while index contains just: Check it in action here
has comment: http://stackoverflow.com/comment/47826880
has comment: http://stackoverflow.com/comment/47975086
upvote count: 2
has comment: http://stackoverflow.com/comment/47974292
has comment: http://stackoverflow.com/comment/47976102
accepted answer of: http://stackoverflow.com/q/29835038
has comment: http://stackoverflow.com/comment/47827267
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/52650376
answers question: http://stackoverflow.com/q/29835038
has comment: http://stackoverflow.com/comment/47827001
has comment: http://stackoverflow.com/comment/47829901
has comment: http://stackoverflow.com/comment/47826709
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47976632
has comment: http://stackoverflow.com/comment/52643294
has comment: http://stackoverflow.com/comment/47974433
has comment: http://stackoverflow.com/comment/47836125

http://stackoverflow.com/comment/47690617
score: 0
type: Comment
type: QuestionComment
has text: I meant this: `#if (s-start-with? 'Y' PRIMARY_FLAG)`
comment on: http://stackoverflow.com/q/29780137

http://stackoverflow.com/comment/47751439
comment on: http://stackoverflow.com/a/29811632
score: 0
type: AnswerComment
type: Comment
has text: @SysVoid I think your missing my message, I'm simply stating it's more appropriate since the button clearly isn't for submitting.

http://stackoverflow.com/comment/47714059
type: Comment
has text: No you cannot hide the loading bar from the same php that saves the excel file. You will need another ajax routine to poll the server
score: 0
comment on: http://stackoverflow.com/q/29792625
type: QuestionComment

multithreading
tags question: http://stackoverflow.com/q/29700256
type: Tag
tags question: http://stackoverflow.com/q/29747394
tag name: multithreading
tags question: http://stackoverflow.com/q/29756753

http://stackoverflow.com/comment/47753899
comment on: http://stackoverflow.com/q/29812095
score: 0
type: Comment
type: QuestionComment
has text: If you run your code snippet, you'll notice the output is `bbb`. Check for errors in your developer console.

http://stackoverflow.com/a/29820890
has comment: http://stackoverflow.com/comment/80486263
score: 10
answers question: http://stackoverflow.com/q/29763280
upvote count: 11
accepted answer of: http://stackoverflow.com/q/29763280
has comment: http://stackoverflow.com/comment/47832124
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/69668581
type: Answer
has body: The intended use of Record structure isn't to verify the structure of provided data, just to determine set of keys that are allowed and provide default values if they're not given. So using your example, if you initialize the record without providing Address, you will get the proper Immutable.Record object for Address: var user = new User({name: 'Foo'}); // =&gt; Record { "name": "Foo", "address": Record { "street": "", "city": "", "zip": "" } } One hackish way to achieve what you want would be to write a wrapper on Immutable.fromJS method with custom reviver function: Immutable.Record.constructor.prototype.fromJS = function(values) { var that = this; var nested = Immutable.fromJS(values, function(key, value){ if(that.prototype[key] &amp;&amp; that.prototype[key].constructor.prototype instanceof Immutable.Record){return that.prototype[key].constructor.fromJS(value)} else { return value } }); return this(nested); } Then you can use it like this: var user = User.fromJS({name: 'Foo', address: {street: 'Bar', city: 'Baz'}}); // =&gt; User { "name": "Foo", "address": Record { "street": "Bar", "city": "Baz", "zip": "" } } However if you want to have proper checking your data structures, I would recommend using Immutable.js together with some static type-checker, like http://flowtype.org/ or http://www.typescriptlang.org/

http://stackoverflow.com/q/29778313
tagged with: jquery-mobile
tagged with: javascript
score: 0
has title: Finding unknown text from string with jQuery
tagged with: jquery
has body: I have a listview in jQuery Mobile. When the user swipes right, that entry is removed from my list. All works good. But when an item is added on to the list, I have a separate array which holds all the products I'm keeping: ["Catalogue1/{value}"] when I remove the list item, how could I check for that value inside my array and remove it? I have the html saved in a variable "product_li", inside that the value I'm looking to search for is stored in heading tags: &lt;h3 class="ui-li-heading"&gt;{Product-to-Remove}&lt;/h3&gt; Is there a method or other way I can just search whats inside these heading tags? Once I have that I know I can use .indexOf() to search for and remove it from my array, it's just getting the text from the larger string that I'm struggling with.
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47686774
type: Question
has comment: http://stackoverflow.com/comment/47688562

http://stackoverflow.com/comment/47556304
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29708429
type: Comment
has text: I think the way Firebase handles saving user data, you would need to access it from the uid object. So `$rootScope.user = authData.uid.name;` would access the name. If you look at https://www.firebase.com/docs/web/guide/user-auth.html you'll see the save name and profile to the uid like so: `ref.child("users").child(authData.uid).set({ provider: authData.provider, name: getName(authData) });`

http://stackoverflow.com/a/29731500
score: 0
type: Answer
has body: Why to complicate the code so much? More readable version: $('&lt;div&gt;&lt;/div&gt;') .attr('id','idA') .addClass('myclass') .on('click',function(){return true;});
answers question: http://stackoverflow.com/q/29730353

http://stackoverflow.com/q/29778725
has title: Using `.bind(thisArg, [, arg1[, arg2[, ...]]])` to prepend arguments
has comment: http://stackoverflow.com/comment/47687841
tagged with: ecmascript-5
favorite count: 0
tagged with: scope
type: Question
tagged with: parameters
has answer: http://stackoverflow.com/a/29779017
score: 0
upvote count: 1
answer count: 1
downvote count: 1
tagged with: bind
has body: I’m learning to really love ES5’s .bind() as it allows me to modify the context of callback functions and really solves for most callback hell or pyramiding issues. However, I’m wondering if its generally considered best practices to utilize the optional args parameters. Being able to inject dependencies seems incredibly useful, but used incorrectly could lead to really hard to untangle spaghetti code. Example: function loadFile(filename, callback) { fs.exists(function (exists) { if (exists) { fs.readFile(filename, 'utf8', function (err, data) { callback(data); }); } }); } // becomes function onReadFile(callback, err, data) { callback(data); } function onExists(filename, callback, exists) { if (exists) { fs.readFile(filename, 'utf8', onReadFile.bind(this, callback)); } } function loadFile(filename, callback) { fs.exists(onExists.bind(this, filename, callback)); } Should I just stick to nesting my functions or use the optional arg params?
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/a/29839360
has body: Try this: var start = new Date(2015, 0, 1), // Jan 1, 2015 end = new Date(2015, 7, 24), // August 24, 2015 today = new Date(), // April 23, 2015 p = Math.round(((today - start) / (end - start)) * 100) + '%'; // Update the progress bar $('.bar').css("width", p).after().append(p); Demo: http://jsfiddle.net/zz4c16fx/6/
answers question: http://stackoverflow.com/q/29839270
has comment: http://stackoverflow.com/comment/82723652
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47805056
has comment: http://stackoverflow.com/comment/47805090
accepted answer of: http://stackoverflow.com/q/29839270
type: Answer
score: 13
upvote count: 13

http://stackoverflow.com/q/29740618
has comment: http://stackoverflow.com/comment/47755664
has body: I'm having a non-critical issue with my angular app. I have a simple search field in a form, and when I press enter to submit, I get an exception in angular.js line 12007 (AngularJS v1.4.0-rc.0): TypeError: Cannot read property 'end' of undefined at VM2885 angular-animate.js:2209 at forEach (angular.js:332) at closeChildAnimations (VM2885 angular-animate.js:2202) at queueAnimation (VM2885 angular-animate.js:2048) at Object.$$AnimateQueueProvider.$get.push (VM2885 angular-animate.js:1943) at Object.$AnimateProvider.$get.leave (angular.js:5017) at cleanupLastView (angular-route.js:913) at angular-route.js:942 at publicLinkFn (angular.js:7199) at $get.boundTranscludeFn (angular.js:7345) The reason for this is the closeChildAnimations function in angular-animate.js: function closeChildAnimations(element) { var node = element[0]; var children = node.querySelectorAll('[' + NG_ANIMATE_ATTR_NAME + ']'); forEach(children, function(child) { var state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME)); var animationDetails = activeAnimationsLookup.get(child); switch (state) { case RUNNING_STATE: //HACK: Added check here as it breaks on form submit on the search page otherwise if(animationDetails.runner !== undefined) animationDetails.runner.end(); /* falls through */ case PRE_DIGEST_STATE: if (animationDetails) { activeAnimationsLookup.remove(child); } break; } }); } I have added the if statement as a temporary hack. It seems that one of the elements in the activeAnimationsLookup does not have a runner member. Is this something that should be reported to angular team, or am I missing something here? Adding the if statement works, but I'm not happy editing a relatively stable framework such as angular.
has answer: http://stackoverflow.com/a/29960197
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47806829
tagged with: angularjs
favorite count: 0
upvote count: 3
has comment: http://stackoverflow.com/comment/47756575
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/29960197
has title: Angular animate runner is undefined
type: Question

http://stackoverflow.com/comment/47618490
comment on: http://stackoverflow.com/a/29742664
has text: If i alert(), i can both alert the outer div's current scrollTop and the inner divs position (works) - but the statement does not scroll the outer div to the inner div..
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29742953
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29742688
has comment: http://stackoverflow.com/comment/47675594
has comment: http://stackoverflow.com/comment/47620177
upvote count: 1
has comment: http://stackoverflow.com/comment/47625169
has body: Requests carry an user agent string which identifies the browser in use. Reading this string with useragent = navigator.userAgent and adapting your stylesheet depending on its value is pretty common, actually. See also window.navigator.userAgent

http://stackoverflow.com/comment/47792988
comment on: http://stackoverflow.com/q/29833034
type: Comment
type: QuestionComment
score: 3
has text: suggest you create a demo that replicates problem

http://stackoverflow.com/q/29841117
type: Question
tagged with: internet-explorer
tagged with: javascript
upvote count: 1
tagged with: http://stackoverflow.com/tag/pdf
downvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47810809
has title: Open PDF is not working in IE and safari using AngularJS
tagged with: safari
answer count: 0
score: 1
has body: I'm tried to load a PDF files in browser while button click using angularjs. This is my code. $http.get('assets/mercury_doc.pdf',{responseType: 'arraybuffer'}).success(function(data){ var file = new Blob([data], {type: 'application/pdf'}); var fileURL = URL.createObjectURL(file); window.open(fileURL,"_self"); }); It's working fine in Chrome and firefox. But not working in IE and safari.
has comment: http://stackoverflow.com/comment/47809559

http://stackoverflow.com/q/29732539
upvote count: 1
has comment: http://stackoverflow.com/comment/47599436
tagged with: asynchronous
has body: I am using local database, Here i am fetching some problem while using each function or for loop to make a call to get data from local database, Its not looking like synchronous before getting First data All iteration has finished I am expecting each iteration should wait until i get data from Local Datbase How I can active this in java script Pl Answer my question var printArray = []; $.each(list, function(key,val) { var tableName = val.tableName; var columnName = val.columnName; var lineNumber = val.lineNumber; var lableName = val.lableName; var lableValue = val.lableName; var positionLabel = val.positionLabel; var positionValue = val.positionValue; var query = new ****.Query(); query.equalTo('Customer_ID','A5F38467-0C64-E411-B51C-005056B57717'); var tableData = synObj.getOfflineData(tableName,query); tableData.then(function(data){ var jsonValue = { "lineNumber": lineNumber, "lableName": lableName, "lableValue": data[0].columnName, "positionLabel": positionLabel, "positionValue": positionValue, }; printArray.push(jsonValue); }); });
has comment: http://stackoverflow.com/comment/47598328
favorite count: 0
has title: how to do Jquery each function or for loop with synchronous process while calling sqlite(Local) database
type: UnansweredQuestion
tagged with: local-storage
answer count: 0
downvote count: 0
score: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47658038
tagged with: jquery

http://stackoverflow.com/comment/48062772
type: QuestionComment
has text: Have you tried importing the data with `this.game.cache.addImage('key',null,imageData);`?
score: 1
comment on: http://stackoverflow.com/q/29733356
type: Comment

http://stackoverflow.com/q/29785705
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/47701223
type: Question
has comment: http://stackoverflow.com/comment/47701185
has comment: http://stackoverflow.com/comment/47701652
has body: I have a drag and drop feature where you can drag some images on 5 div boxes. The drag and drop works on 4 of the divs but for some reason the 5th div box doesn't work, whenever i try to drag an image into that box it just refuses to work. The other boxes function correctly and when i drop images onto these divs it works fine..its just the last box that does not work. I think it might be to do with the align:left css i've put in (not sure). If anyone could help that would be great html: js: function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("text/html", ev.target.id); } function drop(ev) { ev.preventDefault(); var data=ev.dataTransfer.getData("Text/html"); var clone = document.getElementById(data).cloneNode(true); clone.id = clone.id + (new Date()).getMilliseconds(); ev.target.appendChild(clone); if (ev.target == document.getElementById("delete")) { var img = document.getElementById(data); img.parentNode.removeChild(img); } } css: #PlayerDrop { position: relative; left: 245px; top: 5px; z-index:1; width: 369px; height: 121px; background-image:url(images/sequence2.png) ; } #Drop1 { position: relative; left: 16px; top: 30px; width:40px; height:49px; padding:10px; z-index:3; float: left; border-style: solid; border-color: #66cff2; } #Drop2 { position: relative; left: 17px; top: 30px; width:40px; height:49px; padding:10px; z-index:3; float: left; border-style: solid; border-color: #66cff2; } #Drop3 { position: relative; left: 23px; top: 30px; width:40px; height:49px; padding:10px; z-index:3; float: left; border-style: solid; border-color: #66cff2; } #Drop4 { position: relative; left: 26px; top: 30px; width:40px; height:49px; padding:10px; z-index:3; float: left; border-style: solid; border-color: #66cff2; } #Drop5 { position: relative; left: 296px; top: 30px; width:40px; height:49px; padding:10px; z-index:3; border-style: solid; border-color: #66cff2; }
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47701521
has title: Drag and Drop not working on one div
score: 0
has comment: http://stackoverflow.com/comment/47701200
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/34867327
tagged with: drag-and-drop

http://stackoverflow.com/comment/47703059
comment on: http://stackoverflow.com/q/29786535
has text: @Mozein—everything that can be done with recursion can be done sequentially and will almost certainly be a lot faster (i.e. recursion is slow, but usually uses less code). Think of all those function calls and stack that needs to be maintained vs a simple loop.
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47785068
type: QuestionComment
score: 0
has text: authorAvatarUrl: "images/profile/test123.55134350ac6956.23064912.jpg" authorName: "test123" comment: "working hard." created_by: "38" id: "30" sectionId: "1200"
comment on: http://stackoverflow.com/q/29829023
type: Comment

http://stackoverflow.com/comment/47824125
type: Comment
comment on: http://stackoverflow.com/a/29831204
type: AnswerComment
has text: Okay, very quickly tried to address `this` question (it's all about "execution context") and one quick cut at doing this with OO.
score: 0

http://stackoverflow.com/a/29778520
has comment: http://stackoverflow.com/comment/47690699
answers question: http://stackoverflow.com/q/29778173
has comment: http://stackoverflow.com/comment/47688691
type: Answer
has comment: http://stackoverflow.com/comment/47690426
has body: Almost there //*[categories[contains(id, "2")]]
score: 0
has comment: http://stackoverflow.com/comment/47688796

http://stackoverflow.com/comment/47774329
comment on: http://stackoverflow.com/q/29823726
score: 0
type: QuestionComment
type: Comment
has text: @OlegsJasjko then it is time to write this function.

http://stackoverflow.com/a/29775049
answers question: http://stackoverflow.com/q/29773947
has comment: http://stackoverflow.com/comment/56088407
has body: Demo Plunker You can create a custom directive that relies on ngModel: Error: Date is in the future! The directive would create an isolated scope to create a private scope, and require ngModel and an optional parent form: require: ['ngModel', '^?form'], scope: { } The directive's controller would initialize years and months for the drop down lists: controller: function($scope){ $scope.years = [1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018]; $scope.months = ['Jan','Feb', 'Mar', 'Apr', 'May','Jun', 'Jul','Aug', 'Sep', 'Oct','Nov','Dec'] } The directive would render the following template: template: ' ' + ' ' Set up a $watch to set the date whenever the month or year drop-down changes: scope.$watch('year', function(year) { if (year) { var month = scope.months.indexOf(scope.month); ngModel.$setViewValue(new Date(year, month,1)); } }); scope.$watch('month', function(month) { if (month) { var year = scope.year; var monthIndex = scope.months.indexOf(scope.month); ngModel.$setViewValue(new Date(year, monthIndex,1)); } }); ngModel.$formatters.push(function(val) { scope.year = val.getFullYear(); scope.month = scope.months[val.getMonth()]; }); Use the ngModel controller to add a futureDate validator: ngModel.$validators.futureDate = function(val) { var date = new Date(); return val <= new Date(date.getFullYear(), date.getMonth(),1); } You can then use AngularJS form validation: if ($scope.form.date.$valid) { ... } if ($scope.form.date.$error.futureDate) { ... } etc.
accepted answer of: http://stackoverflow.com/q/29773947
has comment: http://stackoverflow.com/comment/56083373
type: AcceptedAnswer
score: 4
type: Answer
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/47668716
has text: No, what I want is to get the next date from today in the array. Not that the next day is tomorrows date or not.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29768763
score: 0

http://stackoverflow.com/comment/47680768
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29774957
has text: You might run into ugly computations when you have a animation with an animation-delay by itself. But even then, this should be not overly complex.
score: 0

http://stackoverflow.com/comment/108818165
comment on: http://stackoverflow.com/a/35581170
has text: Hi Man! What kind of issue did you experience?
score: 3
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47651615
has text: So, does function factorial have 1 as its property? Property can be accessed by using "functionName.property", but "factorial.1" clearly violates the rule...Thanks for clarification in advance.
type: AnswerComment
comment on: http://stackoverflow.com/a/29759481
type: Comment
score: 0

http://stackoverflow.com/comment/47701070
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29783428
has text: You're welcome. And if it works, then I suggest accepting my answer so that others will know that your problem is solved.

http://stackoverflow.com/a/29833603
answers question: http://stackoverflow.com/q/29833231
has body: $(this).attr('checked') Should be $(this).prop('checked') since you want the property checked, not the attribute. Getting the attribute would determine whether or not the check box has the actual attribute of checked, which would not change from regular user input. Example, if the page started with the check box checked then $(this).attr('checked') would be true, but if the user unchecked the box, it would still equal true.
type: Answer
accepted answer of: http://stackoverflow.com/q/29833231
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47628654
score: 1
comment on: http://stackoverflow.com/a/29735355
type: AnswerComment
has text: Okay, must work more accurate than a Windows 7 Firefox 37 combo then. I guess it would be a small fix though - I'll post a minor update. In my idea it would be more for backwards compatibility than anything else. I can't imagine this behaviour to stay in the browser spec (but it seems they've been slacking off somewhat at Mozilla in recent times).
type: Comment

http://stackoverflow.com/q/29757162
has title: How to format 04Apr with a single call to format()
has body: I'm trying to output the string 2015 - 04Apr - 15Wed. The closest I've come to was with moment('2015-04-15').format('YYYY - MM MMM - DDddd'), which outputs 2015 - 04 Apr - 15 Wed. How can I remove the space between 04 and Apr without calling format() twice? The resulting string must contain ASCII characters only.
type: Question
tagged with: javascript
answer count: 2
downvote count: 0
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29761479
type: UnansweredQuestion
upvote count: 1
tagged with: momentjs
tagged with: format
has answer: http://stackoverflow.com/a/29757425

http://stackoverflow.com/comment/47759561
type: Comment
comment on: http://stackoverflow.com/a/29816183
score: 0
type: AnswerComment
has text: Also, what is `text/rocketscript`, and why aren't you using `text/javascript`? Could be related to that too.

http://stackoverflow.com/q/29841854
answer count: 3
has answer: http://stackoverflow.com/a/29842046
has body: On a Form Action of type POST, we fetch all the values in Node.JS/Express and try saving it into MongoDB. A hidden field determines the length of a property from the frontend javascript and it's value is updated as the hidden field's value. This length is used in the backend (Node) to iterate over a list of items. I have a async.waterfall function and a for loop running inside it like this. async.waterfall([ function(callback){ var itemLength = req.body.itemLength; var itemProp,itemComponent; var destination; var destinationsArray =[]; for(var k=1; k&lt;=itemLength; k++){ destination = new Destination({ name: req.body['destinationName'+k], }); itemComponent = { "itemCompProp" : req.body['itemCompProp'+k] }; itemProp = new ItemProp({ itemComponent: itemComponent }); itemProp.save(function(err,itemPropSaved){ destination.newProperty = itemPropSaved._id destination.save(function(err,destinationSaved){ if(err){ console.log("Error== " + err); } else{ destinationsArray.push(destinationSaved._id); } }); }); }// End of For callback(null,destinationsArray); }, function(destinationsArray,callback){ var brand = new Brand({ name : req.body.brandName, }); brand.save(function(err,brandSaved){ if(err){ console.log("Error== " + err); }else{ console.log('Brand Saved'); } }); callback(null); } ], function (err, status) { if(err){ req.flash('error', { msg: 'Error Saving Brands' }); console.log("Error : " + err); } else{ console.log("Brand Saved."); req.flash('success', { msg: 'Brand Successfully Added!' }); } }); res.redirect('/redirectSomewhere'); When we run this, The destinationsArray is returned first as null, as opposed to going through the for loop and then returning the proper value of destinationsArray over a length (itemLength) of destinations. We want the process to be synchronous. We also tried using a closure wrapping the for Loop but to no avail. We can't use a async.eachSeries instead of the for Loop as I am just iterating over a numeric property and we don't have any do…
downvote count: 1
possible better answer: http://stackoverflow.com/a/29841997
tagged with: mongodb
has answer: http://stackoverflow.com/a/29841997
tagged with: mongoose
tagged with: javascript
has title: async.waterfall inside a for loop escapes the for loop
has answer: http://stackoverflow.com/a/29847201
type: AnsweredQuestion
score: 1
tagged with: asynchronous
favorite count: 0
type: Question
upvote count: 2
accepted answer: http://stackoverflow.com/a/29847201
tagged with: node.js

http://stackoverflow.com/a/29796712
has body: Make sure you are writing controller only once. write either in ng-controller or in your config route: app.config(['$routeProvider', function($routeProvider){ $routeProvider.when('/', { templateUrl: 'pages/home.html' //Remove controller from here }); }]); home.html &lt;!-- Add the ng-controller in your view --&gt; &lt;div ng-controller="MyItemsController"&gt; &lt;!-- Your stuff --&gt; &lt;/div&gt; Try using reloadOnSearch: false inside your config it will prevent controller from loading.
downvote count: 0
has comment: http://stackoverflow.com/comment/47721642
answers question: http://stackoverflow.com/q/29796557
type: Answer
has comment: http://stackoverflow.com/comment/47721545
score: 1
upvote count: 1

http://stackoverflow.com/comment/47526709
score: 1
comment on: http://stackoverflow.com/q/29695207
has text: show your code or add JSfiddle.....
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47576805
comment on: http://stackoverflow.com/a/29719021
type: AnswerComment
score: 0
has text: Sorry, my mistake. I meant the star `*` ... This works fine for the Problem: `$("div[id*='bookmark-']").each(... `
type: Comment

http://stackoverflow.com/q/29699098
has answer: http://stackoverflow.com/a/29699790
tagged with: javascript
answer count: 6
has comment: http://stackoverflow.com/comment/47534137
has comment: http://stackoverflow.com/comment/47534248
has comment: http://stackoverflow.com/comment/47534220
has title: Javascript substring with html tags
favorite count: 0
has answer: http://stackoverflow.com/a/29699608
has answer: http://stackoverflow.com/a/29699492
has comment: http://stackoverflow.com/comment/47534413
has answer: http://stackoverflow.com/a/29699546
score: 6
upvote count: 7
possible better answer: http://stackoverflow.com/a/29699608
has answer: http://stackoverflow.com/a/29699541
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47534353
has answer: http://stackoverflow.com/a/58234811
has comment: http://stackoverflow.com/comment/47534241
downvote count: 1
accepted answer: http://stackoverflow.com/a/29699492
tagged with: substring
has body: I have searched too much on same topic but not is perfect for what I am looking for. I have a string like : var string ='Hii this is just a demo string ' Now what I want is to substring it with limit with javascript substring function but don't want tags to be cut in middle like for example Hii <p It should be like Hii I am using string.substr(0,200) string is dynamic variable with html tags
type: Question

http://stackoverflow.com/q/29790591
has answer: http://stackoverflow.com/a/29793164
type: Question
has comment: http://stackoverflow.com/comment/47710099
linked to: http://stackoverflow.com/q/5767325
favorite count: 0
score: 4
has body: Sort by count of letters.Check for words that begin with the same letter.Check if a word is completely present in another word.when both begin with the same letter.If it is completely present.show only the first word and ignore the second word var arraylist = ["running", "walking", "standing", "writing", "waiting", "sleeping", "reading", "washing", "sitting", "riding", "shopping", "singing", "painting", "watching", "swimming", "pulling", "smoking", "pushing", "drinking", "dancing", "cooking", "crying ", "eating", "smiling","run", "walk", "push", "cook", "cry", "eat"]; Expecting Output using javascript/jquery: I need to remove these words: running, walking, pushing, cooking, crying, eating. var arrayList = ["run", "walk", "standing", "writing", "waiting", "sleeping", "reading", "washing", "sitting", "riding", "shopping", "singing", "painting", "watching", "swimming", "pulling", "smoking", "push", "drinking", "dancing", "cook", "cry", "eat", "smiling","run", "walk", "push", "cook", "cry", "eat"];
has title: Remove Items form Array logic - present tense and present continuous tense
answer count: 2
has comment: http://stackoverflow.com/comment/47710453
has comment: http://stackoverflow.com/comment/47710458
has answer: http://stackoverflow.com/a/29792640
has comment: http://stackoverflow.com/comment/47710380
has comment: http://stackoverflow.com/comment/47710320
has comment: http://stackoverflow.com/comment/47710306
upvote count: 4
tagged with: arrays
has comment: http://stackoverflow.com/comment/47710869
downvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47710385

http://stackoverflow.com/comment/47606681
comment on: http://stackoverflow.com/q/29736521
score: 1
has text: @Jeroen That's a fair point. I will edit my question.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47684475
type: Comment
has text: is st supposed to be literals?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29777011

http://stackoverflow.com/a/29826665
has body: Using visible="false" will prevent it from rendering. What you need to do is prevent it from displaying by using a CSS class or display: none;. Change your code to: &lt;asp:TextBox ID="tbTheBestID" runat="server" CssClass="hidden" Text="Hello!" /&gt; And add to your CSS (note, many frameworks may already have a .hidden class): .hidden { display: none; } Unfortunately, this will be available in the source, including any value. Because jQuery runs on the client side, it can only access information it has been sent (therefore it must be in the page to be seen by the page). If it is sensitive information, perhaps consider a webservice to feed an $.ajax call. Note, that this does not make the data safe, but it minimises the exposure time.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47780236
accepted answer of: http://stackoverflow.com/q/29826541
score: 0
has comment: http://stackoverflow.com/comment/47780156
type: Answer
answers question: http://stackoverflow.com/q/29826541

http://stackoverflow.com/comment/47773740
comment on: http://stackoverflow.com/q/29823626
type: QuestionComment
type: Comment
score: 0
has text: Display "download" link on success with target="_blank" or window.open.

java
tags question: http://stackoverflow.com/q/29769564
tags question: http://stackoverflow.com/q/29723379
tags question: http://stackoverflow.com/q/29733594
tags question: http://stackoverflow.com/q/29830327
tags question: http://stackoverflow.com/q/29774622
tags question: http://stackoverflow.com/q/29694865
tags question: http://stackoverflow.com/q/29815075
tags question: http://stackoverflow.com/q/29798046
tags question: http://stackoverflow.com/q/29774757
tags question: http://stackoverflow.com/q/29716169
tags question: http://stackoverflow.com/q/29766114
tags question: http://stackoverflow.com/q/29800377
tags question: http://stackoverflow.com/q/29731398
tags question: http://stackoverflow.com/q/29796197
tags question: http://stackoverflow.com/q/29830614
tags question: http://stackoverflow.com/q/29789262
tags question: http://stackoverflow.com/q/29788779
tags question: http://stackoverflow.com/q/29695647
tags question: http://stackoverflow.com/q/29745630
tags question: http://stackoverflow.com/q/29838477
tags question: http://stackoverflow.com/q/29749437
tags question: http://stackoverflow.com/q/29803316
tags question: http://stackoverflow.com/q/29770425
tags question: http://stackoverflow.com/q/29788889
tags question: http://stackoverflow.com/q/29780446
tags question: http://stackoverflow.com/q/29754640
tags question: http://stackoverflow.com/q/29809273
tags question: http://stackoverflow.com/q/29820680
tags question: http://stackoverflow.com/q/29793022
tags question: http://stackoverflow.com/q/29838773
tags question: http://stackoverflow.com/q/29760397
tags question: http://stackoverflow.com/q/29716743
tags question: http://stackoverflow.com/q/29802476
tag name: java
tags question: http://stackoverflow.com/q/29829597
tags question: http://stackoverflow.com/q/29695717
tags question: http://stackoverflow.com/q/29844804
tags question: http://stackoverflow.com/q/29735504
tags question: http://stackoverflow.com/q/29761957
tags question: http://stackoverflow.com/q/29780315
tags question: http://stackoverflow.com/q/29719476
tags question: http://stackoverflow.com/q/29810628
tags question: http://stackoverflow.com/q/29826104
tags question: http://stackoverflow.com/q/29788364
tags question: http://stackoverflow.com/q/29834623
tags question: http://stackoverflow.com/q/29789990
tags question: http://stackoverflow.com/q/29814112
tags question: http://stackoverflow.com/q/29696746
tags question: http://stackoverflow.com/q/29824582
tags question: http://stackoverflow.com/q/29819618
tags question: http://stackoverflow.com/q/29807505
tags question: http://stackoverflow.com/q/29768963
tags question: http://stackoverflow.com/q/29776318
tags question: http://stackoverflow.com/q/29809852
type: Tag
tags question: http://stackoverflow.com/q/29829907
tags question: http://stackoverflow.com/q/29828021
tags question: http://stackoverflow.com/q/29718829
tags question: http://stackoverflow.com/q/29697402
tags question: http://stackoverflow.com/q/29807439
tags question: http://stackoverflow.com/q/29721709

http://stackoverflow.com/comment/47974292
has text: I still couldn't get it to work. Probably because i am loading the controllers dynamically by resolving the controller itself and registering it with angular. I am now calling the calling the states separately.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29839369
type: Comment

http://stackoverflow.com/a/29706225
score: 10
answers question: http://stackoverflow.com/q/29705951
has body: Found an answer in this question: Socket.io Won&#39;t Emit messages to rooms on discconect simply use io.sockets.in(socket.room).emit('chat message', msg);
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/126974014
upvote count: 10

twitter
tags question: http://stackoverflow.com/q/29775335
tags question: http://stackoverflow.com/q/29814250
type: Tag
tags question: http://stackoverflow.com/q/29737107
tags question: http://stackoverflow.com/q/29808668
tags question: http://stackoverflow.com/q/29833592
tags question: http://stackoverflow.com/q/29819877
tags question: http://stackoverflow.com/q/29789767
tag name: twitter
tags question: http://stackoverflow.com/q/29818457

http://stackoverflow.com/a/29780943
has comment: http://stackoverflow.com/comment/47692240
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47692828
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29780779
score: 2
has body: SVG doesn't have a z-index property or similar, the elements are drawn in the order in which they appear in the DOM -- elements higher up are drawn behind elements that have been added afterwards. The easiest way to group elements into layers is to use g elements. So in your example, I would use two g groups, one for the lines and one for the circles. Add the g for the lines first and then all of the lines underneath it. If you then add the circles to the second g that you added afterwards, all circles will always be on top of all lines.
answers question: http://stackoverflow.com/q/29780779

http://stackoverflow.com/a/29807177
downvote count: 0
answers question: http://stackoverflow.com/q/29794911
accepted answer of: http://stackoverflow.com/q/29794911
type: Answer
score: 1
upvote count: 1
has body: I don't know how you'd do it in Coffeescript, but in regular Javascript it would look like below. Hopefully this provides you with a start: //setup var input = document.getElementById('filter'), tree = document.getElementById('tree'), selectedValues = [], items = tree.getElementsByTagName('li'), afterInsert; for (var i = 0; i < items.length; i++) { afterInsert = items[i].firstChild.nextSibling; items[i].setAttribute('data-id', i); items[i].insertBefore(document.createTextNode(' ' + (i+1)), afterInsert); } input.addEventListener('change', function() { selectedValues = input.value.split(','); var count = /[0-9]/g.test(input.value) ? selectedValues.length : items.length; // if input is non-empty if (/[0-9]/g.test(input.value)) { // make the selected values from input of type number and zero-based while (count--) selectedValues[count] = parseInt(selectedValues[count]-1); // THE RECURSIVE FUNCTION function addParent(node) { var index = parseInt(node.getAttribute('data-id')); if (node.nodeName == 'LI') { // only add an index if it's not already present if (selectedValues.indexOf(index) === -1) selectedValues.push(index); addParent(node.parentNode.parentNode); } } for (var i = selectedValues.length; i--;) { addParent(items[selectedValues[i]]); } // if input is empty, set all items to 'selectedValues' } else { while (count--) selectedValues.push(count); } for (var i = items.length; i--;) { if (selectedValues.indexOf(i) !== -1) items[i].style.display = 'list-item'; else items[i].style.display = 'none'; } }, false); Write different numbers as comma-separated into the input field Filter: item item item item item item item item item item item
type: AcceptedAnswer

http://stackoverflow.com/comment/47677205
comment on: http://stackoverflow.com/a/29771489
has text: Okay, what is the problem, I can see dropdown is properly preselected.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29711725
answer count: 4
favorite count: 0
accepted answer: http://stackoverflow.com/a/29711800
has comment: http://stackoverflow.com/comment/47559014
has title: Uncaught ReferenceError: var is not defined
has body: I have two textarea which starts on empty value. Then when I fill the first textarea with id "postcrudo" I want that the next textarea (with id "posthecho") getthe same value as the first, and also show the same. Like a two way binding, like AngularJS, but only with JavaScript and jQuery. This is the JS: and this the HTML: Post crudo: Post pasado: The error in Chrome console is: Uncaught ReferenceError: postCrudo is not defined
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29711785
downvote count: 3
has answer: http://stackoverflow.com/a/29711795
type: Question
upvote count: 0
possible better answer: http://stackoverflow.com/a/29711734
has answer: http://stackoverflow.com/a/29711800
has answer: http://stackoverflow.com/a/29711734
tagged with: javascript
tagged with: jquery
score: -3
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47763447
has text: I have posted an example of a XSS attack that doesn't use any tags. Would your approach filter that one out ?
comment on: http://stackoverflow.com/a/29816977
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/29736744
tagged with: jquery
tagged with: ajax
favorite count: 0
type: UnansweredQuestion
upvote count: 1
has title: clonig google pie chart with jquery triggers XMLHttpRequest error
tagged with: clone
score: 1
has answer: http://stackoverflow.com/a/29736811
type: Question
tagged with: pie-chart
has body: I have a google pie chart which displays correctly on my page. Now I want to clone that chart in another div of my website. It's unfornuately throwing a XMLHttpRequest error : XMLHttpRequest cannot load https://www.google.com/uds/api/visualization/1.0/dca88b1ff7033fac80178eb526cb263e/ui+en.css. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://foodmeup.dev' is therefore not allowed access. How can I overcomethis ? My view : &lt;div id="piechart" style="height: 220px;"&gt;&lt;/div&gt; &lt;div id="profile_completion_graph" class="responsive"&gt; //the div in which I want to clone the graph &lt;/div&gt; &lt;script type="text/javascript"&gt; function drawChart() { var data = google.visualization.arrayToDataTable([ ['Nom', 'Valeur'], ["Profil rempli à ", {{ completeness }}], ['Manque', {{ 100 - completeness }}] ]); var options = { backgroundColor: { fill:'transparent'}, pieSliceBorderColor : 'transparent', pieHole: 0.8, legend: {position: 'top'}, width: 220, height: 220, tooltip: {trigger: 'none'}, pieStartAngle: -90, pieSliceTextStyle :{fontsize : 16, color: 'transparent'}, slices: { 0: { color: '#09b4ff'}, 1: { color: '#444'} }, chartArea : {width: '90%', height: '90%'} }; var chart = new google.visualization.PieChart(document.getElementById('piechart')); chart.draw(data, options); } google.load('visualization', '1', {callback : function(){drawChart();}, 'packages':['corechart']}) &lt;/script&gt; &lt;script&gt; $(function(){ var $graphs = $('#chart_picture').clone(); $('#profile_completion_graph').eq(0).html($graphs); }); &lt;/script&gt;
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47585287
comment on: http://stackoverflow.com/q/29712871
type: Comment
type: QuestionComment
has text: check my answer...mind you I just fixed your plunker. I didn't use an ajax call, but you can do that on your end.
score: 0

http://stackoverflow.com/comment/47807670
type: AnswerComment
comment on: http://stackoverflow.com/a/29840698
type: Comment
has text: I don't really see how this is relevant? I need it to open when a button is pressed. and NOT update the value of the button anywhere
score: 0

http://stackoverflow.com/a/29787591
type: Answer
has body: This uses only css. working demo Add a class to the dropdown ul (.stay-open) &lt;ul class="dropdown-menu stay-open"&gt; then apply style display block with !important .stay-open {display:block !important;}
score: 2
has comment: http://stackoverflow.com/comment/88540823
answers question: http://stackoverflow.com/q/29787358
upvote count: 2
downvote count: 0

http://stackoverflow.com/comment/47715171
type: Comment
has text: @RSKMR ohh, what browser you use?
comment on: http://stackoverflow.com/a/29793164
score: 0
type: AnswerComment

http://stackoverflow.com/q/29809751
has comment: http://stackoverflow.com/comment/47747646
has title: Configure htaccess to bypass direct links to CSS and Javascript Files
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47747752
tagged with: php
tagged with: css
has answer: http://stackoverflow.com/a/29814803
has body: I am currently developing a mini framework which uses a htaccess doc which redirects all traffic from the public folder to another folder. But Ive realized that it also redirects all direct links to images, css and scripts. I am not that familiar with htaccess code, how can I put those exceptions in this htaccess code RewriteEngine on RewriteRule ^((?!public/).*)$ public/$1 [L,NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?cmd=$1 [PT,L] Thanks in advance
has comment: http://stackoverflow.com/comment/47747702
type: Question
has comment: http://stackoverflow.com/comment/47756797
tagged with: apache
tagged with: javascript
tagged with: .htaccess
has comment: http://stackoverflow.com/comment/47747677
score: 0
answer count: 1

http://stackoverflow.com/q/29720283
answer count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47578455
score: 2
has body: I created javascript code for recording audio files. I would like to play a youtube file while recording, so I need to add the play function to my record function, but it dosn't work. What exactly do I miss? mini demo12 record stop play Tracks Log function startRecording(button) { recorder && recorder.record(); button.disabled = true; button.nextElementSibling.disabled = false; __log('Recording...'); }
type: Question
has comment: http://stackoverflow.com/comment/47575747
has title: Play youtube while recording
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47578653
favorite count: 0

http://stackoverflow.com/a/29715359
answers question: http://stackoverflow.com/q/29714638
score: 0
has body: To start with in your plunker there is no model so nothing will get displayed. To display data inside the model you follow the same process as you would to display data else where. × Modal title One fine body… Close Save changes You would then fill add {{object.name}} following your model structure to display the data. For example {{title}} If you're looking to use a form inside your modal then ng-model is the right thing for you and you can use it like this: This will two way bind the name property from your model to the input, which in turn will pre fill the input field. You can read more about ng-model here
type: Answer
has comment: http://stackoverflow.com/comment/47592989
has comment: http://stackoverflow.com/comment/47572285

http://stackoverflow.com/q/29839425
tagged with: asp.net-mvc
tagged with: javascript
has comment: http://stackoverflow.com/comment/47805681
type: Question
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29841266
has comment: http://stackoverflow.com/comment/47811416
has answer: http://stackoverflow.com/a/29842757
possible better answer: http://stackoverflow.com/a/29841266
has comment: http://stackoverflow.com/comment/47805471
has comment: http://stackoverflow.com/comment/47807492
has comment: http://stackoverflow.com/comment/47811517
has title: Image path binding in MVC using knockoutjs
accepted answer: http://stackoverflow.com/a/29842757
tagged with: knockout.js
has body: I wants to display an image in my MVC application using knockoutjs. I am using the following code. Javascript (images.js) function viewModel() { this.ImgPath = ko.observable("~/Content/Images/abcd.JPG"); }; ko.applyBindings(new viewModel()); in View, Also I added the following in my view. But image is not displaying in my application. How to bind the image path to view in mvc using knockout?
has comment: http://stackoverflow.com/comment/47805736
type: AnsweredQuestion

http://stackoverflow.com/q/29783273
tagged with: javascript
tagged with: reactjs-flux
has answer: http://stackoverflow.com/a/29784168
downvote count: 1
favorite count: 0
has body: I develop an application which based on Reactjs and Flux. There is a problem of communication between Stores: ProjectsStore and TasksStore. In the method getAllForCurrentProject of TasksStore, I call ProjectsStore.getCurrentId(). I get an Uncaught TypeError: undefined is not a function as a result. The typeof ProjectsStore is object in getAllForCurrentProject. When I call ProjectsStore.getCurrentId() from any component it works fine. What is the reason for this behavior? In the example MessageStore asks ThreadStore with the same pattern: getAllForCurrentThread: function() { return this.getAllForThread(ThreadStore.getCurrentID()); } My stores: ProjectsStore.js: 'use strict'; var Dispatcher = require('../dispatcher/Dispatcher'); var EventEmitter = require('events').EventEmitter; var assign = require('object-assign'); var _ = require('underscore'); var Api = require('../services/Api'); var ProjectsConstants = require('../constants/ProjectsConstants'); var TasksStore = require('../stores/TasksStore'); var changeEvent = 'projectsChanged'; var current = 0; var items = []; function requestItems() { return Api.Projects.getAll(); } function setItems(data) { items = data; } var ProjectsStore = assign({}, EventEmitter.prototype, { emitChange: function () { this.emit(changeEvent); }, getAll: function () { return items; }, getCurrentId: function() { return current; }, getCurrent: function() { var item = _.where(items, { id: this.getCurrentId() }); return (typeof item[0] == 'object' ? item[0] : null); }, getChildrenOf: function(id, isInclude) { var result = (typeof isInclude == 'boolean' &amp;&amp; isInclude === true ? [id] : []), children = _.chain(items).where({ parent: id }).pluck('id').value(); result.concat(children); return result; } }); ProjectsStore.dispatchToken = Dispatcher.register(function (payload) { var action = payload.action; switch (action.type) { case ProjectsConstants.projectsSetCurrent: current = action.data; break; case ProjectsConstants.projectsGetAll: reque…
has title: Communication between Stores in Reactjs
type: AnsweredQuestion
score: 1
type: Question
upvote count: 2
tagged with: reactjs
answer count: 1
accepted answer: http://stackoverflow.com/a/29784168

http://stackoverflow.com/comment/47596615
type: QuestionComment
comment on: http://stackoverflow.com/q/29731428
has text: Do you want to use AJAX instead of doing normal form submission?
score: 0
type: Comment

http://stackoverflow.com/comment/47817938
has text: in script tag can print them to a javascript variable, use that variable in code above
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29835361

http://stackoverflow.com/a/29714712
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29714663
has body: You are wrong in approach You should use ajax to post 'texts' value to your php script https://api.jquery.com/jquery.post/ and create separate php file where you will get data from ajax post and update DB javascript: &lt;script&gt; function myFunction() { var texts = document.getElementById("content").textContent; $.ajax({ type: "POST", url: "update.php", data: "texsts=" + texts, success: success }); } &lt;/script&gt; update.php &lt;?php include_once 'accounts/config.php'; $text = $_POST['texts']; $tbl_name='enemies'; // Table name $query = "UPDATE enemies SET text=('$text') WHERE id=1"; $result = mysql_query($query) or die(mysql_error()); ?&gt;

http://stackoverflow.com/a/29774486
has comment: http://stackoverflow.com/comment/47679357
score: 0
has comment: http://stackoverflow.com/comment/47679833
type: Answer
answers question: http://stackoverflow.com/q/29773794
has body: I think the problem is that your directive is creating a child scope with its own variable, that does not modify the parent's one. You can check this answer with the same situation. ** Update after the JS String update ** From documentation Working with ng-model The angular-bootstrap-datetimepicker directive requires ng-model and the picked date/time is automatically synchronized with the model value. This directive also plays nicely with validation directives such as ng-required. The angular-bootstrap-datetimepicker directive stores and expects the model value to be a standard javascript Date object. Try to use a DateObject instead of a String So, instead of $scope.model.PayDate === "2015-04-29T22:00:00.000Z"; Use $scope.model.PayDate === new Date("2015-04-29T22:00:00.000Z");
has comment: http://stackoverflow.com/comment/47679441
has comment: http://stackoverflow.com/comment/47680253

http://stackoverflow.com/comment/47650179
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29758791
type: Comment
has text: You have to echo it out so it goes to the browser and can be run. But really, this is a bad idea. Separate your code.

http://stackoverflow.com/a/29728932
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29728673
score: 0
answers question: http://stackoverflow.com/q/29728673
type: Answer
has comment: http://stackoverflow.com/comment/47591980
has comment: http://stackoverflow.com/comment/47591822
has body: On submit event, you need to set 'setSelect' property of the jCrop like this: jcrop_api.setSelect([0,0,ancho,altura]); See this example and you will get more idea: http://deepliquid.com/projects/Jcrop/demos.php?demo=advanced

fluxible
type: Tag
tag name: fluxible
tags question: http://stackoverflow.com/q/29689370

http://stackoverflow.com/comment/47802868
type: Comment
type: QuestionComment
score: 1
has text: where is this javascript running? #activity_overview and #avatar-upload-form are assumed to be in the same frame. However from your question, it seems that activity_verview is a frame which will be accessible from top window and avatar-upload-form is inside upload_avatar frame.
comment on: http://stackoverflow.com/q/29837980

http://stackoverflow.com/q/29741779
tagged with: javascript
has title: Why does this keep triggering multiple alerts?
score: 0
upvote count: 1
answer count: 1
downvote count: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29742219
linked to: http://stackoverflow.com/q/4539253
has comment: http://stackoverflow.com/comment/47617386
type: Question
has body: I'm trying to animate something, and I have this bit of code here: Enemy.prototype.update = function () { var tx = 650 - this.x; var ty = 250 - this.y; var dist = Math.sqrt(tx * tx + ty * ty); this.velx = (tx / dist)* this.speed; this.vely = (ty / dist)* this.speed; var distround = Math.floor(dist); if (distround &gt; 0) { this.x += this.velx; this.y += this.vely; } else if (this.transparency != 0){ alert("You lose!"); location.reload(true); } }; I thought if I had the page refresh after the alert, it'd be okay, but sometimes there are a ton of alert boxes that pop up before it refreshes...how do I stop this? The full code is here: (warning, multiple alerts will be triggered...best not to use safari to open) http://jsfiddle.net/nLxLpvry/

http://stackoverflow.com/comment/77399223
type: Comment
comment on: http://stackoverflow.com/a/29791459
score: 1
has text: If you have more than 2 items in your domain, i.e. `['Alice', 'Bob', 'Carl']` then you may need to use `rangePoints` instead of `range`.
type: AnswerComment

http://stackoverflow.com/comment/47728540
comment on: http://stackoverflow.com/a/29800202
type: AnswerComment
has text: nothing seems "weird" when you're learning how to program, +1 on the answer though
type: Comment
score: 1

http://stackoverflow.com/a/29806041
answers question: http://stackoverflow.com/q/29805690
upvote count: 3
has comment: http://stackoverflow.com/comment/47739942
has body: You can't use document.write() to print on current page. Calling document.write() will automatically call document.open() which clears the current document and thus your present content is cleared. Alternatively you can use an html &lt;div id="result"&gt;&lt;/div&gt; and change it's value like this, document.getElementById("result").innerHTML = "Some Text";
downvote count: 0
type: Answer
score: 3

http://stackoverflow.com/q/29749503
has title: Blocks and execution environments in ES6
has answer: http://stackoverflow.com/a/29749645
type: AnsweredQuestion
type: Question
tagged with: ecmascript-6
answer count: 2
has body: In ES6, each block has associated with is a LexicalEnvironment to support the block-scoping features of that version of the language. Does this mean that in ES6 a new ExecutionContext is instantiated for every block? Reference: http://globaldev.co.uk/2013/09/es6-part-2/ For example (I use the function-scoped var on purpose here): function foo() { { var foo; // Has a new ExecutionContext been instantiated here? } } Relevant bit of the spec: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-block-runtime-semantics-evaluation
tagged with: javascript
score: 0
possible better answer: http://stackoverflow.com/a/29749657
has answer: http://stackoverflow.com/a/29749657
accepted answer: http://stackoverflow.com/a/29749645

http://stackoverflow.com/comment/47800090
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29836344
has text: @user3682248, sry, my bad, please read `console.log`.
score: 0

http://stackoverflow.com/a/78268947
type: Answer
has body: very very old question, but I believe it always worth another answer ;-) const s = '123.2345.123456.34'; function splitString(t) { let a = t.split(/\./); return [a.slice(0, -1).join('.'), a.pop()]; } const [first, last] = splitString(s); console.log(`first: ${first}, last: ${last}`);
answers question: http://stackoverflow.com/q/29825464
score: 0

http://stackoverflow.com/q/29834326
has comment: http://stackoverflow.com/comment/47795393
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: forms
has comment: http://stackoverflow.com/comment/47797232
type: Question
has body: I'm trying to get the focus event listener to fire when a user attempts to enter a P.O. Box into an address field. I'm not able to edit the input for an easy keypress solution. What am I missing in my code that I'm not getting the alert? http://jsfiddle.net/ZQQS9/7/ &lt;input type="text" size="25" maxlength="75" name="ShipAddress1" id="v65-onepage-shipaddr1" value="" style="" onkeydown=""&gt; &lt;script type="text/javascript"&gt; document.addEventListener("focus", function killPObox(id) { var idValue = document.getElementById('v65-onepage-shipaddr1').value; if (id == 'v65-onepage-shipaddr1') { function runVal() { if (idValue.substr(0,4).toUpperCase() === "PO B" || idValue.substr(0,5) === "P.O. ") { alert("USA Light cannot ship to P.O. Boxes. Please enter a street address."); } } setInterval(runVal(),1); } }, true ); &lt;/script&gt;
tagged with: javascript
has title: Focus event listener not firing on uneditable input
upvote count: 1
tagged with: validation
answer count: 1
accepted answer: http://stackoverflow.com/a/29834914
tagged with: dom-events
favorite count: 0
has comment: http://stackoverflow.com/comment/47795433
has comment: http://stackoverflow.com/comment/47795442
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29834914

http://stackoverflow.com/comment/47702980
comment on: http://stackoverflow.com/q/29783097
type: Comment
has text: This seems more appropriate for the dygraphs [issue tracker](https://github.com/danvk/dygraphs/issues) than Stack Overflow.
score: 0
type: QuestionComment

http://stackoverflow.com/a/29823283
has comment: http://stackoverflow.com/comment/47773270
has body: You say you don't want to loop, however don't explain why? I don't think you can avoid a loop if you have an unknown length of array. In your case, a filter may do the trick. Update for clarity This will use a loop in the background. var count = $scope.categories.filter(function(cat) { return cat.checked === true }).length;
upvote count: 4
answers question: http://stackoverflow.com/q/29823125
type: AcceptedAnswer
downvote count: 0
score: 4
type: Answer
has comment: http://stackoverflow.com/comment/47773163
has comment: http://stackoverflow.com/comment/47773385
has comment: http://stackoverflow.com/comment/47773273
has comment: http://stackoverflow.com/comment/47773345
accepted answer of: http://stackoverflow.com/q/29823125

http://stackoverflow.com/q/29806659
has answer: http://stackoverflow.com/a/29809905
upvote count: 1
answer count: 1
has title: Sharing data of a ng-repeat form field across controllers
accepted answer: http://stackoverflow.com/a/29809905
has body: I’m making an order form for a business card with a button to add another business card. I want the button to create another business card form and all the data from the forms to be shared with the controller of another view. I have two templates connected to their respective controllers. order.html, order.js confirm.html, confirm.js Code Samples: order.js .factory('Cards', function () { var Cards = [] return Cards }) .controller('TestCtrl', function ($scope, Cards) { $scope.person0={name: '', email:'', description:''} $scope.person1={name: '', email:'', description:''} if (Cards.length < 2) { Cards.push($scope.person0); Cards.push($scope.person1); } } order.html {{ card.name }} {{ card.email }} {{ card.description }} about.js .controller('AboutCtrl', function ($scope, Cards) { $scope.person0=Cards[0]; $scope.person1=Cards[1]; }); about.html {{card.name}} {{card.email}} {{card.description}} I want the form data from order.html to be displayed on confirm.html The Cards collection gets logged for both views but the ng-repeat templates do not get displayed.
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
tagged with: angularjs
type: Question
tagged with: angularjs-ng-repeat

http://stackoverflow.com/comment/47726245
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29798678
has text: @epascarello - code added , can u have a look at it,
score: 0

http://stackoverflow.com/q/29824453
tagged with: datatables
has comment: http://stackoverflow.com/comment/47776609
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47899908
has title: Resize column of datatable on click of right border of perticular column header
answer count: 0
has body: I'm tring to resize table coloumn on click of right border of column header but i can not figure out how to do it. I have used ColReorderWithResize.js but its adjusting size by attributes not on click of right border of column header $('#example').dataTable({ "scrollY": 400, "scrollX": true, "bPaginate": false, "bFilter": false, "bInfo": false, "responsive": true, "bAutoWidth": true, "sDom": '&lt;"H"lCf&gt;t"H"&lt;"F"iTp&gt;', "aoColumns": [{'sWidth': "30%"}, {'sWidth': "30%"}, {'sWidth': "30%"}, {'sWidth': "30%"}, {'sWidth': "30%"}, {'sWidth': "30%"}, {'sWidth': "30%"}, {'sWidth': "30%"}, {'sWidth': "30%"} ], }); I write this jquery for this but it didnt work properly $('#example').find('thead th').bind("click.MyDT", function(event){ if ($(event.target).css('cursor') === 'col-resize'){ event.cancelBubble = true; event.stopImmediatePropagation(); } }); please give me proper solution for this.
type: Question
tagged with: javascript
tagged with: resize
tagged with: jquery
has comment: http://stackoverflow.com/comment/47775558
score: 0

http://stackoverflow.com/a/29764431
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29764254
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29764254
type: Answer
downvote count: 0
score: 1
has body: you can make 2 table for religion and caste where you can insert religion_Id and religion_Name in religion table and in other caste table make 3 columns caste_Id,religion_Id(foreign key from religion table), and caste_Name and based on religion tables id you can fetch all the caste from second table like below select * from caste where religion_Id='your_religion_id'

http://stackoverflow.com/comment/68857893
type: Comment
comment on: http://stackoverflow.com/a/29843471
has text: @CamC I think it would be useful if you write your comment as an answear. There are a lot of other silly people around the world. (Which includes me...)
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47701382
type: QuestionComment
has text: You say "If I replace...., the error changes to:" but in the quoted block I do not actually see an error message.
comment on: http://stackoverflow.com/q/29785633
score: 0
type: Comment

http://stackoverflow.com/q/29778413
has answer: http://stackoverflow.com/a/29778535
answer count: 5
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29778626
score: 1
has comment: http://stackoverflow.com/comment/47686951
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29778747
tagged with: javascript
has title: Jquery slide down closest div
has comment: http://stackoverflow.com/comment/47686988
linked to: http://stackoverflow.com/q/3623103
has comment: http://stackoverflow.com/comment/47686922
has answer: http://stackoverflow.com/a/29778492
has body: When is pressed it should slide down closest div with clas .notification_pop_up . Could someone give me advice? I think i need to use one of these next() or find() but i have no idea how. Thank u. HTML
downvote count: 0
has answer: http://stackoverflow.com/a/29778493
tagged with: jquery
favorite count: 0
duplicate of: http://stackoverflow.com/q/3623103

http://stackoverflow.com/q/29844090
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47814328
upvote count: 2
score: 1
has comment: http://stackoverflow.com/comment/47814313
has comment: http://stackoverflow.com/comment/47814158
downvote count: 1
type: Question
has body: my code is not working and I have no idea why. Here is a demo $(".color").click(function() { $(".color-picker").fadeIn(function() { var colorClick = $(".color-box").click(); var timeOut = window.setTimeout(1000); if (colorClick || timeOut) { $(".color-picker").hide(); } }); }); EDIT: To clear the confusion - I want to hide the box with the colors when the user clicks on one of them $(".color-box") or on the dropdown $(".color-picker"), or if he doesn't the box should hide anyway in a couple of seconds. Sorry, I thought it was clear from my code. EDIT 2: Using @AlvinMagalona's code I tried to add the timeout functionality with no success demo $(".color").click(function(e) { e.stopPropagation(); $(".color-picker").fadeIn(600); }) .setTimeout(function() { if ( $(".color-picker").css('display') != 'none') { $(".color-picker").hide(); } },3000); $(".color-box").click(function (e) { e.stopPropagation(); $(".color-picker").fadeOut(150); }); OR I think this way is much better, but still doesn't function (demo): $(".color").click(function(e) { e.stopPropagation(); $(".color-picker").fadeIn(600); function timeOut() { setTimeout(function() { if ( $(".color-picker").css('display') != 'none') { $(".color-picker").hide(); } },3000); } }); $(".color-box").click(function (e) { e.stopPropagation(); $(".color-picker").fadeOut(150); }); The other part of the code works fine, but I'm not embedding the setTimeout function properly. Can somebody help me with that? Thanks! EDIT 3: I made it work: (demo) $(".color").click(function(e) { e.stopPropagation(); $(".color-picker").toggle(200); var timeOut = setTimeout(function() { if ( $(".color-picker").css('display') != 'none') { $(".color-picker").hide(); } },6000); }); $(".color-box").click(function (e) { e.stopPropagation(); $(".color-picker").fadeOut(150); }); This one has everything I needed - when you open the drop down and click on color the box hides, when you click on the dropdown again the box hides and if you don't do any of that th…
has answer: http://stackoverflow.com/a/29865049
has comment: http://stackoverflow.com/comment/47821877
has comment: http://stackoverflow.com/comment/47814950
has comment: http://stackoverflow.com/comment/47821831
has comment: http://stackoverflow.com/comment/47814419
tagged with: javascript
tagged with: show-hide
has answer: http://stackoverflow.com/a/29844366
has comment: http://stackoverflow.com/comment/47814459
has comment: http://stackoverflow.com/comment/47814236
answer count: 3
tagged with: jquery
has comment: http://stackoverflow.com/comment/47814345
accepted answer: http://stackoverflow.com/a/29865049
possible better answer: http://stackoverflow.com/a/29844287
favorite count: 0
has answer: http://stackoverflow.com/a/29844287
has title: Dropdown colorpicker with toggle click and timeout

http://stackoverflow.com/comment/47525114
comment on: http://stackoverflow.com/a/29692416
type: Comment
has text: Please share the URL to test
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47608362
score: 0
type: Comment
has text: Of course I know that I shouldn't use JS directly in code behind, I was referring to the `RegisterClientScript` method. What do you mean by including javascript for custom controls?
comment on: http://stackoverflow.com/a/29737497
type: AnswerComment

http://stackoverflow.com/comment/47617736
type: Comment
has text: Added to the answer to make it more visible, thanks! :)
type: AnswerComment
score: 1
comment on: http://stackoverflow.com/a/29738368

http://stackoverflow.com/comment/47943097
comment on: http://stackoverflow.com/a/29763607
type: AnswerComment
has text: Sorry for the delay.. THe query you have raised is dynamic right?? (i.e.,) I want...car.php, WER, Color... for bike... bike.php, XYZ and Serial No.. for Laptop... laptop.php, ABC and Model No... For Place... place.php, KLM and Area... For mobile... mobile.php, FGH, Brand. Everything seems to be based dynamically right??
score: 0
type: Comment

http://stackoverflow.com/comment/47672870
comment on: http://stackoverflow.com/a/29769086
type: AnswerComment
type: Comment
score: 0
has text: I think a standard `for` loop does not seem elegant, though it's the most robust; I would use `.forEach()`. However, as long as nobody messed with the array, `for...in` is a valid approach. ES6's [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) seems even more elegant, and Chrome supports it already.

http://stackoverflow.com/comment/47773868
score: 0
comment on: http://stackoverflow.com/q/29823726
type: Comment
type: QuestionComment
has text: Something like [this question](http://stackoverflow.com/questions/2698725/comparing-date-part-only-without-comparing-time-in-javascript).

http://stackoverflow.com/comment/47570574
score: 0
comment on: http://stackoverflow.com/q/29717928
type: Comment
type: QuestionComment
has text: http://www.w3schools.com/jsref/jsref_concat_string.asp

http://stackoverflow.com/comment/47614186
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29740028
has text: Documentation on Google Charts states it is using HTML5/SVG https://developers.google.com/chart/interactive/docs/index. You are going to have to debug your javascript to figure out what is going on and who is generating the "plugin not supported" error.

http://stackoverflow.com/a/29692243
has body: You can do this: var divs = document.getElementsByTagName("div"); for(var i = 0; i &lt; divs.length; i++) { if(divs[i].id.indexOf('view_') == 0) { divs[i].style.display='none'; } } DEMO
answers question: http://stackoverflow.com/q/29692127
type: Answer
upvote count: 4
downvote count: 0
score: 4

http://stackoverflow.com/a/29718757
type: Answer
accepted answer of: http://stackoverflow.com/q/29715422
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47575634
has body: Looks like your nodejs app redirecting to /home/ after the POST, but didn't aware that it has been proxied and being called with /appname/, you should make your application aware about the namespace. And make it to redirect properly to /appname/home/ instead.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29715422

http://stackoverflow.com/q/29835679
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47798257
has answer: http://stackoverflow.com/a/29835768
downvote count: 1
has answer: http://stackoverflow.com/a/29835761
type: Question
has answer: http://stackoverflow.com/a/29835851
tagged with: if-statement
has comment: http://stackoverflow.com/comment/47798195
accepted answer: http://stackoverflow.com/a/29835761
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47798275
has comment: http://stackoverflow.com/comment/47798280
has body: When a user makes a purchase, I want the site to look for this cookie on my Receipt page and if it's present, then the tag should have 'FIREuni' : 'TRUE'. If the cookie is not present, the tag should have 'FIREuni' : 'FALSE'. But I don't know weather I am using the if statements in the right way. I am fairly new to javascript this is probably my first code, can anybody help me telling where I am making a mistake? function checkCookie() { var src=getCookie("src"); if (src!="") { FIREuni:'TRUE' var TrackObject = { 'CJ' : { 'CID': '12346', 'TYPE': '7865', 'OID': 'ORDERNUMBER', 'CURRENCY':'USD', 'DISCOUNT': '', 'COUPON': '', PRODUCTLIST : [ { 'ITEM': 'item.variant.sku', 'AMT': 'OTOTAL', 'QTY': 'OTY' }, { 'ITEM': 'item.variant.sku', 'AMT': 'OTOTAL', 'QTY': 'OTY' } ] }}; } else { FIREuni:'FALSE' var TrackObject ={ 'UNI' : { 'CID': '', 'TYPE': '', 'OID': '', 'CURRENCY': '', 'DISCOUNT': '', 'COUPON': '', PRODUCTLIST : [ { 'ITEM': '', 'AMT': '', 'QTY': '' } ] } }; } }
tagged with: logical-operators
has title: How does If statement works in Javascript
upvote count: 0
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29835754
favorite count: 0
has answer: http://stackoverflow.com/a/29835754
tagged with: logic
has comment: http://stackoverflow.com/comment/47798228
has comment: http://stackoverflow.com/comment/47798302
has comment: http://stackoverflow.com/comment/47798247

http://stackoverflow.com/a/34460072
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/29755732
downvote count: 0
has body: i am working with gifshot also and i figured out that i need to separately init Image object and add it to the array. Below code is more clear: var images = []; var oneImage = new Image(); oneImage.src = base64ImageString; images.push(oneImage); And then use your code to export the gif image. Hope this post can help you :)
type: Answer

http://stackoverflow.com/a/29825904
has body: I find your suggestion interesting. jqGrid don't allows to make "rn" (created in case of the usage of rownumbers: true option) or "cb" (created in case of the usage of multiselect: true option) columns frozen. As you probably know I develop my fork of jqGrid since last 4 month under the name free jqGrid (see readme and wiki for more details). So I just made the corresponding changes in the code of setFrozenColumns in my fork. The demo demonstrates the feature. The columns "rn" and "cb" have frozen: true column by default. So one need just call setFrozenColumns method to make there frozen: An additional problem with frozen columns is the position and the height of individual rows if not all rows have the same height. For example inline editing can increase the height of row. I fixed the problem too. The next demo uses frozen column with formatter: "action" and the "rownumber" column ("rn" column). One can see that the height of frozen rows will be automatically adjusted on the start or the end of inline editing: So you need just download the latest code of free jqGrid from GitHub to solve your problem.
type: Answer
has comment: http://stackoverflow.com/comment/47785733
accepted answer of: http://stackoverflow.com/q/29820226
upvote count: 1
has comment: http://stackoverflow.com/comment/47783203
has comment: http://stackoverflow.com/comment/47786099
answers question: http://stackoverflow.com/q/29820226
score: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47785122
has comment: http://stackoverflow.com/comment/47785315
has comment: http://stackoverflow.com/comment/47787598
has comment: http://stackoverflow.com/comment/47782568
has comment: http://stackoverflow.com/comment/47785458

http://stackoverflow.com/comment/47610562
score: 2
comment on: http://stackoverflow.com/q/29738684
type: Comment
type: QuestionComment
has text: `getData()` doesn't have a `return` statement of its own. The `return data` instead applies only to the callback, `function(data)`. Though, `$http` is also asynchronous, meaning `getData()` doesn't wait for `data` to become available -- [How to return the response from an asynchronous call?](http://stackoverflow.com/questions/14220321/how-to-return-the-response-from-an-asynchronous-call) Note especially the mentions of Promises (`.then()`-ables).

http://stackoverflow.com/a/37055626
type: Answer
has comment: http://stackoverflow.com/comment/96458802
upvote count: 5
score: 5
downvote count: 0
has body: I know this is a bit of a late post, but hopefully it might help others if they stumble across it. I was in exactly the same boat: using a WebBrowser control with compatibility set to IE11 was causing OpenLayers 3 to ignore mouse button clicks when displaying 2D maps. I tried CefSharp 3, and sure enough it resolves the problem, but there are other reasons why that can't be used for me. After lots of trial and error, I stumbled across this as a workable solution: &lt;meta http-equiv="X-UA-Compatible" content="IE=11" /&gt; &lt;script&gt; if (navigator.appVersion.indexOf("MSIE 7.") !== -1) { delete window.PointerEvent; window.navigator.msPointerEnabled = false; } &lt;/script&gt; This needs to be on the page before the inclusion of ol.js. It's a crude test of whether the page is running in a WebBrowser control admittedly, but should suffice now that IE7 is no longer supported. The only real instance of "MSIE 7." in the user agent string will be from a default WebBrowser control. I've not found any other OpenLayers problems as yet.
answers question: http://stackoverflow.com/q/29752190

http://stackoverflow.com/a/29841723
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/47815391
has body: You need to make dummy history to disable history back button. var originalHash = document.hash || "#dummyMain" location.assign("#dummyBack") location.assign(originalHash) window.addEventListener("popstate",function(){ if(location.hash == "#dummyBack"){ window.history.pushState(null,null,originalHash) }else{ originalHash = location.hash } }); The code above create dummy page history and checks if page transitions are occurred via history back button or not and if so,force page move to current page again to stop history back action. Since You didn't put any code in the question,It's hardly possible to say it will work or not but I guess once you load this code,it should disable all page back action. If you are using PC/Mac to use this site,please try to open developper tools/firebug javascript console and copy/paste the code and press history back button to see how it works.
has comment: http://stackoverflow.com/comment/47815253
has comment: http://stackoverflow.com/comment/47810754
answers question: http://stackoverflow.com/q/29841241

http://stackoverflow.com/a/29782213
has comment: http://stackoverflow.com/comment/47694527
has comment: http://stackoverflow.com/comment/47694470
upvote count: 0
has body: it is onclick not onClick in javascript , that is the issue DEMO: http://jsfiddle.net/6fm0j8uq/4/ 7 8 9
type: Answer
has comment: http://stackoverflow.com/comment/47694494
has comment: http://stackoverflow.com/comment/47694453
downvote count: 2
has comment: http://stackoverflow.com/comment/47694409
score: -2
answers question: http://stackoverflow.com/q/29782006
has comment: http://stackoverflow.com/comment/47706114

http://stackoverflow.com/a/29800234
has body: queue and dequeue operates on selector. any function that doesn't need html element will work with $. like $.ajax()
score: 1
has comment: http://stackoverflow.com/comment/47728542
downvote count: 0
answers question: http://stackoverflow.com/q/29799544
type: Answer
upvote count: 1

http://stackoverflow.com/tag/svg
tags question: http://stackoverflow.com/q/29841736
tags question: http://stackoverflow.com/q/29819698
tags question: http://stackoverflow.com/q/29714789
tags question: http://stackoverflow.com/q/29828408
tags question: http://stackoverflow.com/q/29719477
tags question: http://stackoverflow.com/q/29831243
tags question: http://stackoverflow.com/q/29794689
tags question: http://stackoverflow.com/q/29736451
tags question: http://stackoverflow.com/q/29704104
tags question: http://stackoverflow.com/q/29713474
tags question: http://stackoverflow.com/q/29747373
tags question: http://stackoverflow.com/q/29723379
tags question: http://stackoverflow.com/q/29784294
tags question: http://stackoverflow.com/q/29704936
tags question: http://stackoverflow.com/q/29755271
tags question: http://stackoverflow.com/q/29803962
tags question: http://stackoverflow.com/q/29735964
tags question: http://stackoverflow.com/q/29793689
tags question: http://stackoverflow.com/q/29694929
tags question: http://stackoverflow.com/q/29717765
tags question: http://stackoverflow.com/q/29732802
tags question: http://stackoverflow.com/q/29798182
tag name: svg
tags question: http://stackoverflow.com/q/29702838
tags question: http://stackoverflow.com/q/29763483
tags question: http://stackoverflow.com/q/29717373
tags question: http://stackoverflow.com/q/29694415
tags question: http://stackoverflow.com/q/29718887
tags question: http://stackoverflow.com/q/29707458
tags question: http://stackoverflow.com/q/29725377
tags question: http://stackoverflow.com/q/29771495
tags question: http://stackoverflow.com/q/29801020
tags question: http://stackoverflow.com/q/29840214
tags question: http://stackoverflow.com/q/29739610
tags question: http://stackoverflow.com/q/29739838
tags question: http://stackoverflow.com/q/29718466
tags question: http://stackoverflow.com/q/29833384
tags question: http://stackoverflow.com/q/29798252
tags question: http://stackoverflow.com/q/29829277
tags question: http://stackoverflow.com/q/29709262
tags question: http://stackoverflow.com/q/29702027
tags question: http://stackoverflow.com/q/29754815
tags question: http://stackoverflow.com/q/29759957
tags question: http://stackoverflow.com/q/29693416
tags question: http://stackoverflow.com/q/29734397
tags question: http://stackoverflow.com/q/29833238
tags question: http://stackoverflow.com/q/29726652
tags question: http://stackoverflow.com/q/29761825
tags question: http://stackoverflow.com/q/29727950
tags question: http://stackoverflow.com/q/29763664
tags question: http://stackoverflow.com/q/29798288
tags question: http://stackoverflow.com/q/29792646
tags question: http://stackoverflow.com/q/29738930
tags question: http://stackoverflow.com/q/29800596
tags question: http://stackoverflow.com/q/29741416
tags question: http://stackoverflow.com/q/29836676
tags question: http://stackoverflow.com/q/29812837
tags question: http://stackoverflow.com/q/29697426
tags question: http://stackoverflow.com/q/29705366
tags question: http://stackoverflow.com/q/29694070
tags question: http://stackoverflow.com/q/29758746
tags question: http://stackoverflow.com/q/29829058
type: Tag

http://stackoverflow.com/q/29740372
has comment: http://stackoverflow.com/comment/47633201
has comment: http://stackoverflow.com/comment/47632116
favorite count: 0
has comment: http://stackoverflow.com/comment/47620737
has comment: http://stackoverflow.com/comment/47621636
has comment: http://stackoverflow.com/comment/47622984
has comment: http://stackoverflow.com/comment/47632300
has comment: http://stackoverflow.com/comment/47620665
type: UnansweredQuestion
has title: Jqgrid subgrid not expanding on first load
has comment: http://stackoverflow.com/comment/47616561
tagged with: php
has comment: http://stackoverflow.com/comment/47658827
upvote count: 15
has comment: http://stackoverflow.com/comment/47620847
has body: I have a Jqgrid with two subgrids and a groupingView(), when my data is loaded from the server into the grid my subgrid does not want to expand. Only when I page or click the refresh button the subgrid does expand, or when I set loadonce:false or take out the groupingView() it wil expand and everything is working fine, but then my export to excel is not showing any data. I want my subgrid to expand when the data is loaded for the first time, not after I refresh or page! I have have tried: $MyGrid.jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); and also tried making a trigger to fire the refresh button on loadComplete() *$(".ui-icon-refresh").each(function () { $(this).trigger("click"); });* This trigger button does work when it's clicked, but it does not fire automatically in the loadComplete() function. Here is my Javascript: function CreateOrdSummaryTable() { if ($("#DataTab_2").length === 0) { $("#tdBotRight").html(" " + " "); } var $tableOrdSummary = $("#DataTab_2"); $tableOrdSummary.jqGrid({ url: '/Ord/WS/OrderWebSummary.php', colNames: ["Sum of Order Mass","Customer", "Case", "Associated Mass" ,"Order Mass","Invoiced Mass","Shipped Mass","FGI Mass"], colModel: [ { name: "ORDITM", index: "ORDITM", resizable: true, width: 120}, { name: "CUSTOMER", index: "CUSTOMER", resizable: true, width: 250}, { name: "CASES", index: "CASES", summaryTpl: "Order Group Total:", summaryType: "sum", resizable: true, width: 250}, { name: "ASSMASS", index: "ASSMASS", summaryTpl: "{0}", summaryType: "sum", resizable: true, width: 165, formatter: "integer"}, { name: "ORDMASS", index: "ORDMASS", summaryTpl: "{0}", summaryType: "sum", resizable: true, width: 115, formatter: "integer"}, { name: "DIST", index: "DIST", summaryTpl: "{0}", summaryType: "sum", resizable: true, width: 130, formatter: "integer"}, { name: "WIP", index: "WIP", summaryTpl: "{0}", summaryType: "sum", resizable: true, width: 130, formatter: "integer"}, { name: "MDB", index: "MDB", summaryTpl: "{0}", …
has comment: http://stackoverflow.com/comment/47625170
has comment: http://stackoverflow.com/comment/47622773
has answer: http://stackoverflow.com/a/35038115
has comment: http://stackoverflow.com/comment/47634770
has comment: http://stackoverflow.com/comment/47621358
downvote count: 0
has comment: http://stackoverflow.com/comment/47625225
type: Question
has comment: http://stackoverflow.com/comment/47626311
has comment: http://stackoverflow.com/comment/47627167
has comment: http://stackoverflow.com/comment/47616945
has comment: http://stackoverflow.com/comment/47632599
has comment: http://stackoverflow.com/comment/47622501
tagged with: jqgrid
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47616698
has comment: http://stackoverflow.com/comment/47636450
score: 15
has answer: http://stackoverflow.com/a/32313351
answer count: 2

http://stackoverflow.com/q/29694929
answer count: 1
has answer: http://stackoverflow.com/a/29696625
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
tagged with: angularjs
type: UnansweredQuestion
has title: Angular SVG Directive Unexpected Token
downvote count: 0
score: 1
has body: I'm creating an Angular directive which wraps around the SVG line element as part of a larger component. I started splitting up the constituent parts of the full SVG into smaller sections and the line directive is throwing syntax errors. /** * @name triadLine * @type directive * @overview */ .directive('triadLine', function(TriadConfig) { return { restrict: 'E', replace: true, scope: { x1: '=', y1: '=', x2: '=', y2: '=' }, link: function(scope) { scope.config = TriadConfig; }, template: "&lt;line " + "ng-attr-x1='{{x1}}'" + "ng-attr-y1='{{y1}}'" + "ng-attr-x2='{{x2}}'" + "ng-attr-y2='{{y2}}'" + "style='stroke:{{config.line.stroke}}'&gt;" + "&lt;/line&gt;" }; When the directive is compiled, Angular throws the following error: Error: [$parse:syntax] Syntax Error: Token '{' is an unexpected token at column 3 of the expression [0 {{x1}}] starting at [{{x1}}]. The problem isn't unique to the first binding either. If I remove that first line, the same problem is thrown for y1. If I remove the ng-attr- lines, then I can see that the values are passed down correctly. { ... config: Object x1: 300 x2: 300 y1: 80.3847577293368 y2: 340.1923788646684 ... } Have I missed some edge case about how Angular attribute directives work with SVGs?
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/21171502
upvote count: 1

http://stackoverflow.com/comment/62625494
has text: @hakuna1811 you should add this as a separate answer. Took too long for me to find your comment.
comment on: http://stackoverflow.com/a/29839821
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29761827
has title: Can't display content page in state with Angular UI Router
tagged with: javascript
has body: I'm beginner in AngularJS and I have a problem when use Angular UI Router. index.html login.html Login page content And in my $stateprovider... .config(function($stateProvider, $urlRouterProvider,$locationProvider) { $stateProvider .state('app', { url: "/app", abstract: true, templateUrl: "views/app.html", controller: "AppController" }).state('app.login', { url: "/login", templateUrl: "views/login.html", controller: "LoginController" }); $urlRouterProvider.otherwise('/login'); }) It can't display a content of login.html page. But when i change state from app.login to login. It can be displayed. How should i do now?
tagged with: angularjs
type: UnansweredQuestion
type: Question
tagged with: angular-ui-router
has answer: http://stackoverflow.com/a/29762165
score: 0
answer count: 1

http://stackoverflow.com/comment/47637379
type: AnswerComment
score: 0
has text: 3)A normal http request makes synchronous call whereas ajax makes asynchronous calls
type: Comment
comment on: http://stackoverflow.com/a/29730519

http://stackoverflow.com/q/29761977
accepted answer: http://stackoverflow.com/a/29762101
favorite count: 0
upvote count: 2
has body: I wrote the following code: var Request = require('./request'); function Treasure(id) { Treasure.prototype.valid = false; Treasure.prototype.id = id; Treasure.prototype.contentLength = 0; Treasure.prototype.title = null; Treasure.prototype.seller = null; Treasure.prototype.buyer = null; Treasure.prototype.cost = 0; } Treasure.prototype.loadData = function() { EpvpRequest.treasureRequest(Treasure.prototype.id, function(data) { if (data.valid) { Treasure.prototype.valid = data.valid; Treasure.prototype.contentLength = data.contentLength; Treasure.prototype.title = data.title; Treasure.prototype.seller = data.seller; Treasure.prototype.buyer = data.buyer; Treasure.prototype.cost = data.cost; } }); } module.exports = Treasure; Please don't hit me, I just started learning javascript. I want ot access the properties of "Treasure"; but I can't use this, because I have a callback in the loadData function and this would refer to the function which called the callback - is that correct? But it seems that I can't access the properties the way I tried with Treasure.prototype.property. What is the correct way to to this?
has comment: http://stackoverflow.com/comment/47656368
score: 2
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11922383
has answer: http://stackoverflow.com/a/29762101
has title: Access object property within a callback
type: Question
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47685531
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29777620
type: Comment
has text: yes, just saw he wants to delay the data by 3s, i dont understand why as well, but yeah you're right.

http://stackoverflow.com/comment/47539313
has text: Including your php file in the html will solve this problem: http://php.net/manual/en/function.include.php
comment on: http://stackoverflow.com/q/29701738
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29720194
has body: You could create your own "DataLayer" by creating a dedicated tag declarating an array but this personal DataLayer could not be use in triggers. To cover that, you can use another tag with a test (if array contains X then function ...), but I could not see how that is better than your scenario 1. If you do that, be sure to use tag priorities so the first tag is triggerred first.
has comment: http://stackoverflow.com/comment/47621929
has comment: http://stackoverflow.com/comment/47589600
answers question: http://stackoverflow.com/q/29699206
score: 0
type: Answer

http://stackoverflow.com/a/29720885
score: 1
has comment: http://stackoverflow.com/comment/47576379
upvote count: 1
has body: What is the type of var? var has no type. It's a keyword used to declare variables. Is the type assigned only after a value is assigned to a variable? When you declare a variable but don't assign any value to it, its value will be undefined, whose type is Undefined. Does var b = 1 overwrite the previous statement var b = 10? Or just the variable b? Variable statements are hoisted to the top. That means that those are equivalent: // ... var b = 10; if(cond) var b = 1; var b; // ... b = 10; if(cond) b = 1; So, since b was already declared, var b = 1 will be equivalent to b = 1. Is let a non-standard language feature? I read here that it is supported in ECMAScript 6. let was introduced in JavaScript 1.7, and was not part of any ECMA-262 standard at the time. Now ECMAScript 6 has standardized it (in a bit different way than JS 1.7). However, be aware that ECMAScript 6 is still a draft.
accepted answer of: http://stackoverflow.com/q/29720494
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29720494
has comment: http://stackoverflow.com/comment/47576474
type: Answer

http://stackoverflow.com/a/29789857
has body: You gotta check your Console first. If it can't find the resource (404 HTTP Response Code), there is something wrong with your URL. You can definitely use relative Paths with an ajax call. I only wonder why do you start with 2 dots? If you don't get a 404 try to use your method like this: function transmitToBackend(weights, subfeatures) { $.post("/Backend/StartFeasibilityAnalysis.php", { features: JSON.stringify(weights), subfeatures: JSON.stringify(subfeatures) }, function(data){ convertData(data); }); }
has comment: http://stackoverflow.com/comment/47720822
type: Answer
answers question: http://stackoverflow.com/q/29789506
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/a/29720375
has body: You could simply use ng-if="!names", also for more better you maintain a flag which will give you information about data fetching ajax done or not. & that could be very useful while No data found div Controller var customersController($scope, $http) { $scope.dataLoaded = false; //data loading done or not $http.get("https://tic.com/testingservice/HttpService.svc/operator/Var1/Var2") .success(function(response) { $scope.dataLoaded = true; $scope.names = response; }); } app.controller('customersController', ['$scope', '$http', customersController]); Markup AMOUNT TALKTIME VALIDITY DESCRIPTION No data found Data is loading {{ x.Amount }} {{x.Talktime }} {{ x.Validity }} {{ x.Description}} Working Plunkr Update Additionally you could do add one more flag which would give you information about ajax in addition with names you could use dataLoaded flag. While ajax is in progress set dataLoaded value to false, after completion of ajax set dataLoaded to true. You could show or hide any div on your html by using ng-show, ng-hide or ng-if directive. Only you need to specify expression value in it, depends on expression value true/false it will show/hide that div element. As in above example I used ng-if="dataLoaded && (!names || names.length === 0)" which evaluated the expression and will show that div only when ajax is completed & names array does have value or its length is Zero(0)
has comment: http://stackoverflow.com/comment/47575902
upvote count: 2
has comment: http://stackoverflow.com/comment/47576441
has comment: http://stackoverflow.com/comment/47576521
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47576525
type: Answer
answers question: http://stackoverflow.com/q/29720286
has comment: http://stackoverflow.com/comment/47576111
has comment: http://stackoverflow.com/comment/47638031
score: 2
accepted answer of: http://stackoverflow.com/q/29720286
downvote count: 0
has comment: http://stackoverflow.com/comment/47575801
has comment: http://stackoverflow.com/comment/47576502
has comment: http://stackoverflow.com/comment/47612734

http://stackoverflow.com/q/29733057
has title: Show my result on modal on Ionic
type: Question
tagged with: javascript
tagged with: ionic-framework
score: 0
answer count: 1
tagged with: angularjs
has body: I would like to fetch my generated JSON result on a modal. May I know how can I do it? At the moment I can't get the modal to slide in when there's result. It shows TypeError: $scope.modal is undefined .controller('formcontrol', function($scope, $http, $ionicLoading, $ionicModal){ $scope.show = function() { $ionicLoading.show({ template: 'Loading...' }); }; $scope.search = function(data){ if($scope.fsearchr.$pristine){ alert('Nothing to search.'); }else{ data = { 'text' : $scope.searchr.text, }; $ionicLoading.show({template:'Searching....'}); $http.post( l + 'search.php', data). success(function(data, status, headers, config) { $ionicModal.fromTemplateUrl('#/tab/result.html', function($ionicModal) { $scope.modal = $ionicModal; }, { scope: $scope, animation: 'slide-in-up', }); console.log('show the freaking modal'); $ionicLoading.hide(); //$scope.modal.show(); }). error(function(data, status, headers, config) { // called asynchronously if an error occurs // or server returns response with an error status. alert('Error. No result.'); }); } } })
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29733403

http://stackoverflow.com/comment/47553418
has text: thanks for your response, worked for me. But i figured our that is possible to identify the request type, because Play Framework has a MimeType Class. Do you know the way to create a switch clause in java to tell Play ok if MimeType.Json do this if is MimeType.HTML do another?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29708095
type: Comment

http://stackoverflow.com/comment/47529362
has text: Thank you! This is exactly it, it helped me to solve it.
score: 1
comment on: http://stackoverflow.com/a/29696222
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29807928
has comment: http://stackoverflow.com/comment/47756065
type: Answer
has comment: http://stackoverflow.com/comment/47876132
has comment: http://stackoverflow.com/comment/47888551
has comment: http://stackoverflow.com/comment/47745662
has comment: http://stackoverflow.com/comment/47875064
answers question: http://stackoverflow.com/q/29807356
has comment: http://stackoverflow.com/comment/47855228
score: 0
has comment: http://stackoverflow.com/comment/48020149
has comment: http://stackoverflow.com/comment/47770723
has body: The background is set on flashers element. And this is descendant from body. So it is dimensioned to the full dimension of body. But body height is dimensioned as 100%, so it is dimensioned according to the html dimension, that at the end is the dimension of the browser window. But when you are scrolling, the bottom of the screen is on the bound element, that is sized according to its content, and that, in small browser sizes, has a height greater than body. you could try to make body adapt to bound, but probably the best solution is to make flashers descendant of bound Haven't succeeded fully, that's the best I have got : fiddle .main_box { position: relative; padding-left: 50px; padding-right: 50px; z-index: auto; } .main_box:after { content: ""; position: absolute; left: 0px; top: 0px; right: 0px; height: 110%; z-index: -9; opacity: 0; transition: opacity 1s; margin-left: -30px; margin-right: -30px; background-origin: border-box; background-size: cover; background-color: green; background-clip: border-box; } .main_box.active:after { opacity: 1; } .green:after { background-image: url('http://s8.postimg.org/xj53t3d91/green.jpg'); }

http://stackoverflow.com/a/29778325
has body: Try changing your callback to use .html() instead of replaceWith(): (in your original code) success: function(html){ //$("#tweet").val(''); //$("#preview").hide(); $("#RePromoteReplace").html(html); alert('Product Successfully Loaded!!! Edit(Optional) &amp; Click Promote Button in bottom section') } I also recommend changing your selector to a class instead of an ID, you can do this by just adding an extra class in your HTML: &lt;div class="box box-warning promoReplace" id="RePromoteReplace"&gt; and then updating the selector in your success callback: $(".promoReplace").html(html); Sidenote: For debugging, its usually easier to use console.log() instead of alert() (when using ajax, you usually would have the console open anyway)
accepted answer of: http://stackoverflow.com/q/29777189
score: 4
answers question: http://stackoverflow.com/q/29777189
type: AcceptedAnswer
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/47687323
downvote count: 0
has comment: http://stackoverflow.com/comment/47687651

http://stackoverflow.com/q/29842802
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47811890
tagged with: http-redirect
has answer: http://stackoverflow.com/a/29842939
has comment: http://stackoverflow.com/comment/47812179
tagged with: php
has comment: http://stackoverflow.com/comment/47812775
has comment: http://stackoverflow.com/comment/47813160
has comment: http://stackoverflow.com/comment/47811934
has comment: http://stackoverflow.com/comment/47811950
has title: Why Page is not redirected using javascript on using window.location and window.location.href
has comment: http://stackoverflow.com/comment/47813433
has comment: http://stackoverflow.com/comment/47813659
has comment: http://stackoverflow.com/comment/47820373
has comment: http://stackoverflow.com/comment/47811893
type: Question
has comment: http://stackoverflow.com/comment/47812044
has comment: http://stackoverflow.com/comment/47812020
has comment: http://stackoverflow.com/comment/47813112
tagged with: javascript
has comment: http://stackoverflow.com/comment/47812577
has answer: http://stackoverflow.com/a/29843102
has body: I am using a login system for my website. What I am doing is that when the user clicks the submit button an ajax request is being executed to target php script which logs in the user and if user is logged in successfully then echo's back the message "login_successful" to the ajax request. By using if statement I check whether the message is "login_successful" else display the error. If the message is "login_successful" the script redirect the user to the new page 'user.php' by using window.location = 'user.php'; //I have also tried this. window.location.href = 'user.php'; But it doesn't work It simply stays on the login page and nothing happens. but when i check the page source after logging in but no redirection takes place then i got a surprise that the source of the page is for user.php instead of login.php. Somehow window.location hasn't redirected the page but bring the source of user.php to login.php. It's all messed up and I couldn't solve the problem. Here is the login function which performs the ajax request and then redirect the user- function login() { var e = _("email").value;// Grab the email input by the user. var p = _("password").value;// Grab the password input by the user. if(e === "" || p === "")// Check if they are empty. { _("status").innerHTML = "Fill out all the form data";//Display error message if fields are empty. } else { _("loginbtn").style.display = "none";// Hide the login button _("status").innerHTML = 'please wait ...';//Tell the user to wait while the script works. // Below id another function which is defined in other js file. var ajax = ajaxObj("POST", "login.php"); //start the ajax request. ajax.onreadystatechange = function()// Wait for the request to be complete { if(ajaxReturn(ajax) === true) // Ensures if the response is recieved { var response = ajax.responseText;// Put the response in a variable if(response === 'login_successful')// Check if user is logged in succesfully. { window.location = 'user.php';//Redirect the user to…
tagged with: ajax
score: 0
linked to: http://stackoverflow.com/q/2345807
has comment: http://stackoverflow.com/comment/47811959
has comment: http://stackoverflow.com/comment/47811757
has answer: http://stackoverflow.com/a/29843111
has answer: http://stackoverflow.com/a/29843695
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47811921
has comment: http://stackoverflow.com/comment/47812434
has comment: http://stackoverflow.com/comment/47812058
answer count: 4
has comment: http://stackoverflow.com/comment/47812877
has comment: http://stackoverflow.com/comment/47811870
has comment: http://stackoverflow.com/comment/47811961

http://stackoverflow.com/q/29833731
downvote count: 0
answer count: 1
tagged with: jquery
tagged with: mobile-development
favorite count: 0
has title: How to call the iOS search button with javascript/Jquery?
accepted answer: http://stackoverflow.com/a/29846222
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
upvote count: 3
type: Question
score: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/29846222
has body: I've got an searcharea where I've used &lt;form&gt;&lt;input name="search"/&gt;&lt;/form&gt; which enables and shows the search button on iOS mobile keyboard. My question is now, how can i find this search button in code so that i could add an onclick="(callFunction)" for example like i would be able to do if I had created an button myself. Any help or input highly appreciated, thanks!

http://stackoverflow.com/q/29720988
has title: XMLHttpRequest cannot load and Uncaught NetworkError
downvote count: 0
favorite count: 0
type: Question
tagged with: php
has comment: http://stackoverflow.com/comment/47576589
linked to: http://stackoverflow.com/q/7683596
upvote count: 3
answer count: 1
has comment: http://stackoverflow.com/comment/47576573
has answer: http://stackoverflow.com/a/29721028
tagged with: javascript
tagged with: jquery
tagged with: ajax
tagged with: proxy
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29721028
score: 3
has body: I'm working on a clientside project with jquery and javascript along with using jquery plugins. Our professor provided us with a proxy.php file to pull in data that we need to run the web app. I used the easy tab plugin which imported the jquery.min.js file. But I keep getting an error and the proxy.php file fails to load. Here is the proxy.php file. &lt;?php error_reporting(0); define ('HOSTNAME', 'http://simon.ist.rit.edu:8080/Services/resources/ESD'); if($_POST['path']){ $hold=explode('?',$_POST['path']); $path=$hold[0]; $post=$hold[1]."&amp;ip=".$_SERVER['REMOTE_ADDR']; $url= HOSTNAME.$path; $session = curl_init($url); curl_setopt($session, CURLOPT_HEADER, false); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); curl_setopt($session,CURLOPT_POST,1); curl_setopt($session,CURLOPT_POSTFIELDS,$post); }else{ $url=HOSTNAME.$_GET['path']; $session = curl_init($url); curl_setopt($session, CURLOPT_HEADER, false); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); } $xml = curl_exec($session); header("Content-Type: text/xml"); echo $xml; curl_close($session); ?&gt; These are the errors I keep getting. How do I fix this? XMLHttpRequest cannot load file:///C:/Users/Kubra/Desktop/Project2/proxy.php ?path=%2FCities%3Fstate%3DNY&amp;_=1429379822193. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. jquery.min.js:6 Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///C:/Users/Kubra/Desktop/Project2 /proxy.php? path=%2FCities%3Fstate%3DNY&amp;_=1429379822193'.

http://stackoverflow.com/q/29808510
tagged with: javascript
has answer: http://stackoverflow.com/a/29808607
score: 0
tagged with: random
duplicate of: http://stackoverflow.com/q/9719434
answer count: 1
tagged with: arrays
has body: I have an array such as: array=['a','b','c','d','e','f']; I want to delete a random 2 elements. How can I do this?
has comment: http://stackoverflow.com/comment/47745209
linked to: http://stackoverflow.com/q/9719434
type: UnansweredQuestion
has title: Delete random objects from array
type: Question

http://stackoverflow.com/comment/47809391
comment on: http://stackoverflow.com/a/29840463
has text: a tip, use a color scale `var escala=d3.scale.linear().domain([0, mydata2.data]).range(mycolor)` and `.style("fill", function(d) { return escala(mydata2.data); })` **(BTW fill is style, not attr, at least not in all browsers)**
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47717000
type: Comment
comment on: http://stackoverflow.com/a/29791159
has text: Your's isn't that far off though, and for most cases guessing the width of the font as you have done would be sufficient. You could probably improve your version (at least for modern browsers) using this new measure (if you're interested) https://developer.mozilla.org/en/docs/Web/CSS/length#ch
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47555359
type: QuestionComment
type: Comment
score: 0
has text: With the photos I was attempting to illustrate to tribe my reasoning on why that usage of absolute positioning was not applicable to what I was aiming to achieve, regardless of % value or other etc. I'm not saying there is not a solution involving absolute positioning, but I can't see how because having the (landscape) photograph fill the full screen is part of the premise of the design. I have considered whether achieving this full screen effect in a different way will open doors to the specific positioning I'm trying to achieve (ie: placing text on photographic content which covers browser)
comment on: http://stackoverflow.com/q/29706100

http://stackoverflow.com/comment/47524436
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29693663
has text: i did this, but same result, still it is redirected to cart page
score: 0

http://stackoverflow.com/comment/47540390
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29701652
type: Comment
has text: Yup, that did the trick! The scrolling code was inside of another function, now I've put it outside of it works like it should. Thanks!

http://stackoverflow.com/a/29734886
score: 0
answers question: http://stackoverflow.com/q/29734815
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29734815
type: Answer
has body: You simply need to divide by 100 to turn the cents you get into dollars, then add commas and the pound sign. Here is an in-depth answer which covers how to format the number as money: How can I format numbers as money in JavaScript?
has comment: http://stackoverflow.com/comment/47602866
has comment: http://stackoverflow.com/comment/47602958
has comment: http://stackoverflow.com/comment/47602902

http://stackoverflow.com/comment/47530923
type: QuestionComment
has text: @SheldonNeilson alert(value); doesn't work "undefined"
comment on: http://stackoverflow.com/q/29697360
score: 0
type: Comment

http://stackoverflow.com/q/29712189
upvote count: 2
type: UnansweredQuestion
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/29712233
answer count: 4
score: 2
has body: I'm following a tutorial on a TODO-application using Rails 4.2.1 on my local environment. The problem: /task.1, but it should be /task/1. is solve by Nithin. Also I edited "resource :tasks" to ":task" in config/routes.rb. And these solved the "edit" issue!!! But still get some kind of routing error on "delete". Why? Tasks_controller class TasksController < ApplicationController respond_to :html, :js # GET /tasks # GET /tasks.json def new @task = Task.new render :show_form end # POST /task # POST /task.json def create @task = Task.create(task_params) @tasks = Task.all end # GET /task # GET /task.json def edit @task = Task.find(params[:id]) render :show_form end # DELETE /task # DELETE /task.json def destory @task = Task.find(params[:id]) @task.destroy @tasks = Task.all end private def task_params params.require(:task).permit(:title, :note, :completed) end end _task_list.html.erb <% if @tasks.empty? %> There are no tasks! <% else %> Title Created at Completed Actions <% @tasks.each do |task| %> <%= task.title %> <%= task.created_at %> <%= task.completed %> <%= link_to "Delete", task_path(id: task.id), method: :delete, remote: true, data: { confirm: "Are you sure you want to delete task #{task.title}?" }, class: "btn btn-primary" %> <%= link_to "Edit", edit_task_path(id task.id), remote: true, class: "btn btn-primary" %> <% end %> app/views/pages/home.html.erb <%= render 'tasks/task_list', locals: {task: @task} %> destroy.js.erb $('#task-list').html('<%= j(render 'task_list', locals: {task: @task} )%>'); edit.js.erb m = $('#modal'); m.html('<%= j(render 'task_form', locals: {task: @task}) %>'); m.modal('show'); $('#modal').integrateDatepicker(); config/routes.rb Rails.application.routes.draw do # Tasks resource :tasks, only: [:new, :create, :edit, :destory] root to: 'pages#home' end Logs: delete Started DELETE "/task?id=1" for 127.0.0.1 at 2015-04-18 12:00:33 +0700 ActionController::RoutingError (No route matches [DELETE] "/task"): actionpack (4.2.1) lib/action_dispatc…
has comment: http://stackoverflow.com/comment/47560284
type: Question
has title: ActionController::RoutingError (No route matches [DELETE] "/tasks.1")
tagged with: javascript
has answer: http://stackoverflow.com/a/41883961
has answer: http://stackoverflow.com/a/29713045
tagged with: rails-routing
tagged with: ruby-on-rails-4
downvote count: 0
has answer: http://stackoverflow.com/a/29712221
favorite count: 0

http://stackoverflow.com/q/29826231
has answer: http://stackoverflow.com/a/29827377
tagged with: promise
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47785494
has comment: http://stackoverflow.com/comment/47794497
has body: I have the code in native JavaScript (I simplified it): var finalArray = []; for (var i; i &lt; 3; i++) { var a = -1; // set the default value var b = Math.random(); ymaps.route(someArray[i]).then(function (res) { a = res.getCoordinates(); }); finalArray.push([a, b]); } console.log(finalArray); There is some third-party framework called ymaps which has a method route which returns a promise object. Problem cases in that I need to wait until promise.then callback function is done, then continue the main code with function finalArray.push([a, b]);, or, rather, synchronize asyncronous processes. Result of code I wrote above is [ [-1, /*random*/], [-1, /*random*/], [-1, /*random*/] ] But instead of -1 - the default var a value, some plural number (changed var a in promise.then callback function) must be there.
linked to: http://stackoverflow.com/q/5627284
type: Question
linked to: http://stackoverflow.com/q/23667086
upvote count: 1
tagged with: javascript
tagged with: jquery
tagged with: callback
score: 0
has title: jQuery wait for .then() callback function is completed by promise object
answer count: 1
downvote count: 1
favorite count: 0
tagged with: deferred

http://stackoverflow.com/comment/47690185
type: AnswerComment
comment on: http://stackoverflow.com/a/29758741
has text: but yes..what you have written is exactly what I'm trying to implement
type: Comment
score: 0

http://stackoverflow.com/a/29812865
type: Answer
has body: You could fix this by changing the line that checks if office hasOwnProperty of president: if (!office.hasOwnProperty("president")) { to this: if (!voteCount["president"].hasOwnProperty(office["president"])) { The end result is: var votes = { "Alex": { president: "Bob", vicePresident: "Devin", secretary: "Gail", treasurer: "Kerry" }, "Bob": { president: "Mary", vicePresident: "Hermann", secretary: "Fred", treasurer: "Ivy" }, "Cindy": { president: "Cindy", vicePresident: "Hermann", secretary: "Bob", treasurer: "Bob" }, "Devin": { president: "Louise", vicePresident: "John", secretary: "Bob", treasurer: "Fred" }, "Ernest": { president: "Fred", vicePresident: "Hermann", secretary: "Fred", treasurer: "Ivy" }, "Fred": { president: "Louise", vicePresident: "Alex", secretary: "Ivy", treasurer: "Ivy" }, "Gail": { president: "Fred", vicePresident: "Alex", secretary: "Ivy", treasurer: "Bob" }, "Hermann": { president: "Ivy", vicePresident: "Kerry", secretary: "Fred", treasurer: "Ivy" }, "Ivy": { president: "Louise", vicePresident: "Hermann", secretary: "Fred", treasurer: "Gail" }, "John": { president: "Louise", vicePresident: "Hermann", secretary: "Fred", treasurer: "Kerry" }, "Kerry": { president: "Fred", vicePresident: "Mary", secretary: "Fred", treasurer: "Ivy" }, "Louise": { president: "Nate", vicePresident: "Alex", secretary: "Mary", treasurer: "Ivy" }, "Mary": { president: "Louise", vicePresident: "Oscar", secretary: "Nate", treasurer: "Ivy" }, "Nate": { president: "Oscar", vicePresident: "Hermann", secretary: "Fred", treasurer: "Tracy" }, "Oscar": { president: "Paulina", vicePresident: "Nate", secretary: "Fred", treasurer: "Ivy" }, "Paulina": { president: "Louise", vicePresident: "Bob", secretary: "Devin", treasurer: "Ivy" }, "Quintin": { president: "Fred", vicePresident: "Hermann", secretary: "Fred", treasurer: "Bob" }, "Romanda": { president: "Louise", vicePresident: "Steve", secretary: "Fred", treasurer: "Ivy" }, "Steve": { president: "Tracy", vicePresident: "Kerry", …
score: 1
answers question: http://stackoverflow.com/q/29812701
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/47543096
type: QuestionComment
has text: I work on the application constantly so it's already under constant development. I just want to know if it is a wise approach and whether non-angular and angular pages can play nice :)
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29703626

http://stackoverflow.com/q/29734397
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29736751
has comment: http://stackoverflow.com/comment/47602501
has title: Drawing a fixed-length circle in D3.js
upvote count: 2
linked to: http://stackoverflow.com/q/20130186
answer count: 1
favorite count: 0
tagged with: d3.js
has body: This seems like it ought to be straightforward, but I'm struggling to figure it out. It's easy to draw a circle on a map projection in D3.js, e.g. p = projection([-73.94,40.7]); svg .append("svg:circle") .attr("cx", function(d, i) { return p[0]; }) //x position translated through projection function .attr("cy", function(d, i) { return p[1]; }) //y position .attr("r", function(d, i) { return 20; }) ; OK, but what if instead of setting the radius as a pixel value (as it is in the above, to 20 pixels), I want to set it to a distance value that would be scaled appropriately to the projection? In short, this boils down to me asking, "what's the pixel value of 20 km in this projection?" Now I know that this will vary because of the projection — e.g. a 20 km circle in Mercator will look very different (near spherical) at the equator than it does near the poles (highly elongated). D3.js can do so many other clever projection issues that I was surprised to find that I couldn't easily conjure up some kind of acceptable answer here. Any suggestions? I was thinking that, well, you could calculate a number of lat/lon points for a circle and then plot it as some kind of path... which feels awfully unusually clunky for D3.js. Is there an easier way?
score: 2
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
downvote count: 0
has comment: http://stackoverflow.com/comment/47606599
accepted answer: http://stackoverflow.com/a/29736751

http://stackoverflow.com/comment/47764609
comment on: http://stackoverflow.com/a/29818259
type: Comment
type: AnswerComment
has text: how to activate browser forward button in above code ??? I guess history.pushstate deactivate it
score: 0

http://stackoverflow.com/comment/47692459
has text: That did it. Both pages had both Jquery's being imported, so it's kinda weird that the home page worked and the sub page didn't, but issue is resolved, so thank you!
type: Comment
comment on: http://stackoverflow.com/a/29781027
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47736196
has text: It is very odd that setting height to 30px puts it at the top of the dialog but the text shows at the bottom.
comment on: http://stackoverflow.com/a/29804004
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/89628808
type: AnswerComment
type: Comment
has text: I'm having the same problem, but the solution shown didn't solve my problem. could I post my code here or should I open a new question?
score: 0
comment on: http://stackoverflow.com/a/29738350

http://stackoverflow.com/a/29779398
accepted answer of: http://stackoverflow.com/q/29763688
answers question: http://stackoverflow.com/q/29763688
has body: Thank you very much to fylooi for the suggestion on debugging! It turns out the javascript WAS executing, but just referencing the wrong element on the page. Highly recommended to use Firebug (not the built in debuggers). Thanks!
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/47614244
type: Comment
type: QuestionComment
has text: I guess I failed to mention that it is very important to me that the outer area that is darkened by the modal overlay can be clicked in order to close the window. That's why I've added that bit of code. Removing that does solve the problem of almost every click closing the modal window. I'm trying to see how to keep both UX features functioning the way I need them too.
score: 0
comment on: http://stackoverflow.com/q/29740466

http://stackoverflow.com/a/29794565
type: AcceptedAnswer
has body: Finally, I've ended up the code like this. It's working good. var getFirstParagraph = "var paras = document.getElementsByTagName('p');" + "console.log(paras[0].textContent);" var urls = ["http://www.example.com", "http://www.example2.com"]; for(var i=0; i&lt;urls.length; i++) { pageWorker = require("sdk/page-worker").Page({ contentScript: getFirstParagraph, contentURL : urls[i], }); } I didn't find any better option than this. Hope this helps someone.
answers question: http://stackoverflow.com/q/29748993
type: Answer
accepted answer of: http://stackoverflow.com/q/29748993
score: 2
has comment: http://stackoverflow.com/comment/47805860
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/47724374
has text: There is no problem if the `id` is changing as it is stored in a `$_SESSION` variable.. If you don't want to do a first request to get the `$szamol` value then you can add it directly in the js script as `var szamol = <?php echo $szamol ?>;` after you calculated it before echoing. If you don't want to do like this, then you can make in get request to another file, other than the file which calls the method `$jatek->epuletkesz();`: `$.get('/path/to/file/szamol.php', function(data) { szamol = data.szamol; }, 'json');`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29796608
type: AnswerComment

http://stackoverflow.com/q/29826664
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47779614
has body: I want to change an image onclick on another image, but don't only want to change a fixed image but use the advantages of srcset, so the browser picks the right image for the current main image size (responsive layout). This is what I am using right now, vanilla: I'm open to jquery here. Anyone know how to handle this?
possible better answer: http://stackoverflow.com/a/29827613
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/47780164
upvote count: 2
accepted answer: http://stackoverflow.com/a/29827283
has answer: http://stackoverflow.com/a/29827613
type: Question
has answer: http://stackoverflow.com/a/29827283
has title: Change an image on click onto another image, but use the srcset functionality (jquery optional)
answer count: 2
tagged with: srcset
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29788815
has body: You can try something like this. function drawBox() { var e = document.getElementById("ddlViewBy"); var color = e.options[e.selectedIndex].value; var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.fillStyle = color; ctx.fillRect(0,0,600,400); } Notice how i get the color from the dropdownbox Red Green Blue
accepted answer of: http://stackoverflow.com/q/29788670
answers question: http://stackoverflow.com/q/29788670
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47707242
type: Answer

http://stackoverflow.com/comment/47741223
comment on: http://stackoverflow.com/a/29806492
has text: Yep, they work just fine as you had them. I couldn't help changing the case of Types, but the only real change I made was breaking `types` out to a separate function. Don't define it inside of `Troop`. I just reverted my style suggestions so as not to muddy the issue.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29796608
has comment: http://stackoverflow.com/comment/47721378
score: 1
answers question: http://stackoverflow.com/q/29796447
has comment: http://stackoverflow.com/comment/47723854
has comment: http://stackoverflow.com/comment/47724374
downvote count: 0
type: Answer
has body: You can use an ajax request like: var szamol = 6000; // 6 seconds var timer = setTimeout(function(){ $.post('/path/to/my/php/file.php', {}, function(data) { // do something with the response }, 'json'); }, szamol);
has comment: http://stackoverflow.com/comment/47724064
upvote count: 1

http://stackoverflow.com/q/29823666
type: Question
tagged with: php
linked to: http://stackoverflow.com/q/14044257
score: 0
has comment: http://stackoverflow.com/comment/47773661
has answer: http://stackoverflow.com/a/29824114
answer count: 2
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47773525
has comment: http://stackoverflow.com/comment/47774248
has body: I want to choose only one row at a time from html table... Im using php,html and javascript.. if i choose one row means that the value only show in alert box at a time using javascript.. I wrote some js coding but it shows all the row values one by one in alertbox.. Please anyone help for me.. My html code: Date & Time Name Source Destination Ride Type Vehicle Type Plate No. Distance <?php $search_data = "";?> <?php echo $search_data; ?> My javascript: function found(row) { //alert("hai"); var table=document.getElementById("table"); var cells = table.getElementsByTagName("tr"); for (var i = 0; i < cells.length; i++) { alert(cells[i].innerHTML); } } My php code: while ($data = mysql_fetch_array($firstattempt)) { $search_data = ""; $search_data .= " "; $search_data .= " {$data["DATE"]} & {$data["START_TIME"]} "; $search_data .= " {$data["NAME"]} "; $search_data .= " {$data["START_FROM"]} "; $search_data .= " {$data["END_TO"]} "; $search_data .= " {$data["RIDER_FLAG"]} "; $search_data .= " {$data["VEHICLE_TYPE"]} "; $search_data .= " {$data["PLATE_NO"]} "; $search_data .= " {$distance} Km "; $search_data .= " "; echo $search_data; } My output :
has title: How to choose only one row at a time in html table using javascript
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29823763

http://stackoverflow.com/comment/47535711
type: Comment
has text: @Hintham ok. His answer is better for sure. I didn't know `@*` and `*@` indeed.
type: AnswerComment
comment on: http://stackoverflow.com/a/29698770
score: 0

http://stackoverflow.com/a/29841259
has comment: http://stackoverflow.com/comment/47809523
downvote count: 1
answers question: http://stackoverflow.com/q/29841207
upvote count: 9
has body: It's because you reference the x and y that change in for loop so when you execute the function you have the last value, to fix this you need to add closure: for (var y = 1; y &lt;= 10; y++) { for (var x = 1; x &lt;= 10; x++) { (function(x, y) { calls.push(function() { yooMe(x, y); }); })(x, y); } }
accepted answer of: http://stackoverflow.com/q/29841207
type: AcceptedAnswer
score: 8
type: Answer

http://stackoverflow.com/a/29735100
type: Answer
answers question: http://stackoverflow.com/q/29734856
has comment: http://stackoverflow.com/comment/47603432
has comment: http://stackoverflow.com/comment/47603869
has body: I agree with Shaun Loftin. Anyway, you can embed a local webpage using a simple IFRAME.
has comment: http://stackoverflow.com/comment/47604570
has comment: http://stackoverflow.com/comment/47603584
score: 0
has comment: http://stackoverflow.com/comment/47603931
has comment: http://stackoverflow.com/comment/47603765
has comment: http://stackoverflow.com/comment/47604064
has comment: http://stackoverflow.com/comment/47604163

http://stackoverflow.com/comment/129393492
comment on: http://stackoverflow.com/a/29986116
has text: Awesome but can be faster!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29762982
type: AnsweredQuestion
has body: Is there any difference between casper.echo and console.log ? casper.echo('Testing'); console.log('Testing'); They both log contents in console.
accepted answer: http://stackoverflow.com/a/29765564
has title: Difference between casper.echo and console.log in CasperJS
type: Question
upvote count: 4
tagged with: javascript
score: 4
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/29765564
favorite count: 0
tagged with: casperjs

http://stackoverflow.com/comment/47634821
score: 0
type: Comment
type: QuestionComment
has text: `sprintf` is a function available in many languages, but explaining how to reimplement it in JavaScript is probably too broad for a Stackoverflow question. Of course, it sounds like something someone might have implemented already if you [searched for it](https://duckduckgo.com/?q=javascript+sprintf&ia=qa).
comment on: http://stackoverflow.com/q/29751340

timer
tag name: timer
tags question: http://stackoverflow.com/q/29817399
tags question: http://stackoverflow.com/q/29722540
tags question: http://stackoverflow.com/q/29715354
tags question: http://stackoverflow.com/q/29804459
type: Tag
tags question: http://stackoverflow.com/q/29704907
tags question: http://stackoverflow.com/q/29784021
tags question: http://stackoverflow.com/q/29756499
tags question: http://stackoverflow.com/q/29689567
tags question: http://stackoverflow.com/q/29738023

http://stackoverflow.com/q/29832551
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: nested
has title: Using localStorage as a nested dictionary
has body: I have seen the current solutions on stackoverflow such as: Storage.prototype.setObject = function(key, value) { this.setItem(key, JSON.stringify(value)); } Storage.prototype.getObject = function(key) { var value = this.getItem(key); return value &amp;&amp; JSON.parse(value); } But I am trying to do something like: localStorage[a][b] = 5 with a function call localStorage.setItem('a', 'b', 5). I currently have a code that is not working because of referencing problems: Storage.prototype.setVal = function(key, val) { var val = Array.prototype.pop.call(arguments); var cur_depth = this; for (var i in arguments) { var cur_key = arguments[i]; cur_depth = JSON.parse(cur_depth[cur_key]); } cur_depth = JSON.stringify(val); } And my last, even more hacky, attempt: Storage.prototype.setVal = function(key, val) { var val = JSON.stringify(Array.prototype.pop.call(arguments)); var keys = ''; // hacky eval solution for (var i in arguments) { var cur_key = arguments[i]; keys += '["' + cur_key + '"]'; } eval('this' + keys + '=' + val); }
upvote count: 2
type: UnansweredQuestion
tagged with: dictionary
tagged with: local-storage
score: 2
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29833780
has answer: http://stackoverflow.com/a/29832866
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47712426
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29723117
score: 0
has text: Where does that `variable` come from? Is it a variable from a running script, in which case you should mention what language that script is using.

http://stackoverflow.com/comment/47682111
type: Comment
comment on: http://stackoverflow.com/a/29775768
type: AnswerComment
has text: i did a similar things to this, but apparently nothing happens in the header when i do `auth.login(user)`. it seems that the header controller is called only the first time. The `auth.login` is called by another controller in the page.
score: 0

http://stackoverflow.com/comment/47734448
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29803269
type: Comment
has text: Yep, this was the problem... thanks for the prompt answer!:) What is the global status variable for btw? Thanks:) Will mark this as correct in a few minutes:)

http://stackoverflow.com/comment/47686553
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29754491
has text: By the way I did some tests on the suggested example https://github.com/panique/php-long-polling: on my Aruba web server it works well with one client connected, but when two (or, worse, three) browsers are simultaneously connected the notifications are significantly delayed, and it gets totally stuck with four or more. Therefore I'd say I need to find another workaround to achieve my expected behaviour.

http://stackoverflow.com/a/29807909
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29804296
has comment: http://stackoverflow.com/comment/47744219
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29804296
has comment: http://stackoverflow.com/comment/47744744
has comment: http://stackoverflow.com/comment/47744705
has comment: http://stackoverflow.com/comment/47744796
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47744485
downvote count: 0
has comment: http://stackoverflow.com/comment/47744175
has comment: http://stackoverflow.com/comment/47747170
has comment: http://stackoverflow.com/comment/124696647
has body: I combined this answer with this one and it seems to work both on desktop and on mobile (code is a bit ugly, sorry for that). How it works Every on the table listens both to normal mouse events (up/down/move) and to touch events (start/end/move). On mousedown/touchstart the motion becomes "active", selection is reset (removing .highlight class) and current event element is selected. The trick is in the touchmove event: since $(this) always refers to the element where the touch event started, we have to see what the user is actually touching passing the event coordinates to highlightHoveredObject, which will select the right element. JSFiddle JavaScript function highlightHoveredObject(x, y) { $('td').each(function() { // check if is inside boundaries if (!( x <= $(this).offset().left || x >= $(this).offset().left + $(this).outerWidth() || y <= $(this).offset().top || y >= $(this).offset().top + $(this).outerHeight() )) { $(this).addClass('highlight'); } }); } // if you are using jQuery Mobile replace the next line with // $("#yourpage").on("pagecreate", function() { $(document).ready(function() { var active = false; $("td").on("mousedown", function(ev) { active = true; $(".highlight").removeClass("highlight"); // clear previous selection ev.preventDefault(); // this prevents text selection from happening $(this).addClass("highlight"); }); $("td").on("mousemove", function(ev) { if (active) { $(this).addClass("highlight"); } }); $(document).on("mouseup", function(ev) { active = false; }); $("td").on("touchstart", function(ev) { active = true; $(".highlight").removeClass("highlight"); // clear previous selection ev.preventDefault(); // this prevents text selection from happening $(this).addClass("highlight"); }); $("td").on("touchmove", function(ev) { if (active) { var touch = ev.originalEvent.touches[0]; highlightHoveredObject(touch.clientX, touch.clientY); } }); $(document).on("touchend", function(ev) { active = false; }); }); HTML 1 2 3 1 2 3 1 2 3 CSS .highlight { b…
has comment: http://stackoverflow.com/comment/47744318

http://stackoverflow.com/a/29699893
has body: Is there a way to get the intended behaviour using standard and current features Yes, use promises and generators. Many promise libraries, and some standalone ones, feature the use of generator "coroutines". But notice that you cannot mix iteration with asynchrony, you can use generators for either only. Your example seems to confuse them a bit - it looks like you expect that for ( {url, data} of downloadUrls(urls) ) { loop to work synchronously, which cannot work. do I have to wait for async/await? No, you don't have to wait, Babel already supports them!
score: 0
type: Answer
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/29699109

http://stackoverflow.com/a/29741210
score: 1
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29740989
downvote count: 0
has body: You could store all divs in an array and write a function like that: var divArray = []; for (var index = 1; index &lt; 8; index++) { divArray[divArray.length] = $('#' + index); } function showDiv(showIndex) { for (var index = 0; index &lt; divArray.length; index++) { if (index === showIndex) { $(divArray[index]).show(); } else { $(divArray[index]).hide(); } } }

http://stackoverflow.com/comment/47556656
score: 0
type: AnswerComment
type: Comment
has text: Set the className and make your styles to load after bootstrap or set more weight, by being more specific than bootstrap style. Or use !important (not recommended).
comment on: http://stackoverflow.com/a/29707996

http://stackoverflow.com/comment/47686542
score: 0
type: AnswerComment
has text: @Liam Validate the answer is perfect ;)
type: Comment
comment on: http://stackoverflow.com/a/29778164

http://stackoverflow.com/comment/47662231
type: QuestionComment
has text: What doesn't work about it? Errors in console? Any request in the Network activity?
type: Comment
comment on: http://stackoverflow.com/q/29765430
score: 0

http://stackoverflow.com/comment/47522762
type: AnswerComment
comment on: http://stackoverflow.com/a/29693179
type: Comment
score: 2
has text: @greenhoorn: You *could*, but it wouldn't make any sense to. `i` isn't subsequently used in the same call, so there's no point in writing back to it.

http://stackoverflow.com/a/29834417
has comment: http://stackoverflow.com/comment/47886247
has comment: http://stackoverflow.com/comment/47918486
has comment: http://stackoverflow.com/comment/47919982
has comment: http://stackoverflow.com/comment/47825074
answers question: http://stackoverflow.com/q/29834080
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29834080
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47836678
has comment: http://stackoverflow.com/comment/47827785
score: 2
downvote count: 0
has body: and the malicious user can put fake roles in the JWT Why is that an issue? Malicious user cannot produce a valid token w/o knowing a private key and server will validate the JWT upon the next request anyway. If you want to verify JWT in order to correctly show, say, GUI, you can use JS library for that, e.g. http://kjur.github.io/jsjws/.
has comment: http://stackoverflow.com/comment/47825959

http://stackoverflow.com/comment/47565356
comment on: http://stackoverflow.com/a/29715014
has text: How would this _proceed to HttpPost action_?
type: Comment
score: 0
type: AnswerComment

facebook
tags question: http://stackoverflow.com/q/29733641
tags question: http://stackoverflow.com/q/29698897
tags question: http://stackoverflow.com/q/29705641
type: Tag
tags question: http://stackoverflow.com/q/29739953
tags question: http://stackoverflow.com/q/29767833
tags question: http://stackoverflow.com/q/29765787
tags question: http://stackoverflow.com/q/29803903
tags question: http://stackoverflow.com/q/29821865
tags question: http://stackoverflow.com/q/29718685
tags question: http://stackoverflow.com/q/29711488
tags question: http://stackoverflow.com/q/29715427
tags question: http://stackoverflow.com/q/29706975
tag name: facebook
tags question: http://stackoverflow.com/q/29799997
tags question: http://stackoverflow.com/q/29698955
tags question: http://stackoverflow.com/q/29725380
tags question: http://stackoverflow.com/q/29803072
tags question: http://stackoverflow.com/q/29714446
tags question: http://stackoverflow.com/q/29811926
tags question: http://stackoverflow.com/q/29689824
tags question: http://stackoverflow.com/q/29713070

http://stackoverflow.com/comment/47735838
type: QuestionComment
comment on: http://stackoverflow.com/q/29803819
has text: The label is rectangle?
score: 0
type: Comment

http://stackoverflow.com/comment/47630121
type: QuestionComment
score: 0
has text: I've written that I'm looking for a help to organize this form just like I wrote.
comment on: http://stackoverflow.com/q/29748856
type: Comment

http://stackoverflow.com/q/29789202
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29789421
favorite count: 0
has title: HTML multiple events to trigger the same function
has answer: http://stackoverflow.com/a/29789421
has answer: http://stackoverflow.com/a/29789295
has comment: http://stackoverflow.com/comment/47707510
accepted answer: http://stackoverflow.com/a/29789295
tagged with: http://stackoverflow.com/tag/html
score: 11
linked to: http://stackoverflow.com/q/2534089
answer count: 4
has answer: http://stackoverflow.com/a/76715526
downvote count: 0
type: Question
type: AnsweredQuestion
tagged with: javascript
upvote count: 11
has comment: http://stackoverflow.com/comment/47707628
has answer: http://stackoverflow.com/a/29789479
has body: Is there a way to have multiple events (e.g. oninput, onblur) trigger exactly the same function in the HTML? This is the HTML that I'm trying to simplify: I know this is possible in jQuery as explained here, but since I have a lot of different inputs (e.g. address, postcode, etc.) that need to call different functions (e.g. toggleSuccessIcon(this, isAddresss), toggleSuccessIcon(this, isPostCode), etc.) I wanted to avoid having a long and messy initialisation in the JavaScript. However, if I am being foolish by doing this in HTML rather than JQuery I'd appreciate an explanation as to the advantage of using JQuery. Note that isEmail, isAddress, isPostCode, etc. is a function name.
has comment: http://stackoverflow.com/comment/47708428

http://stackoverflow.com/comment/47845278
type: QuestionComment
has text: @salniro: when editing, please note that inline code spans (`like this`) [shouldn't be used for highlighting](http://meta.stackoverflow.com/q/254990), only for code in sentences. Thanks!
comment on: http://stackoverflow.com/q/29747332
score: 0
type: Comment

http://stackoverflow.com/q/29837366
tagged with: angularjs
type: UnansweredQuestion
has title: Use the backend just to send all the data and filter the data with angular
has body: I'm changing my application. At the moment, the production is running with NODE + EJS, and I want change to NODE.JS + ANGULAR. I started to change everything and I'm stuck on something. In my new application, I want most of logic in my angular controllers, and I was using this piece of code to aggregate and return somethings: Booking.aggregate( [{ '$group': { '_id': '$booking.date', 'name': { '$first': '$booking.name' }, 'participants': { '$sum': '$booking.participants' }, 'attended': { '$sum': { '$cond': [{ '$eq': ['$isActive', true] }, 1, 0] } }, 'bookings': { '$sum': 1 } } }, { $sort: { 'booking.date': -1 } }], function (error, result) { if (error) { console.log(error); } else { res.send(result) } } ); Now, I want send all the data in JSON (obvious) to my angular controllers and then filter there. My question is: Is this possible? Is there is anything to help me achieve this, maybe a ready for use plugin? And, which one is faster?
tagged with: node.js
has answer: http://stackoverflow.com/a/29839388
type: Question
has comment: http://stackoverflow.com/comment/47802022
answer count: 2
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29839440

http://stackoverflow.com/q/29731956
tagged with: jquery
has comment: http://stackoverflow.com/comment/47597236
has title: post html as string through ajax
score: 0
has comment: http://stackoverflow.com/comment/47597195
tagged with: ajax
has body: I have a tinymce wysiwyg and i want to post the html from it to my action method: $("#save").click(function () { var ed = tinymce.get('wysiwyg'); var id = $("#destinationId").val(); var PostContent = JSON.stringify({ 'content': ed.getContent(), 'destinationId' : id }); console.log(PostContent); $.ajax({ url: '@Url.Action("SaveDestinationContent", "Home")', type: 'POST', dataType: 'JSON', cache: false, data: PostContent, success: function (data) { }, error: function (xhr, error) { }, }); I always get null in my action method that looks like this: [HttpPost] public ActionResult SaveDestinationContent(string content, string destinationId) { return Json("TRUE"); } i have tried to do this in a couple of different ways: $("#save").click(function () { var ed = tinymce.get('wysiwyg'); var PostContent = ed.getContent(); console.log(ed.getContent()); var id = $("#destinationId").val(); $.ajax({ url: '@Url.Action("SaveDestinationContent", "Home")', type: 'POST', dataType: 'JSON', cache: false, data: { content: PostContent.toString(), destinationId: id }, success: function (data) { }, error: function (xhr, error) { }, }); but none of them work! &lt;---- EDIT ------> I know it has to do with the serialization of the html because when i just add some random string and post that it works as expected!
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47597318
answer count: 0
type: Question
tagged with: javascript

http://stackoverflow.com/q/29697082
accepted answer: http://stackoverflow.com/a/29697222
has body: I've successfully set up the Shopify Ajax Cart using the Timber framework so currently my cart closes if you click anywhere outside of the cart (or using the close button). I want to be able to create a timer so that after a product has been added to the cart and the ajax quick cart opens it then closes after say 5 seconds so the user can continue to shop. If they want to view the cart for longer they can hit the cart button to reopen and from there click the link to the full cart page. It was suggested to me that I can close the cart with timber.RightDrawer.close(); and I should set it up in a listener like the one below however being new to JS I'm struggling with where to begin. jQuery('body').on('ajaxCart.afterCartLoad', function(evt, cart) { // start timer function // when timer is triggered: timber.rightDrawer.close(); }); I've tried the following but I'm really just guessing... jQuery('body').on('ajaxCart.afterCartLoad', function(evt, cart) { // start timer function $('#AddToCart').on('click', function(){ setTimeout(function(){ // when timer is triggered: timber.rightDrawer.close(); },500); }); }); Some of my current code as follows, see Timber framework for same setup as mine: theme.liquid JS: {% comment %} Ajaxify your cart with this plugin. Documentation: - http://shopify.com/timber#ajax-cart {% endcomment %} {% if settings.ajax_cart_enable %} {{ 'handlebars.min.js' | asset_url | script_tag }} {% include 'ajax-cart-template' %} {{ 'ajax-cart.js' | asset_url | script_tag }} &lt;script&gt; jQuery(function($) { ajaxCart.init({ formSelector: '#AddToCartForm', cartContainer: '#CartContainer', addToCartSelector: '#AddToCart', cartCountSelector: '#CartCount', cartCostSelector: '#CartCost', moneyFormat: }); }); jQuery('body').on('ajaxCart.afterCartLoad', function(evt, cart) { // Bind to 'ajaxCart.afterCartLoad' to run any javascript after the cart has loaded in the DOM timber.RightDrawer.open(); }); &lt;/script&gt; {% endif %} timber.…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47530593
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/47530371
score: 0
has answer: http://stackoverflow.com/a/29697222
has title: Add a timer to close Ajax Quick Cart (Shopify) after product is added to cart?

http://stackoverflow.com/comment/47577520
has text: this gives the answer in PHP .... http://stackoverflow.com/questions/364946/how-to-make-pdf-file-downloadable-in-html-link
comment on: http://stackoverflow.com/q/29720170
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29820509
has comment: http://stackoverflow.com/comment/47767549
has answer: http://stackoverflow.com/a/29820983
has comment: http://stackoverflow.com/comment/47769225
has title: PHP/Js chat system
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47767517
has body: For some reason my chat system isn't sending messages & I can't find what I'm doing wrong. I have the chat 'room' made on my php webpage, but messages won't send. When I remove my DB password I get errors on the page, so I know it's halfway working, I guess. I also know I have a # on the form action. Blog - Chat Welcome <?php print $_SESSION['user_id']; ?>! Status: Idle <input type="hidden" id="username" value="<?php echo $_SESSION['user_id']; ?>"/> sendchat.php $con = new PDO('mysql:host=127.0.0.1;dbname=chat','root',''); if(isset($_POST['text']) && isset($_POST['username'])) { $text= strip_tags(stripslashes($_POST['text'])); $username= strip_tags(stripslashes($_POST['username'])); if(!empty($text) && !empty($username)) { $insert = $con->prepare("INSERT INTO messages VALUES('','".$username."','".$text."')"); $insert->execute(); echo " ".ucwords($username)." - ".$text." "; } } This is my js file $(function(){ $(document).on('submit','#chatForm',function(){ var text = $.trim($("#text").val()); var username = $.trim($("#username").val()); if(text != "" && username != ""){ $.post('sendchat.php',{text: text, username: username},function(data){ $(".chat-messages").append(data); }); }else{ alert("Data missing"); } }); function getMessages(){ $.get('getmessages.php',function(data){ $(".chat-messages").php(data); }); } setInterval(function(){ getMessages(); },500); }); getmessages.php $con = new PDO('mysql:host=127.0.0.1;dbname=chat','root',''); $query = $con->prepare("SELECT * FROM messages"); $query->execute(); //Fetch while($fetch = $query->fetch(PDO::FETCH_ASSOC)) { $username = $fetch['username']; $message = $fetch['message']; echo " ".ucwords($username)." - ".$message." "; }
has comment: http://stackoverflow.com/comment/47797895
has answer: http://stackoverflow.com/a/29820986
score: -1
favorite count: 0
type: Question
downvote count: 2
answer count: 2
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/47767430
has comment: http://stackoverflow.com/comment/47767631

http://stackoverflow.com/q/29727043
tagged with: php
has answer: http://stackoverflow.com/a/29727125
accepted answer: http://stackoverflow.com/a/29727125
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47588018
tagged with: http://stackoverflow.com/tag/json
has title: Pharse First Column of a text file db into php or JSON
type: Question
has body: So I am starting to learn things about JSON. What I am trying to do is pharse the first column (id) of this txt file http://www.ufo-history-evidence.com/myTutorials.txt into a JSON array As far as I know, I would have to first move it into a PHP array, and then translate to JSON. I need to be a bit more clear about this I think, must be JavaScript function function executed returns a string string is parsed as JSON, the result is an array containing IDs This is what I got &lt;script type="text/javascript"&gt; var filePath = "myTutorials.txt"; xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET",filePath,false); xmlhttp.send(null); var fileContent = xmlhttp.responseText; var fileArray = fileContent.split('\n') for (var i = 0, l = fileArray.length; i &lt; l; ++i) { fileArray[i] = fileArray[i].slice(0,7); }; alert(fileArray.join('\n')); &lt;/script&gt;
tagged with: arrays
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29727191
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29727191
tagged with: text-files
has comment: http://stackoverflow.com/comment/47588106

http://stackoverflow.com/q/29795844
upvote count: 3
accepted answer: http://stackoverflow.com/a/29797741
has body: I'm trying to write a CSS and JavaScript to center divs inside the class viralign vertically. image here text image here text image here text css clases .width80{ width:80%; margin:0px auto;} .pad5{padding:5px;} .col-3{ width:33.33%; } JavaScript code function virAlignNavBar(){ var vircon = document.getElementsByClassName('vircon'); var viralign = document.getElementsByClassName('viralign'); for(var i=0; i < vircon.length; i++){ var x=vircon[i].offsetHeight; var y=viralign[i].offsetHeight; viralign[i].style.top=((x/2)-(y/2)+"px"); viralign[i].style.position="absolute"; vircon[i].style.position="relative"; } } The problem is that all divs with class vircon appear above each other. How can I solve this? jsfiddle I need the divs to be like this. the col-3 class devides the area between the three divs,and the functoin makes the area above each of the three divs equal to the ares below it.
downvote count: 1
type: Question
tagged with: javascript
answer count: 2
score: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29797741
has title: vertical center using javascript and css goes wrong
favorite count: 0
possible better answer: http://stackoverflow.com/a/29795994
has answer: http://stackoverflow.com/a/29795994
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/comment/47772546
has text: In case using XYZ layer is not an option: var x = Math.round ((bounds.left - this.maxExtent.left) / (res * this.tileSize.w)); var y = Math.round ((this.maxExtent.top - bounds.top) / (res * this.tileSize.h)) Requires maxResolution: 156543.0339 set as map option
comment on: http://stackoverflow.com/q/29774318
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29690229
score: 2
has body: This answer assumes you're only after tool tip and not the infowindow. The variables addresses and x cannot be used within the callback as the value of x will always be 5 (in this example, see length of addresses array). Instead look at the data object like so: var map; var elevator; var myOptions = { zoom: 4, center: new google.maps.LatLng(0, 0), mapTypeId: 'roadmap' }; map = new google.maps.Map($('#map_canvas')[0], myOptions); var addresses = ['Norway', 'Africa', 'Asia','North America','South America']; for (var x = 0; x &lt; addresses.length; x++) { $.getJSON('http://maps.googleapis.com/maps/api/geocode/json?address='+addresses[x]+'&amp;sensor=true', null, function (data) { var p = data.results[0].geometry.location var latlng = new google.maps.LatLng(p.lat, p.lng); new google.maps.Marker({ position: latlng, map: map title: data.results[0].formatted_address }); }); } EDIT For completeness the data object is the result of the geocoding API call. The formatted_address is a property of a match within the results, see https://developers.google.com/maps/documentation/geocoding/#GeocodingResponses
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29689817
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/29689817

http://stackoverflow.com/q/29763411
score: 4
favorite count: 0
type: UnansweredQuestion
has body: I had working code when I used script in adminhtml From.php. But When I separated code and place in js file. I am getting below Error. TypeError: google.maps.Geocoder is not a constructor var geocoder = new google.maps.Geocoder(); My code in js file is : function loadjsfile(){ alert("func called"); var script = document.createElement('script'); script.type = 'text/javascript'; script.src = "https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false"; document.head.appendChild(script);} function getlatlong(){ //loadjsfile(); var address = document.getElementById("zipcode").value; var geocoder = new google.maps.Geocoder(); geocoder.geocode( { "address": address}, function(results, status) { var location = results[0].geometry.location; foundLat = location.lat(); foundLng = location.lng(); //alert(location.lat() + "&lt;br&gt;" + location.lng()); document.getElementById("longitude").value= foundLng; document.getElementById("latitude").value= foundLat; });} window.onload = loadjsfile; Js file is loaded in head tag. Still getting error. Please provide me sugesstion if u feel.. Thanks.
answer count: 0
has title: getting error :TypeError: google.maps.Geocoder is not a constructor with Magento
tagged with: geocoding
type: Question
upvote count: 4
tagged with: magento
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/29747198
score: 34
has body: Get Hours I got the hours by using this code endTime.diff(startTime, 'hours') Get Minutes i got the minutes by using this below code var mins = moment.utc(moment(endTime, "HH:mm:ss").diff(moment(startTime, "HH:mm:ss"))).format("mm") My Working code is $scope.UpdateTimeSheet = function (rowEntity) { if (rowEntity.StartTime.toString().length != 11) { rowEntity.StartTime = moment(rowEntity.StartTime).format("hh:mm:ss a"); } if (rowEntity.EndTime.toString().length != 11) { rowEntity.EndTime = moment(rowEntity.EndTime).format("hh:mm:ss a"); } var startTime = moment(rowEntity.StartTime, "hh:mm:ss a"); var endTime = moment(rowEntity.EndTime, "hh:mm:ss a"); var mins = moment.utc(moment(endTime, "HH:mm:ss").diff(moment(startTime, "HH:mm:ss"))).format("mm") rowEntity.TotalHours = endTime.diff(startTime, 'hours') + " Hrs and " + mins + " Mns"; }
upvote count: 35
answers question: http://stackoverflow.com/q/29745873
accepted answer of: http://stackoverflow.com/q/29745873
type: AcceptedAnswer
downvote count: 1
type: Answer

http://stackoverflow.com/comment/47750076
has text: For example, if I am loading in a Javascript file from a tag I will get a 403.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29810689

http://stackoverflow.com/a/55939374
upvote count: 1
answers question: http://stackoverflow.com/q/29822607
downvote count: 0
score: 1
type: Answer
has body: Sometimes the application loads several times the script 'https://www.google.com/recaptcha/api.js after refresh, make sure your application doesn't have multiple

http://stackoverflow.com/a/29825693
has body: Thank you for you help, I found out another solution and it was a minor change. On the top of the page I turned on the strict mode and also in the for loop, Instead of var, I used the "let" keyword.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29795666

http://stackoverflow.com/a/29841076
downvote count: 0
answers question: http://stackoverflow.com/q/29841000
has comment: http://stackoverflow.com/comment/47809161
has body: JavaScript using the below call, I found out that the month argument counts starting from zero. new Date(2015, 3, 1); // that's the 1st April 2015! And what is causing the issue is the below code snippet in your code:- endDate.getMonth() + 1 That is possibly the reason for your issue.. EDIT: if the below code var endDate = new Date("2015-05-08"); is changed to var endDate = new Date(); you will get correct output.. it is because setDate sets the day of the month and April has only 30 days so it is rolled over and you get it as May and you get 31 because 24+7 is 31..
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/47808629
score: 2
has comment: http://stackoverflow.com/comment/47808405
accepted answer of: http://stackoverflow.com/q/29841000
type: AcceptedAnswer

http://stackoverflow.com/q/29843547
has title: Storing REST requests with service workers to sync them
tagged with: service-worker
type: AnsweredQuestion
type: Question
score: 9
linked to: http://stackoverflow.com/q/29206836
tagged with: javascript
has body: I'm thinking about taking my application to offline using service workers. I'm already achieving satisfying results with caching resources, but I also have to check onfetch whether I'm connected to the internet, if not - store the request, and push it onsync. I understand, that future onsync will help with that, but I need - even temporary - solution for that. I've tried just to store the requests in an array within worker, but it's not persistent - doesn't work after computer restart (while SW works and serves offline content). What's the good direction - storing it in cache like files somehow? Or using IndexedDB / SimpleDB (Accessing indexedDB in ServiceWorker. Race condition)?
has answer: http://stackoverflow.com/a/29922616
accepted answer: http://stackoverflow.com/a/29922616
answer count: 1
has comment: http://stackoverflow.com/comment/47825726
linked to: http://stackoverflow.com/q/22342836
downvote count: 0
has comment: http://stackoverflow.com/comment/47962787
favorite count: 0
upvote count: 9
tagged with: offline

http://stackoverflow.com/comment/47584803
has text: That's odd... we definitely use this feature to split our bundles. I'd be willing to discuss our webpack config with you but it's largish and a bit complex, feel free to [contact me](http://brandontilley.com/contact.html) if you want and we can chat.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29722383

http://stackoverflow.com/comment/47538994
type: QuestionComment
score: 8
has text: Either come up with an algorithm or use brute force. But neither is specific to javascript.
comment on: http://stackoverflow.com/q/29701591
type: Comment

http://stackoverflow.com/q/29711300
tagged with: angularjs
tagged with: multidimensional-array
type: UnansweredQuestion
answer count: 0
tagged with: twitter-bootstrap
score: 1
type: Question
has title: Bootstrap AngularJS Pagination with a Multidimensional Array
tagged with: pagination
tagged with: javascript
upvote count: 1
downvote count: 0
favorite count: 0
has body: I am having trouble creating a pagination within a pagination, or multidimensional array pagination. It is not showing the second page of the sub-pagination. I could be wrong, but this seems like unexpected behavior. A bug in Bootstrap, or is it something else? Here is a Plunker that I forked from a Bootstrap example. http://plnkr.co/edit/4kph6VXHWKekd5ef3kdS?p=preview The JavaScript angular.module('ui.bootstrap.demo', ['ui.bootstrap']); angular.module('ui.bootstrap.demo').controller('PaginationDemoCtrl', function ($scope, $log) { // Initializing Array A & B Example $scope.itemsPerPage = $scope.smallItemsPerPage = 2; $scope.bigCurrentPage = $scope.smallCurrentPage = 1; $scope.maxSize = 5; $scope.aArray = [{bArray : [{a:'a'},{b:'b'},{c:'c'}]}, {bArray : [{a:'d'},{b:'g'},{c:'f'}]}, {bArray : [{a:'w'},{b:'z'},{c:'e'}]} ] // End A & B }) .filter('offset', function () { return function (input, start) { if (input === undefined || !angular.isArray(input)) { return null; } start = +start; //parse to int return input.slice(start); }; }); The HTML Default Page {{bigCurrentPage}} of Array A Page {{smallCurrentPage}} of Array B{{($index + 1) + ( (bigCurrentPage - 1) * itemsPerPage)}} {{bObject}}

http://stackoverflow.com/comment/47794016
score: 0
type: QuestionComment
has text: Do you want to do this at run time or at build time?
type: Comment
comment on: http://stackoverflow.com/q/29833676

http://stackoverflow.com/q/29759760
type: Question
has answer: http://stackoverflow.com/a/29759924
answer count: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/29760056
tagged with: javascript
tagged with: jquery
has title: jQuery show/hide div on hover (multipule instances)
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29760056
has comment: http://stackoverflow.com/comment/47651943
has comment: http://stackoverflow.com/comment/47651722
favorite count: 0
possible better answer: http://stackoverflow.com/a/29759924
upvote count: 2
tagged with: css
score: 2
has body: I have 6 thumbnails with 6 hidden captions in a separate div. I'd like to display the respective caption on hover and hide it again on rollout. At the moment I've managed to get it working using the .hide(); and .show(); methods but if the user has rolled over any of the thumbnails before the page has fully loaded the captions stack on top of each other and don't seem to toggle visibility properly. EDIT - Here's a fiddle I put together which shows it in action however I can't seem to replicate the problem seen here http://2xdare.co/projects/ (Try refreshing whilst hovering over thumbnails) I assume this is something to do with how I'm calling the script in relation to the DOM - but I'm not sure what I'm doing wrong (my knowledge of jQuery & Javascript is very limited) Thumbnail: Caption: Title Field captions Captions jQuery: jQuery(document).ready(function($) { // Mobile Nav jQuery(function($){ $( '#nav-toggle' ).click(function(){ $('.responsive-menu').toggleClass('expand') $('.main-header').toggleClass('blackout') }) }); // Coverfade element $(window).scroll(function(i){ var scrollVar = $(window).scrollTop(); $('.coverelement, #arrow').css({ 'opacity':( 300-$(window).scrollTop() )/300 }); }); // CAPTION ROLLOVER $(window).load(function(){ var cancel = false; $("div.surgedesc").hide(); $(".post1").hover(function(){ cancel = (cancel)?false: true; if(!cancel){ $("div.surgedesc").hide(); } else if(cancel){ $("div.surgedesc").show(); } }); var cancel = false; $("div.linierdesc").hide(); $(".post2").hover(function(){ cancel = (cancel)?false: true; if(!cancel){ $("div.linierdesc").hide(); } else if(cancel){ $("div.linierdesc").show(); } }); var cancel = false; $("div.we-are-foreverdesc").hide(); $(".post3").hover(function(){ cancel = (cancel)?false: true; if(!cancel){ $("div.we-are-foreverdesc").hide(); } else if(cancel){ $("div.we-are-foreverdesc").show(); } }); var cancel = false; $("div.worth-popupdesc").hide(); $(".post4").hover(function(){ cancel = (cancel)?false: tr…
type: AnsweredQuestion

http://stackoverflow.com/q/29714898
has comment: http://stackoverflow.com/comment/47565220
favorite count: 0
has title: How to check if specific id is called from jQuery?
has comment: http://stackoverflow.com/comment/47564888
has body: I have a MainContent div which contains main content of the website which could be loaded from ajax. how can i find out if $("#MainContent").load("someUrl") was called, so i am able to push new history state to the webbrowser?
has comment: http://stackoverflow.com/comment/47564874
has answer: http://stackoverflow.com/a/29736789
type: UnansweredQuestion
score: 6
tagged with: model-view-controller
has comment: http://stackoverflow.com/comment/47565245
has comment: http://stackoverflow.com/comment/47564881
type: Question
has comment: http://stackoverflow.com/comment/47564970
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47565194
upvote count: 7
answer count: 1
has comment: http://stackoverflow.com/comment/47565022
downvote count: 1

http://stackoverflow.com/q/29826573
has answer: http://stackoverflow.com/a/41613771
type: Question
has title: What should I return in response to show error message on delete event for blueimp/jquery.file-upload-ui
tagged with: javascript
tagged with: jquery
tagged with: blueimp
has body: I am using jQuery File Upload jQuery UI Plugin 8.7.2 from https://github.com/blueimp/jQuery-File-Upload Uploading and deleting of files work successfully. But what should I return in response JSON to show error when deleting of file not finished correctly on server side. For example user have not access for this. This is my PHP code: $response = json_encode( (object) [ 'files' =&gt; [ $file-&gt;filename =&gt; true, ] ] ); return $response;
answer count: 2
downvote count: 0
favorite count: 0
tagged with: jquery-file-upload
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/32619830
tagged with: php
score: 2
has comment: http://stackoverflow.com/comment/47779590
upvote count: 2
has comment: http://stackoverflow.com/comment/47793715

http://stackoverflow.com/comment/47699097
comment on: http://stackoverflow.com/a/29784123
type: AnswerComment
score: 0
type: Comment
has text: If I'm right, then the last condition is just an `else` after the other two.

http://stackoverflow.com/q/29788706
has title: contentScript: self.on('click', function() { tabs.open(url) }) - I can't open new tab here
has answer: http://stackoverflow.com/a/30010484
tagged with: firefox-addon-sdk
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47706591
upvote count: 1
has body: In my menu item user see already translated selected text - this is doing in onMessage (and now I can't translate and open tab in this function - only translate), and I don't understand - how I can open new tab after user click on item - tabs.open not working at contentScript, even if at contentScript I call a function, or if I change to contentScriptFile. Code of my addon: var contextMenu = require("sdk/context-menu"); var Request = require("sdk/request").Request; var self = require('sdk/self'); var tabs = require('sdk/tabs'); var translating = 'translating...'; var menuItem = contextMenu.Item({ label: translating, image: self.data.url('ico.png'), context: contextMenu.SelectionContext(), contentScript: 'self.on("context", function() {' + 'self.postMessage(window.getSelection().toString());' + 'return true;' + '});' + 'self.on("click", function() {' + 'tabs.open("https://translate.yandex.by/?text=" + window.getSelection().toString());' + // this is not working here '})', onMessage: function(selectionText) { menuItem.label = translating; Request({ url: "https://translate.yandex.net/api/v1.5/tr.json/translate?key=trnsl.1.1.20150402T173446Z.82a90fe78ca2aeaf.a3bd7c7a0f72b260e28f5d92e4f242cf6ba189d3&amp;lang=ru&amp;text="+selectionText, onComplete: function(response) { var translated = response.json.text[0]; menuItem.label = translated; } }).get(); } });
type: Question
tagged with: firefox
accepted answer: http://stackoverflow.com/a/30010484
tagged with: javascript
tagged with: firefox-addon
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/48573620
type: Comment
comment on: http://stackoverflow.com/a/29723317
type: AnswerComment
has text: Sorry. I do have bootstrap.js too. Also in the head:
score: 0

http://stackoverflow.com/comment/47793140
has text: [`onmousemove`](https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onmousemove)
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29833182

http://stackoverflow.com/comment/47548067
score: 0
type: AnswerComment
has text: Seems to work for me: https://jsfiddle.net/pyL8Lqnu/1/ Perhaps that javascript isn't getting rendered on the page?
comment on: http://stackoverflow.com/a/29706024
type: Comment

http://stackoverflow.com/comment/77376605
type: AnswerComment
comment on: http://stackoverflow.com/a/40671393
has text: It seems that Rx.DOM.fromWebSocket can't use with socket.io-server. Rx.DOM.fromWebSocket use w3c standard websocket API.
type: Comment
score: 0

http://stackoverflow.com/q/29798288
possible better answer: http://stackoverflow.com/a/54497252
has answer: http://stackoverflow.com/a/54497252
type: Question
tagged with: javascript
score: 4
answer count: 2
has title: retrieving the aspect ratio of an svg <image>
downvote count: 1
favorite count: 0
upvote count: 5
has answer: http://stackoverflow.com/a/29798491
accepted answer: http://stackoverflow.com/a/29798491
has body: TLDR; given this svg element: &lt;image width="30" height="48" x="3.75" y="6" href="http://some/image.jpg"&gt; How can I retrieve the image's actual height and width (seeing as it is defined in part by the image's aspect ratio). I have a d3js script that draws a bunch of &lt;rect&gt;s and a bunch of &lt;image&gt;s. Now stuff is laid out so that the images fall inside the rects, as though the rects were borders. There is other stuff inside the rects too. Now each of these images has it's own unique and special aspect ratio and this bothers me because it means each of the rects then has a different amount of blank space. This is untidy. To avoid this I want to load the images then get the actual image dimensions and then adjust the positions and sizes of the surrounding goodies. The crux of the matter is getting the actual image sizes. How can I do this? I've googled around a bit and spent some quality time with the debugging console to no avail. Just nothing comes up. I'll keep hunting but an answer would be really nice.
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg

http://stackoverflow.com/comment/47590929
comment on: http://stackoverflow.com/q/29728412
has text: but then the content begin 55px downer. that's not what i want...
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47732818
score: 2
comment on: http://stackoverflow.com/q/29802403
type: QuestionComment
type: Comment
has text: Could you define _very slow to detect_?

http://stackoverflow.com/comment/47755146
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29813739
has text: Where do you declare the rows variable that you're looping through? I believe that might only have one element in it.

http://stackoverflow.com/q/29718503
has comment: http://stackoverflow.com/comment/47735701
score: 1
type: Question
upvote count: 1
tagged with: javascript
has body: Suppose you have a form that manipulates the DOM on submission. What is a good way to reset the DOM to the original state before each spec?
tagged with: jasmine
favorite count: 0
has comment: http://stackoverflow.com/comment/47572628
answer count: 0
downvote count: 0
type: UnansweredQuestion
has title: How to reset a page before each Jasmine spec?

http://stackoverflow.com/comment/47780594
has text: @Grundy Right, but it works for the wrong reason - having `console.log()` triggers Javascript to put an automatic semicolon after the prototype definition, which allows the rest of the code to work.
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29826771

http://stackoverflow.com/q/29714789
has comment: http://stackoverflow.com/comment/47568426
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
tagged with: php
has title: displaying data from sql from clicking on svg map
score: 1
tagged with: mysql
upvote count: 1
has body: I have a svg map embedded into a php page: Map Country: <text class="label" id="country_name"> Regional Representative I got the map from Peter Collingridge's website ..http://www.petercollingridge.co.uk/sites/files/peter/Blank%20map%20display%20names.svg. (Brilliant tutorial on SVG). On the onclick event I need to display the country name I just clicked on the left panel and then I need to get data from a mysql database and display it under that as in Rep name and other data. Is there any tutorials on this or can someone direct me to where I can get help. Ive been searching for 4 days for my solution. Perhaps someone can help. Thanks
type: Question
has answer: http://stackoverflow.com/a/29731937
tagged with: javascript

http://stackoverflow.com/comment/47764952
has text: The laggy-ness is due to the memory and processing power required to move a large background image. IE and mobile browsers have restricted performance and so you will see problems like this unless you can reduce the image size.
comment on: http://stackoverflow.com/q/29819188
score: 2
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47779299
type: Comment
comment on: http://stackoverflow.com/q/29826246
score: 0
type: QuestionComment
has text: Not sure how or why, but that seemed to resolve it!

http://stackoverflow.com/q/29696814
has answer: http://stackoverflow.com/a/29697471
tagged with: javascript
has comment: http://stackoverflow.com/comment/47531215
score: 0
has body: I am having a problem introducing line breaks when using SF2/Sylius modal boxes. In my controller, I have this: $view = $this -&gt;view() -&gt;setTemplate($this-&gt;config-&gt;getTemplate('update.html')) -&gt;setData(array( $this-&gt;config-&gt;getResourceName() =&gt; $resource, 'form' =&gt; $form-&gt;createView(), 'confirmation_message' =&gt; $this-&gt;get('translator')-&gt;trans('ayrshireminis.cars.backend.messages.delete_category') )) ; In my YAML, I have this: messages: delete_category: | Are you sure you want to delete this category? WARNING - Deleting this category will delete any of its subcategories and assets! and the markup for the modal box looks like this: &lt;div class="modal-body"&gt; However, the output looks like this (no breaks): I have read this post, but the solution does not work for me.
has comment: http://stackoverflow.com/comment/47530747
tagged with: modal-dialog
answer count: 1
has comment: http://stackoverflow.com/comment/47530506
accepted answer: http://stackoverflow.com/a/29697471
has comment: http://stackoverflow.com/comment/47530165
tagged with: symfony
has comment: http://stackoverflow.com/comment/47529989
tagged with: php
has comment: http://stackoverflow.com/comment/47530625
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47529654
tagged with: sylius
linked to: http://stackoverflow.com/q/20946837
type: Question
has title: Unable to add a line break in Sylius/Symfony 2 modal box

http://stackoverflow.com/comment/47641070
score: 0
has text: Ok I'm sorry if I didn't know how to explain it and I looked for it in Google and I couldn't find it. The part that I told Noble was correct is using this function somewhere else with different images. As you mentioned I don't know how to do that I'm new to Javascript, sorry about my unprofessionalism but I'll try to keep it simple.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29754064

http://stackoverflow.com/q/29793360
has comment: http://stackoverflow.com/comment/47854257
has body: I am creating a google chrome extension which will load my web-app i have a map component on it, i want this map component to be attachable/deattachable (when user drag it from its position it will open itself in new window, or when user close map's window it will attach to my main app) main.js chrome.app.runtime.onLaunched.addListener(function() { // Center window on screen. var screenWidth = screen.availWidth; var screenHeight = screen.availHeight; var width = 500; var height = 300; chrome.app.window.create('index.html', { id: "helloWorldID", outerBounds: { width: width, height: height, left: Math.round((screenWidth-width)/2), top: Math.round((screenHeight-height)/2) } }); chrome.app.window.onClosed.addListener(function(e) { console.log(e) }); chrome.app.window.onFullscreened.addListener(function(e) { console.log(e) }) }); index.html Hello World Main File MAP and app.js var screenWidth = screen.availWidth; var screenHeight = screen.availHeight; var width = 500; var height = 300; var id = 1; $(document).ready(function(){ $("#menu").sortable({ out: function( event, ui ) { chrome.app.window.create('map.html', { id: "map" + (id++), outerBounds: { width: width, height: height, left: Math.round((screenWidth-width)/2), top: Math.round((screenHeight-height)/2) } }); } }); }); So my question is how to make communication between map.html(which open in seperate window) with index.html(my main app).
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/47814267
tagged with: javascript
score: 0
tagged with: google-chrome-app
tagged with: http://stackoverflow.com/tag/html
has title: dock/undock functionality like chrome-dev tool in my chrome extention
answer count: 0
has comment: http://stackoverflow.com/comment/47898134
type: UnansweredQuestion

http://stackoverflow.com/comment/47710060
type: Comment
has text: Yes that is fine,That is also working inside the if().But before that you have to assign a value to $verbo_name = "";It is advisble to use is_null() rather comparing with NULL.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29790548

http://stackoverflow.com/q/29807029
has body: Can I target a css class for only one URL on my wordpress site? .class a {pointer-events:auto;} .class a[href="URL"]{pointer-events: none;} This isn't working, is there another way? Can I do this with javascript? I need to disable the Add to cart button for a page with a sample part (something that shouldn't be added to cart). The only other unique attribute is data-product_id="32570" is there a way to target data-product_id="32570" in css?
favorite count: 0
has comment: http://stackoverflow.com/comment/47742311
possible better answer: http://stackoverflow.com/a/29807288
tagged with: css
has title: Use css for only one URL
has answer: http://stackoverflow.com/a/29807288
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29807281
score: 1
accepted answer: http://stackoverflow.com/a/29807281
has comment: http://stackoverflow.com/comment/47742308
has comment: http://stackoverflow.com/comment/47742331
has comment: http://stackoverflow.com/comment/47742209
tagged with: wordpress
has answer: http://stackoverflow.com/a/29807320
type: Question
tagged with: javascript
upvote count: 2
answer count: 3
has comment: http://stackoverflow.com/comment/47742316
has comment: http://stackoverflow.com/comment/47742492
downvote count: 1
has comment: http://stackoverflow.com/comment/47742273

http://stackoverflow.com/q/29758326
upvote count: 5
tagged with: angularjs
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/29761355
has answer: http://stackoverflow.com/a/29809342
accepted answer: http://stackoverflow.com/a/29809342
type: Question
tagged with: angularjs-directive
possible better answer: http://stackoverflow.com/a/29761355
answer count: 2
score: 5
tagged with: javascript
has title: Using ng-csv to create a tsv file
tagged with: http://stackoverflow.com/tag/csv
has body: Ultimately I need to create a TSV file. I've been using AngularJS v1.2.20 with the ng-csv module. So far ng-csv is great for csv but it doesnt seem to work well with creating tab separation. My directive looks like TSV but it ends up just putting the raw \t between each of the cells as if I wanted to use "\\t" for example Bob's Tires\t2484775951\t1\t1\t100\t0\t1\t100\t73\t1 I've tried putting \t in decimal-separator and text-delimiter and it didn't help.
favorite count: 0

http://stackoverflow.com/q/29808481
tagged with: jquery
has title: how to grab a fields data from inside an iframe?
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
tagged with: iframe
has comment: http://stackoverflow.com/comment/47745191
has answer: http://stackoverflow.com/a/29808585
has body: I am trying to pull data from inside an iframe that links to http://www.w3schools.com/. I keep getting errors that won't allow me to pull out the data of any field or grab the entire page's html and put it into a variable. I have already tried: $('iframe').html(); I have also tried not loading it in an iframe so it could be accessed easier, but that also didn't work. $(function(){ $("#includedContent").load("http://www.w3schools.com"); });
type: Question
tagged with: javascript

http://stackoverflow.com/comment/47579443
type: Comment
type: QuestionComment
has text: So I checked the error on the console, and I am getting a " TypeError: Cannot read property 'DataTable' of undefined [Chrome specific]". So it looks like "google.load('visualization', '1', {'packages':['annotatedtimeline']});" , which is loading the chart is not being recognized by the drawChart function probably because it is run in a different function. Any way to have this only run after the submit button is clicked? Also, after the first chart creation, how would I make it update for future user selections?
comment on: http://stackoverflow.com/q/29722310
score: 0

http://stackoverflow.com/a/29773557
type: Answer
has body: If you want to do it for optimization purposes (only compute once), as per @Quentin's answer, then no. But if you want to do it for stylistic purposes, you can, but its not really any better... function aopPreface(fn) { return function() { fn.call(this, $(this)); }; }; if (PZ_APP.dom.isAnyDomElement($textInputs)){ $textInputs.on("focus", aopPreface(function($this){ var placeholder = $this.attr('data-placeholder') || "Wpisz tekst..."; if ($this.val() === placeholder){ $this.val(""); } })).blur(aopPreface(function($this){ var placeholder = $this.attr('data-placeholder'); if ($this.val() === ""){ $this.val(placeholder); } })); } I am not advocating for this in this situation because IMO it is not really any cleaner or clearer or faster, but if you do end up doing a lot of the same things before or after a set of function calls, the pattern is a pretty useful refactoring tool. (In your case, the placeholder variable might be movable as well.
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47677890
has comment: http://stackoverflow.com/comment/47677712
upvote count: 1
answers question: http://stackoverflow.com/q/29773253

http://stackoverflow.com/comment/47773338
score: 1
has text: I forgote to change it :/ sorry
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29823285

acrobat
type: Tag
tags question: http://stackoverflow.com/q/29817457
tag name: acrobat
tags question: http://stackoverflow.com/q/29797795

http://stackoverflow.com/q/29709924
answer count: 2
has answer: http://stackoverflow.com/a/29710133
has answer: http://stackoverflow.com/a/29710208
tagged with: forms
has comment: http://stackoverflow.com/comment/47573694
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29710208
tagged with: javascript
tagged with: jquery
has title: Retrieving data from a form loaded with jQuery and passing it to a parent page
has comment: http://stackoverflow.com/comment/47573652
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I have a 'parent' page that is using the following bit of code to pull in a form from a different page on the same domain. There are reasons why I can't just place the form directly on the 'parent'. The form that is pulled in looks like this: Name When 'submit' is clicked, https://example.com/form/ is opened in a hidden iframe and the user name gets properly saved. This all works well. I would like the user name on the currently loaded 'parent' page to update via jquery, so that the user has some immediate visual feedback that the name change has taken place. My approach has been to try and take the value out of the 'field_1' input when 'submit' has been clicked, and pass that variable onto a div in the parent page with an id of 'display_name'. $(document).ready(function(){ function nameUpdate(){ $("#profile-group-edit-submit").click(function () { var updateName = $("#field_1").val(); $("#display_name").text(updateName); }); } nameUpdate(); }); I've also tried adding window.parent. before the the #display_name selector section and it didn't change anything. I've used this approach on another button/div combo on the same page and it works, the difference is that that particular button is in an iframe, not loaded by jquery. So I'm guessing my problem is related to that fact. I've googled around, but have run out of ideas of how to phrase my question, what to look for, etc... Any help would be greatly appreciated. Thanks! Edit: For clarity, the div w/ id #display_name won't update.
possible better answer: http://stackoverflow.com/a/29710133
score: 0
tagged with: iframe

http://stackoverflow.com/q/29731888
favorite count: 0
type: UnansweredQuestion
upvote count: 0
has body: I'm trying to write JavaScript code that removes the HEX representation of an attribute and make it a string. For example, I received this attribute 000: 00 06 f2 20 29 05 b1 11 from the API I and need to convert it to 0006f2202905 b111 in a string. How can I do that?
has title: Remove HEX representation in JavaScript
type: Question
score: -2
tagged with: javascript
downvote count: 2
has answer: http://stackoverflow.com/a/29731964
answer count: 1
has comment: http://stackoverflow.com/comment/47597101

http://stackoverflow.com/a/29799215
downvote count: 0
upvote count: 5
type: Answer
answers question: http://stackoverflow.com/q/29798252
has body: You cannot use setAttribute to create an attribute in a non-null namespace but that's precisely what you are trying to do when creating the xlink:href attribute. The xlink:href attribute must be created via setAttributeNS i.e. el.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', attrs[k]);
accepted answer of: http://stackoverflow.com/q/29798252
score: 5
type: AcceptedAnswer

http://stackoverflow.com/a/29780443
type: Answer
has body: I appreciate the attempt to help but the $SpacingX and $SpacingY did not help in my case. There is a section of the .ascx file that has a hardcoded width. When I edited that, I was able to see all of the thumbnails and position them accordingly:
accepted answer of: http://stackoverflow.com/q/29709679
answers question: http://stackoverflow.com/q/29709679
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/47576395
has text: @user3236149 just use the count of the already existing elements as your id. when you add the new elements, their count will go up as well as your next id.
comment on: http://stackoverflow.com/q/29720879
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47597473
has text: Also, need your sample data. Here's a fiddle of what you posted. http://jsfiddle.net/kL5vh42a/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29730592
score: 0

http://stackoverflow.com/comment/47715090
score: 0
type: Comment
type: QuestionComment
has text: Apologies, the correct fiddle is: http://jsfiddle.net/g1mn79td/4/ The problem i have is targeting the .info divs according to each anchor. One is for Angola and one is for korea. Currently they both show Angola.
comment on: http://stackoverflow.com/q/29793148

http://stackoverflow.com/comment/47582194
score: 0
type: Comment
type: QuestionComment
has text: What do you mean by that? I have never worked with Flex so I may be wrong here (so take it with a grain of salt) but as far as I know the top level object must be a descendant of Sprite, both mx Application and Spark Application. In that case it is a display object. How do you actually trace whether you are getting some error etc.? You cannot run it without the browser. Are you logging the trace() to some file then?
comment on: http://stackoverflow.com/q/29720177

http://stackoverflow.com/comment/47712541
type: QuestionComment
type: Comment
has text: Sorry for it. I corrected it. Please have a look at
comment on: http://stackoverflow.com/q/29789262
score: 0

http://stackoverflow.com/q/29814761
has comment: http://stackoverflow.com/comment/47757068
type: Question
has answer: http://stackoverflow.com/a/29815900
has comment: http://stackoverflow.com/comment/47757133
has comment: http://stackoverflow.com/comment/47761935
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/29816066
answer count: 3
upvote count: 0
has answer: http://stackoverflow.com/a/29814929
has body: i am having a json string like: [ { "message": "Test+sms", "sender": "test", "billcredit": "0.00", "messageStatus": "DND", "sendondate": "2015-04-22 15:22:00", "provider": "aaaa" }, { "message": "Test+sms", "sender": "test", "billcredit": "0.00", "messageStatus": "DND", "sendondate": "2015-04-22 15:22:00", "provider": "aaa" }, { "message": "Test+sms", "sender": "test", "billcredit": "1.00", "messageStatus": "DELIVRD", "sendondate": "2015-04-22 15:22:00", "provider": "aaaa" }, { "message": "Test+sms", "sender": "test", "billcredit": "1.00", "messageStatus": "DND REJECTED", "sendondate": "2015-04-22 15:22:00", "provider": "aaaa" } ] I try doing like this: $objs = json_decode($data,true); foreach ($objs as $obj){ $repor= $obj['messageStatus']; echo $repor; But its not working. Please anybody can help me to get rid out of this. Please help me to upload $repor sequentially in mysql.
has comment: http://stackoverflow.com/comment/47757341
has comment: http://stackoverflow.com/comment/47756932
favorite count: 0
type: UnansweredQuestion
tagged with: php
has title: how to decode nested json in php
downvote count: 1

http://stackoverflow.com/comment/47718546
score: 0
type: Comment
has text: question why are you using the keyup and keydown inputs instead of oninput?
comment on: http://stackoverflow.com/a/29793085
type: AnswerComment

http://stackoverflow.com/q/29745730
upvote count: 1
has comment: http://stackoverflow.com/comment/47815097
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/30567536
has title: Horizontal Autoscroll on mouse drag is not working in D3 tree for firefox
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 1
score: 1
tagged with: css
favorite count: 0
has body: I am creating D3 tree. With the dragging of tree node the auto scroll is not working in Firefox. The auto-scroll with dragging tree node is working in Firefox. It is working fine in Chrome. HTML code &lt;div class="row"&gt; &lt;div class="tree-container" id="treeId"&gt;&lt;/div&gt; &lt;/div&gt; D3.js code var nodeEnter = node.enter().append("g").call(dragListener).attr( "class", "node").attr("transform", function(d) { return "translate(" + source.y0 + "," + source.x0 + ")"; }).on("mouseenter", nodeMouseEnter).on("mouseleave", nodeMouseLeave) .on('click', click).attr('id', function(d) { return d.nodeId; }); $('.tree-container').css('overflow', 'auto'); Bootstrap.css svg:not(:root) { overflow: visible; }
accepted answer: http://stackoverflow.com/a/30567536
tagged with: d3.js

http://stackoverflow.com/comment/85299635
comment on: http://stackoverflow.com/a/29702748
score: 0
type: AnswerComment
type: Comment
has text: A quick way to disable cache is using Chrome's "inspect element" -> Network -> [ X ] Disable Cache. Enable this checkbox and reload the chrome tab, once it loads completely you can un-select it and proceed as normally.

http://stackoverflow.com/comment/47684096
has text: @thefourtheye ah, so they are. To be honest I only scanned the actual implementation as that wasn't really relevant to the question being asked.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29776385

http://stackoverflow.com/comment/47563876
has text: i would one a one time validation after submitting. If all fields are empty, an alert box will popup, instead of individual validation
comment on: http://stackoverflow.com/a/29714434
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47797053
comment on: http://stackoverflow.com/q/29835113
has text: Why would you pass a whole jQuery object to your request?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29761718
has answer: http://stackoverflow.com/a/29776956
answer count: 3
downvote count: 1
has answer: http://stackoverflow.com/a/44663399
tagged with: stripe-payments
favorite count: 0
has answer: http://stackoverflow.com/a/54751394
has comment: http://stackoverflow.com/comment/47655539
type: UnansweredQuestion
upvote count: 4
score: 3
tagged with: forms
has body: I'm using Stripe Custom Checkout. After a successful charge I'm trying to get a form to automatically be submitted. I know the form works but I'm not able to get the form to submit after the stripe checkout processes. I'm pretty sure the code should go after the function(token). The stripe checkout form closes and the form is not submitting. My form: ..Lots of data...... My Strip checkout: Purchase
type: Question
has title: submit form after stripe custom checkout processes
tagged with: javascript

http://stackoverflow.com/comment/47661996
score: 1
type: QuestionComment
has text: Of course its a matter of taste. If you're likely to move toward standards (like ES6), TypeScript feels more natural because it's syntax is just an extension of ES5. With CoffeeScript I feel like the JS developer needs to learn a somewhat-new language, which is not true for TS. I've also seen many successful usages of TS (including my own experience)
type: Comment
comment on: http://stackoverflow.com/q/29764267

http://stackoverflow.com/comment/47786399
score: 0
has text: Strange that it's working at all; `DIM Valu = 10` should be throwing a VBScript error.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29810059

meanjs
tags question: http://stackoverflow.com/q/29772186
type: Tag
tag name: meanjs
tags question: http://stackoverflow.com/q/29696439

http://stackoverflow.com/a/29777785
has comment: http://stackoverflow.com/comment/47686131
has comment: http://stackoverflow.com/comment/47686159
has comment: http://stackoverflow.com/comment/47686591
downvote count: 0
has body: Try shifting the array in a for loop: function rotate(arr, num){ for(var i = 0; i &lt; num; i++){ item = arr[arr.length-1] arr.splice(arr.length-1, 1); arr.unshift(item) } return arr } alert(JSON.stringify(rotate(["Harry", "Sarah", "Oscar", "Tina"], 2))); alert(JSON.stringify(rotate(["Harry", "Sarah", "Oscar", "Tina"], 1)));
score: 1
accepted answer of: http://stackoverflow.com/q/29777547
answers question: http://stackoverflow.com/q/29777547
has comment: http://stackoverflow.com/comment/47686190
has comment: http://stackoverflow.com/comment/47686240
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/51469881
score: 0
type: Comment
has text: Hey, North. Could you please help me why your Jsfiddle code is not working in codepen. I tried to figure out the problem in different editors. However, multiple languages (HTML,CSS, JavaScript) code is not working except in Jsfiddle. Here is the link http://codepen.io/anon/pen/jPXaOw HTML with CSS is not working. Thank you :)
comment on: http://stackoverflow.com/a/31494709
type: AnswerComment

http://stackoverflow.com/comment/47565645
has text: Hi Veprosa, Thanks for the reply. I copy pasted your code and it does seem to work. Can you let me know what changes u did. Apart from getting the CSV contents into the variable "tsv". Also there was a gap earlier between the rectangles.Can you please let me know if you made change to that piece.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29715262
type: Comment

http://stackoverflow.com/comment/47528746
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29696044
has text: @MehdiBrillaud So at least the JQuery works, that's great. But the `position` still doesn't change.
score: 0

http://stackoverflow.com/a/29770076
downvote count: 1
has body: Please change datatype from "text" to "json" then parse that JSON using JSON.parse(//return value "). Var jsonObject = JSON.parse("Ajax Response object"); then use it jsonObject.keyName and it will return the value.
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/47706074
answers question: http://stackoverflow.com/q/29769930
score: -1
has comment: http://stackoverflow.com/comment/47670866

http://stackoverflow.com/q/29828578
tagged with: javascript
has title: Conditional statement to check if an array is empty with angular JS
has answer: http://stackoverflow.com/a/29828629
favorite count: 0
has answer: http://stackoverflow.com/a/29828714
tagged with: angularjs
has answer: http://stackoverflow.com/a/29828798
answer count: 5
has answer: http://stackoverflow.com/a/29828804
accepted answer: http://stackoverflow.com/a/29828636
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29828636
has body: I have this function: $scope.doPaste = function(destination) { if ($scope.selectCopy.ids != []) { console.log("will copy"); $scope.CopyFiles(destination); } if ($scope.selectMove.ids != []) { console.log("will move"); $scope.MoveFiles(destination); } }; In my app, $scope.selectMove.ids and $scope.selectCopy.ids can't be both non-empty. I mean for example when $scope.selectMove.ids is non-empty $scope.selectCopy.ids is empty. My problem is that in the console, I always see both will copy and will move.
type: Question
has comment: http://stackoverflow.com/comment/47783573
possible better answer: http://stackoverflow.com/a/29828714
score: 5
upvote count: 5
tagged with: arrays
downvote count: 0

http://stackoverflow.com/comment/47809161
has text: @ChrisStewart it is because setDate sets the day of the month and April has only 30 days so it is rolled over and you get it as May and you get 31 because 24+7 is 31...
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29841076
type: Comment

http://stackoverflow.com/q/29789076
has comment: http://stackoverflow.com/comment/47708424
answer count: 1
tagged with: javascript
favorite count: 0
has body: what I would like to do is- var t = "search value" regular expression is - [\,,\s]t[\,,\s]+ How can I put it in here- var re = new RegExp(t, 'g');
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29789373
tagged with: regex
score: -1
has comment: http://stackoverflow.com/comment/47708222
has comment: http://stackoverflow.com/comment/47707832
has comment: http://stackoverflow.com/comment/47707296
downvote count: 1
has comment: http://stackoverflow.com/comment/47707913
has comment: http://stackoverflow.com/comment/47707355
type: Question
has comment: http://stackoverflow.com/comment/47707434
has title: javascript regex -What can I do in my case?
upvote count: 0
has comment: http://stackoverflow.com/comment/47707534

http://stackoverflow.com/comment/47576312
type: AnswerComment
score: 0
type: Comment
has text: it seems you misunderstanding a bit ,i mean that when it is running ,and i want to stop it at that time ,at a time that i dont know i=? ,just i want to stop it at that time ,no change code any more ,just write another code so that can exit or stop that function
comment on: http://stackoverflow.com/a/29720650

http://stackoverflow.com/q/29704681
answer count: 1
downvote count: 0
tagged with: javascript
has body: Issuing "pm2 restart all" will restart all of the processes pm2 is managing. I am wondering: If there have been changes to any of the source files, does this actually reload the changes? Or does it just restart the existing pm2 process in memory.
favorite count: 0
has answer: http://stackoverflow.com/a/29704719
tagged with: pm2
tagged with: node.js
type: AnsweredQuestion
has title: Confusion about pm2 restart vs reload
accepted answer: http://stackoverflow.com/a/29704719
score: 10
linked to: http://stackoverflow.com/q/44883269
upvote count: 10
type: Question

http://stackoverflow.com/comment/47662736
type: QuestionComment
comment on: http://stackoverflow.com/q/29763922
has text: @zerkms I mean I spent a long time on it and couldn't get it working. And I think there must be better ways to get that done, which other comments showed that there are.
score: 0
type: Comment

http://stackoverflow.com/comment/47606130
type: AnswerComment
has text: not sure what happened. i copied code and changed image urls. nothing. refreshed screen. full screen display of image, but nothing else, could not even scroll down. hm
type: Comment
comment on: http://stackoverflow.com/a/29736053
score: 0

http://stackoverflow.com/q/29691812
type: Question
has answer: http://stackoverflow.com/a/29692423
linked to: http://stackoverflow.com/q/8567114
tagged with: javascript
has comment: http://stackoverflow.com/comment/47520418
has title: How to pass table data from PHP to javascript to display it in the html form onclick of a submit button
downvote count: 0
has answer: http://stackoverflow.com/a/29691911
favorite count: 0
has answer: http://stackoverflow.com/a/29692213
answer count: 5
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has answer: http://stackoverflow.com/a/29691939
has body: I've a form where i have 4 buttons which are used for "insert, update, delete and retrieve" operations for a table. I can fill in the fields and click any button and respective operations take place. The DB operations takes place in PHP. But when the data is being displayed, it goes to a separate page. I want the table data to be displayed in the same page. I know it's possible using javascript or something but I'm pretty new to this coding. So im getting very confused. Have been trying for the past 3 days. Nothing worked out. If anyone could teach me clearly. HTML: Untitled Document SELECT THE OPERATION YOU WANT TO PERFORM Id: Name: BloodGroup: PHP: <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; $dbname = 'DB'; $conn = new mysqli($dbhost, $dbuser, $dbpass, $dbname); if(mysqli_connect_error()) { die("couldn't connect" . $conn->connect_error()); } $id = $_POST['Id']; $name = $_POST['Name']; $blood = $_POST['BloodGroup']; if(isset($_POST['insert'])){ $insert = "Insert into ins(Id, name, BloodGroup) values ('$id','$name', '$blood')" ; if($conn->query($insert) === TRUE) { echo ("Input data entered successfully"); } else { echo ("Input data failed to be entered" . $conn->error()); } $conn->close(); } elseif(isset($_POST['update'])) { $update = "update ins set Name='".$name."', BloodGroup='".$blood."' where Id='".$id."'"; mysql_query($update); if($conn->query($update) === TRUE) { echo ("Data updated successfully"); } else { echo ("Data cant be updated" . $conn->error()); } $conn->close(); } elseif(isset($_POST['delete'])) { $id = $_POST['Id']; $delete = "delete from ins where Id='".$id."'"; if($conn->query($delete) === TRUE) { echo ("Data deleted successfully"); } else { echo ("Data cant be updated" . $conn->error()); } $conn->close(); } else { $id = $_POST['Id']; $retrieve = "SELECT * FROM ins WHERE Id = ".$id; if ($result=mysqli_query($conn,$retrieve)) { while ($row=mysqli_fetch_row($result)) { echo ' Id Name Blood Group '.$row[0].' '.$row[1].' '.$row[2].'…
score: 1
tagged with: mysql
upvote count: 1
has answer: http://stackoverflow.com/a/29692055

http://stackoverflow.com/comment/47790501
score: 0
comment on: http://stackoverflow.com/a/29830689
type: Comment
has text: Thanks for the edit. It still doesn't work though, since it's pulling the data from a database... I can't define arrays since the times will cycle based on the current time/date. When I try this for other rooms it assumes the time/date is 1:30-2:30 for all, which isn't the case.
type: AnswerComment

http://stackoverflow.com/a/29837280
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47804659
has body: This may prove useful: How do I send a cross-domain POST request via JavaScript? Also, if you do not need to use POST you could use jsonp (no CORS setup required)
has comment: http://stackoverflow.com/comment/47803678
upvote count: 3
has comment: http://stackoverflow.com/comment/47801266
downvote count: 1
answers question: http://stackoverflow.com/q/29837162

http://stackoverflow.com/comment/47638266
type: AnswerComment
comment on: http://stackoverflow.com/a/29732991
type: Comment
has text: Thanks so much for the example, it was very helpful! Here's a picture of what I wanted my chart to look like: http://i61.tinypic.com/9hn9m0.jpg. Do you know how to retain the "look" of that chart (font, sizing, etc), while adding in the code that you provided? Also, is there a way to have the tool-tips appear as a rectangle, rather than a speech blurb?
score: 0

http://stackoverflow.com/q/29775484
has title: Autocomplete in rails
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/47683882
has comment: http://stackoverflow.com/comment/47683573
score: 2
tagged with: coffeescript
has comment: http://stackoverflow.com/comment/47685197
has comment: http://stackoverflow.com/comment/47684751
type: Question
has comment: http://stackoverflow.com/comment/47683092
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29775937
tagged with: ruby-on-rails-4
has comment: http://stackoverflow.com/comment/47682090
has body: In my rails application I have this field with autocomplete &lt;%= f.label :company_name, class: "profile_label" %&gt;&lt;br /&gt; &lt;%= f.text_field :company_name, data: {autocomplete_source: Company.order(:name).map(&amp;:name) },:autocomplete =&gt; :off, class: 'autocomplete-experience form-control profileform-botttom' %&gt; I have also this coffescript file for the autocomplete jQuery -&gt; $('.autocomplete-experience').autocomplete source: $('.autocomplete-experience').data('autocomplete-source') select: (event,ui) -&gt; $("input.xx").val(ui.item.id) This works but only for the first field. When I add another field thought the link to add method the autocomplete won't work for the second field. why is this and how can I resolve this? Update this is the code used to add fields $('form').on 'click', '.add_fields', (event) -&gt; time = new Date().getTime() regexp = new RegExp($(this).data('id'), 'g') $(this).before($(this).data('fields').replace(regexp, time)) event.preventDefault() the warning message &gt; SyntaxError: expected expression, got '&lt;' edit:1069:2 Use of &gt; getPreventDefault() is deprecated. Use defaultPrevented instead. edit &gt; SyntaxError: expected expression, got '&lt;' edit:2:2 SyntaxError: &gt; expected expression, got '&lt;' edit:2:2 and this is the code that give this warning $('#resume-tab a').click(function (e) { e.preventDefault() $(this).tab('show') });
has comment: http://stackoverflow.com/comment/47682841
has comment: http://stackoverflow.com/comment/47681606
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47682732
has comment: http://stackoverflow.com/comment/47681791

http://stackoverflow.com/comment/47522578
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29692617
type: AnswerComment
has text: The `openweathermap` doesn't seem to support HTTPS, so your relative protocol would break here.

http://stackoverflow.com/a/29729970
upvote count: 4
has comment: http://stackoverflow.com/comment/47593687
downvote count: 0
has comment: http://stackoverflow.com/comment/47593716
answers question: http://stackoverflow.com/q/29729804
has body: You can add those as parameters to the function and make it like below function ajaxcall(url, data, targetDivId) { $.ajax({ type: "POST", url: url, data : data, success: function( returnedData ) { $("#"+targetDivId).html( returnedData ); } }); } For your scenario: I assume that even the AJAX url may change as currently it's pointing to create.php. In case it's same then you can avoid tht parameter. Create update Delete
has comment: http://stackoverflow.com/comment/101082913
accepted answer of: http://stackoverflow.com/q/29729804
score: 4
has comment: http://stackoverflow.com/comment/47593434
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/47753397
type: QuestionComment
comment on: http://stackoverflow.com/q/29812701
score: 0
has text: Are you sure you actually mean `office.hasOwnProperty("president")`? It seems to me you might want to use `voteCount[prop].hasOwnProperty(office[prop])` instead.
type: Comment

http://stackoverflow.com/comment/47672621
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29770893
has text: @doldt That is what i am doing, i am trying to loop through the object.
score: 0

http://stackoverflow.com/comment/47737153
has text: A JSFiddle, code snippet or codepen would really help out.
comment on: http://stackoverflow.com/q/29804682
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29694421
has comment: http://stackoverflow.com/comment/47526410
has comment: http://stackoverflow.com/comment/47532061
upvote count: 0
answers question: http://stackoverflow.com/q/29694266
score: -2
has comment: http://stackoverflow.com/comment/47526151
has body: Do this: &lt;h:inputText id="propertyId" value="#{Bdconnection.str}" /&gt; and access in script document.getElementById('propertyId').val();
downvote count: 2
type: Answer

http://stackoverflow.com/q/29738827
has body: I have a form, using jquery Datepicker and jquery validation plugin , but it is not work. The Datepicker cannot show out and jquery validation plugin not doing validate. HTML name enter name password enter password password 2 enter password again email enter mail date date mail tel tel place a b place code yes JavaScript How can i fix the problem? The jsfiddle
has title: JQuery not working in html form
accepted answer: http://stackoverflow.com/a/29739246
has comment: http://stackoverflow.com/comment/47610853
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47611524
has comment: http://stackoverflow.com/comment/47611434
has comment: http://stackoverflow.com/comment/47610952
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29739246
has comment: http://stackoverflow.com/comment/47610989
has comment: http://stackoverflow.com/comment/47610914
tagged with: forms
downvote count: 1
type: Question
upvote count: 0
tagged with: javascript
tagged with: jquery
score: -1

http://stackoverflow.com/comment/47696358
has text: @AdamKewley Exactly, one below the other, and each in a 12 column grid (100%)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29783111

http://stackoverflow.com/comment/47904422
type: AnswerComment
has text: I updated my code. I used console.log and I think that my error is in radarSearch function, but i dont understand why.
type: Comment
comment on: http://stackoverflow.com/a/29845501
score: 0

http://stackoverflow.com/a/29708467
upvote count: 2
has comment: http://stackoverflow.com/comment/47646829
accepted answer of: http://stackoverflow.com/q/29707083
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29707083
has comment: http://stackoverflow.com/comment/47592902
has comment: http://stackoverflow.com/comment/47623945
has body: Edited answer: I usually inject my JS script code in the header all inside of an IFFE. You'd also have to make sure you have the ng-app in there to specify the module. Finally I've made sure I actually include the dependent code in the header before my code. See fiddle here Something {{dirPanelElementText}}
has comment: http://stackoverflow.com/comment/47647448
type: Answer
has comment: http://stackoverflow.com/comment/47639662
score: 2
has comment: http://stackoverflow.com/comment/47553439
downvote count: 0
has comment: http://stackoverflow.com/comment/47552891

http://stackoverflow.com/q/29831231
tagged with: javascript
has answer: http://stackoverflow.com/a/29831313
has comment: http://stackoverflow.com/comment/47789036
answer count: 2
downvote count: 2
has title: PHP query runs even if button is not clicked
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47789029
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47788994
tagged with: php
upvote count: 0
has answer: http://stackoverflow.com/a/29831355
has body: I have a strange problem. I have set a query to insert two names in the database. I have also used Javascript(Jquery) to run it only when the create button is clicked. But it runs evry time I reload the page... Button: Create Script: $(document).ready(function(){ $("#button-create").click(function(){ $('body').append(' Homework Delete Valkommen! ').children(':last').hide().slideDown(500); <?php $query123 = $pdo->prepare("INSERT INTO post (head, content) VALUES ('John', 'Doe')"); $query123->execute(); ?> }); });
tagged with: mysql
type: Question
score: -2
tagged with: database

http://stackoverflow.com/q/29759163
upvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
tagged with: php
has title: AJAX - my simple ajax request does not work
score: -1
has comment: http://stackoverflow.com/comment/47650624
has answer: http://stackoverflow.com/a/29759233
has comment: http://stackoverflow.com/comment/47650757
has answer: http://stackoverflow.com/a/29759210
downvote count: 1
type: Question
tagged with: javascript
has body: I'm currently learning how to use Ajax but i already have a problem : 1 HTML : &lt;body&gt; &lt;form&gt; Nom d'utilisateur : &lt;input type="text" id="username" name="username"/&gt; &lt;input type="submit" id="submit" /&gt; &lt;/form&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="script.js"&gt;&lt;/script&gt; JS : $(document).ready(function(){ $("form").submit(function(e){ e.preventDefault(); var don=$('#username').val(); $.ajax({ url:'test.php', type:'post', data:don, success: function(html){ alert(html); } }); }); }); PHP : &lt;?php if(!empty($_POST['username'])){ $response="yep"; } else{ $response="nope"; } echo $response; ?> As you can see, it is really simple. But it drives me crazy, i didn't understand why i always have the response "nope". Can you help me ? Thank you
answer count: 2

http://stackoverflow.com/comment/47843219
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29824080
has text: should be automatically adjusted to the screen width, and every time somone changes it it should set the body automatically to that size.
type: AnswerComment

http://stackoverflow.com/comment/47653414
comment on: http://stackoverflow.com/a/29759473
score: 0
type: Comment
has text: I had to revert to this method because I couldn't figure out how to add the css arrow to the button using the other method because the active class shifted to the div. I got this to work ok now, so thank you!
type: AnswerComment

http://stackoverflow.com/q/29707615
tagged with: google-chrome
tagged with: knockout.js
type: Question
has comment: http://stackoverflow.com/comment/47550969
tagged with: javascript
has comment: http://stackoverflow.com/comment/47558106
has comment: http://stackoverflow.com/comment/47552543
answer count: 1
downvote count: 0
has body: var statusDatesDescending = ko.computed(function () { var result = cachedSortExpression() === "StringValue"; logger.log(result); return result; }); The following provides this in the console when result is false: logger.log("DESCENDING: ", result); DESCENDING: undefined The following provides this in the console when result is true: logger.log("DESCENDING: ", result); DESCENDING: true
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47551326
tagged with: durandal
has answer: http://stackoverflow.com/a/29709726
has comment: http://stackoverflow.com/comment/47551287
score: 1
has title: falsey var showing undefined in console.log
upvote count: 1

http://stackoverflow.com/q/29745940
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47624877
score: -1
possible better answer: http://stackoverflow.com/a/29745987
answer count: 2
has answer: http://stackoverflow.com/a/29746045
has title: How to pass a string as argument JavaScript function?
downvote count: 1
has comment: http://stackoverflow.com/comment/47627551
accepted answer: http://stackoverflow.com/a/29746045
has comment: http://stackoverflow.com/comment/47624909
tagged with: javascript
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/47624194
tagged with: jquery
favorite count: 0
has body: I am trying to pass some HTML code as String in a Javascript function but it keeps-on being executed as HTML code and not as a parameter, even by putting the quotes to delimit it as a string. The navigator reads the string not as parameter but as HTML code. It's the function cancelVolet() inside the img tag, 4th line: function editVoletVisual(r){ var x = new String(r.parentNode.parentNode.innerHTML); var y = x.replace('"','\"'); r.parentNode.innerHTML="&lt;input name=\"edtVolet\" type=\"text\" id=\"edtVolet\"&gt;&lt;img src=\"ressources/images/dlt.png\" align=\"top\" id=\"canceler\" onclick=\"cancelVolet(\""+y+"\")\"&gt;"; } Here is the problem: On clicking on the Edit Button (image with paper and pen) The Yellow highlighted part is supposed to be a parameter, not HTML code to be showed! How can I solve this problem, please help?
has answer: http://stackoverflow.com/a/29745987
type: Question
has comment: http://stackoverflow.com/comment/47624170

http://stackoverflow.com/comment/47732405
comment on: http://stackoverflow.com/q/29802104
type: Comment
type: QuestionComment
has text: I think "must be answered by experts" is a bit strong, google could have probably got you there
score: 0

http://stackoverflow.com/comment/47621300
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29744340
has text: just make a request to a php page that will handle the data. You could also do this with ajax so the page doesn't have to be reloaded
type: Comment

http://stackoverflow.com/a/29777434
score: 3
has comment: http://stackoverflow.com/comment/47685036
has comment: http://stackoverflow.com/comment/47685067
upvote count: 3
type: AcceptedAnswer
downvote count: 0
has body: next() looks for the next element after the one you selected. And it is no longer the content element. The next element is the paragraph you just inserted. $(this).parent().siblings('.content').slideToggle(250);
accepted answer of: http://stackoverflow.com/q/29777320
type: Answer
has comment: http://stackoverflow.com/comment/47685129
answers question: http://stackoverflow.com/q/29777320
has comment: http://stackoverflow.com/comment/47685104

http://stackoverflow.com/comment/47688738
type: Comment
comment on: http://stackoverflow.com/a/29779335
has text: The bottom of the page is not `100`, this wouldn't work as expected.
type: AnswerComment
score: 0

http://stackoverflow.com/q/29724951
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/12461096
tagged with: javascript
has title: How To Automate Teamwork Backup Download
has answer: http://stackoverflow.com/a/29990084
has body: I'm trying to automate downloading the backup file created by Teamwork. The way it works is you login, go to a page which loads a dynamically generated iframe with a src="https://tw-backup.teamwork.com/ext.cfm?backupaction=downloadLatestMySQLBackup". I've tried getting the actual link from from the iframe, but I haven't gotten that to work. However, the truncated link I'm using seems to work if I enter it in the browser. So I'm just trying to open it directly. Unfortunately, it just seems to hang. EDIT phantomjs --version = 1.9.8; Getting this error: [debug] [phantom] url changed to "https://tw-backup.teamwork.com/ext.cfm?backupa ction=downloadLatestMySQLBackup" [debug] [phantom] Successfully injected Casper client-side utilities [info] [phantom] Done 8 steps in 3427ms finished Unsafe JavaScript attempt to access frame with URL about:blank from frame with U RL file:///c:/Users/Brad/AppData/Roaming/npm/node_modules/casperjs/bin/bootstrap .js. Domains, protocols and ports must match. So is the problem that I'm trying to access a different sub-domain than from where I start? You can get a free trial of Teamwork if you're interested in this problem. And BTW, we're making good use it for project management. var casper = require('casper').create(); casper.start('https://myco.teamwork.com/', function () { console.log("start"); this.waitForSelector("input[name='userLogin']", function success() { this.sendKeys("input[name='userLogin']", "me@myco.org"); }, function fail() { test.assertExists("input[name='userLogin']"); }); this.waitForSelector("input[name='password']", function success() { this.sendKeys("input[name='password']", "somePassword"); console.log("login successful"); }, function fail() { test.assertExists("input[name='password']"); console.log("login failed"); }); this.thenOpen('https://tw-backup.teamwork.com/ext.cfm?backupaction=downloadLatestMySQLBackup'); });
type: Question
has comment: http://stackoverflow.com/comment/47589102
linked to: http://stackoverflow.com/q/26608391
tagged with: casperjs
score: 0
has comment: http://stackoverflow.com/comment/47643954
has comment: http://stackoverflow.com/comment/47644002
tagged with: selenium
accepted answer: http://stackoverflow.com/a/29990084
answer count: 1
has comment: http://stackoverflow.com/comment/47644538
tagged with: selenium-webdriver
tagged with: phantomjs
has comment: http://stackoverflow.com/comment/47643604
has comment: http://stackoverflow.com/comment/47640919
has comment: http://stackoverflow.com/comment/47644196

http://stackoverflow.com/q/29806066
has comment: http://stackoverflow.com/comment/47740318
tagged with: kendo-ui
has comment: http://stackoverflow.com/comment/47740826
has comment: http://stackoverflow.com/comment/47740633
score: 0
has comment: http://stackoverflow.com/comment/47741594
has body: On the 100% Stacked Chart, I cannot get the valueAxis format property to render a full % amout from 0 to 100%. Please see my plunk here: http://plnkr.co/edit/2nvnbDSHAdaSpOeJbHzn?p=preview You'll find it's a very simple example, with an index.html file and one script.js. The $scope.chartOptions object is assigned in script.js. It is incorrectly displaying the percentage as : 0% 0.2% 0.4% ... 1% The html div is defined as follows: &lt;div kendo-chart k-options="chartOptions" k-rebind="chartOptions"&gt;&lt;/div&gt; I've read the online samples, and also read the Kendo docs at http://docs.telerik.com/kendo-ui/api/javascript/kendo#methods-format. And I've tried kendo.toString("{0}", "p") to format it property, but can't get it. http://demos.telerik.com/kendo-ui/bar-charts/stacked100-bar your help is appreciated. thanks, Bob
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47740420
type: AnsweredQuestion
has title: Angular-Kendo Stacked charts with percentage formatting
has comment: http://stackoverflow.com/comment/47740139
has answer: http://stackoverflow.com/a/29806919
accepted answer: http://stackoverflow.com/a/29806919
has comment: http://stackoverflow.com/comment/47741569
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/29779763
answers question: http://stackoverflow.com/q/29778457
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2
score: 2
accepted answer of: http://stackoverflow.com/q/29778457
has body: pausableBuffered keeps a buffer when paused and drains the buffer when resume is called. What you want looks more like a controlled observable, where you say source.request(1). See the rxjs docs on backpressure for more info. var animation = new Rx.Subject(); var source = animation.controlled(); source .subscribe(function(frame) { console.log('new event', frame); setTimeout(function() { console.log('after timeout', frame); source.request(1); }, frame.duration); }); source.request(1); animation.onNext({ duration: 1000 }); console.log('animation.onNext 1'); animation.onNext({ duration: 2000 }); console.log('animation.onNext 2'); animation.onNext({ duration: 3000 }); console.log('animation.onNext 3')

http://stackoverflow.com/q/29790154
has title: How to show live chat dialog box on click of button?
upvote count: 3
answer count: 2
downvote count: 2
possible better answer: http://stackoverflow.com/a/29790541
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/47709435
has answer: http://stackoverflow.com/a/29790735
has answer: http://stackoverflow.com/a/29790541
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29790735
type: AnsweredQuestion
score: 1
tagged with: jquery
favorite count: 0
type: Question
has body: I want to show a live chat form in my website which will open on click of a button. The chat form that I need to show is in a separate file. How can I do that using jquery? It also needs to be responsive. Something like this: https://www.websitealive.com/
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/47610085
has text: @adeneo don't show any error, but don't work event click
comment on: http://stackoverflow.com/q/29738359
score: 0
type: QuestionComment
type: Comment

model-view-controller
tags question: http://stackoverflow.com/q/29764079
tag name: model-view-controller
tags question: http://stackoverflow.com/q/29781804
tags question: http://stackoverflow.com/q/29716098
tags question: http://stackoverflow.com/q/29767987
tags question: http://stackoverflow.com/q/29716201
tags question: http://stackoverflow.com/q/29767399
tags question: http://stackoverflow.com/q/29817846
tags question: http://stackoverflow.com/q/29714898
type: Tag
tags question: http://stackoverflow.com/q/29698713
tags question: http://stackoverflow.com/q/29818890
tags question: http://stackoverflow.com/q/29800556

http://stackoverflow.com/q/29725687
has body: I am trying to retrieve json data from zendesk, then compare the value of the ids in each ticket that is retrieved from the server with the id inside my table data. If the ids match, then I want to retrieve the custom field value inside the ticket with the matching id, and append it to the table data's that i have named with the product id. The idea is to target each "td/td",and automatically insert the custom field(product id) value when a new "td/td" tag is created. Please help :) The Object 99 at the top is the ticket, the id :175 is the id I am trying to match. the custom_field array[10] value is what I want to append and display. The issue I am having is that the data is not displaying after I append it. I think this has something to do with how I am accessing the data, comparing the ids, then appending the custom field. The array value is returning a -1 instead of comparing the IDs. This is the problem. //first lets get some json data! var getjson = $.getJSON("/api/v2/tickets.json)",function (result) { $.each(result, function(i, field) { console.log('data',field); // now lets take the text id for each td and assign it as the id. $(".sort &gt; tr &gt; td:nth-child(1)").each(function(){ var textid = $(this).text(); $(this).attr('id', textid); // if the ids match, give me the value of the custom field that is inside the array of the matching id. var arr = [field]; var arrayvalues = $.inArray('id', arr); if ($(this).attr('id') == arrayvalues){ /* if the ids match, give me the value of the custom field that is inside the array of the matching id. */ var returns = $.inArray('value',arr.custom_fields[i]); // now for each td lets append the value of the custom field. $(".sort &gt; tr &gt; td:nth-child(7)").each(function () { $(this).append(returns); $(this).attr('id','product'); }) } }) });
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29784233
tagged with: ajax
has comment: http://stackoverflow.com/comment/47585719
score: 0
possible better answer: http://stackoverflow.com/a/29726174
has answer: http://stackoverflow.com/a/29726174
has comment: http://stackoverflow.com/comment/47585892
has answer: http://stackoverflow.com/a/29784233
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47585570
has comment: http://stackoverflow.com/comment/47585700
tagged with: http://stackoverflow.com/tag/json
has title: jQuery get json data, match the ids, then append the custom field value
type: Question
answer count: 2

http://stackoverflow.com/comment/47616196
score: 0
type: Comment
has text: This is an good idea, but what if I want to have different Y values? Let us say that I have two different sensors.
comment on: http://stackoverflow.com/a/29741438
type: AnswerComment

http://stackoverflow.com/comment/47829822
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29802191
type: AnswerComment
has text: Actually the "get point by ID" only seems to be an option in Highstock, not Highcharts...

http://stackoverflow.com/q/29804018
type: Question
has comment: http://stackoverflow.com/comment/47736159
has comment: http://stackoverflow.com/comment/47736829
has comment: http://stackoverflow.com/comment/47736016
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47736721
answer count: 2
has comment: http://stackoverflow.com/comment/47736206
has comment: http://stackoverflow.com/comment/47736572
tagged with: jquery
has comment: http://stackoverflow.com/comment/47736147
has comment: http://stackoverflow.com/comment/47736347
has comment: http://stackoverflow.com/comment/47736612
has comment: http://stackoverflow.com/comment/47736072
has body: Well, I am currently trying to set a timer on a redirect to another webpage, however when I use settimeout it does not work. setTimeout(function() { window.location.replace("https://github.com/Riggster""); }, 2000); It redirects me, however it does not wait two seconds. And I am not sure why. $(document).ready(function () { var gsb = $('.github-side-bar'); var rd = $('.redirectnotice'); gsb.on('click' , function() { $('html, body').animate({ scrollTop: 0 }, 500); rd.show('slow'); setTimeout(function() { window.location.replace("https://github.com/Riggster""); }, 2000); }); Associated HTML: Redirecting you
accepted answer: http://stackoverflow.com/a/29804510
has title: Jquery settimeout not waiting to redirect
possible better answer: http://stackoverflow.com/a/29804214
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29804214
has comment: http://stackoverflow.com/comment/47736014
has answer: http://stackoverflow.com/a/29804510
has comment: http://stackoverflow.com/comment/47736409

http://stackoverflow.com/q/29742102
has body: When people fill in a form, all the data gets send and saved in a database. For example: Now people fill in the distances of the axles (In the next page), and the axle distances get updated. They do the same for the bogie table (Tough not with distances but with bogie numbers) After this all is filled in, the DB looks like this: Train information: axle: bogie: Now with the folowing information, it makes a train shape. Now i make this shape, by selecting the number of axles, and turn them in a circle. I set the distances by selecting the axle table, and use margin-left. Now. The actual things that need to be added, have a axle distances of 1000-4000 each. So when i add that, the train will be huge if it takes shape. So i was thinking, (but don't know if it is posible) to instead of set the end result distance by the axle distance. But with the bogie numbers. So axle 1 and 2 have the bogie number 1. And i want the bogie number 1 to be on the left. axle 3 and 4 have the bogie number 2. And i would like to have those like 200px next to the number 1. axle 5 and 6 have the bogie number 3. And i would like to have those 200px next to the number 2. Etc. Etc. This is how to end_results makes it shape: &lt;div id="axle_position2"&gt; &lt;?php foreach($show_axle as $axlefigure){ ?&gt; &lt;div style="margin-left:&lt;?php echo $axlefigure['distance'];?&gt;px;"&gt; &lt;?php echo $axlefigure['axle'] ?&gt; &lt;/div&gt; &lt;?php } ?&gt; &lt;/div&gt; The function it does is just a: SELECT * FROM axle where train_id = train_id EDIT: Here a example:
has title: javascript change position depending on number
upvote count: 5
tagged with: mysqli
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css
has comment: http://stackoverflow.com/comment/47617508
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47679504
accepted answer: http://stackoverflow.com/a/29775208
type: Question
score: 3
has comment: http://stackoverflow.com/comment/47617441
has comment: http://stackoverflow.com/comment/47677262
has answer: http://stackoverflow.com/a/29775208
downvote count: 2
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/29799348
has body: I have a page that needs to do a postback via OnClick to the page after window.print() is called. I have spent a couple of hours looking for a solution, but so far haven't found the right combination. I set up a test page to make sure there was no other javascript interfering. Here is the code &lt;asp:Button ID="Print" runat="server" Text="Print" OnClientClick = "window.print();return true;" UseSubmitBehavior="false" OnClick="Print_Click" /&gt; protected void Print_Click(object sender, EventArgs e) { Response.Write("Clicked"); } That is the rendered button as in the browser: &lt;input id="Print" class="button" type="button" onclick="window.print();return true;__doPostBack('Print','')" value="Print" name="Print"&gt; The postback is not happening and the print_click is not being called. I have also tried adding the onclientclick in the code behind on page_load I would appreciate any help- I think I have looked at 100+ search results. Thanks, Judy
has answer: http://stackoverflow.com/a/29802584
tagged with: javascript
tagged with: webforms
score: 0
has title: window.print onclientclick preventing onclick in codebehind
answer count: 2
tagged with: code-behind
has comment: http://stackoverflow.com/comment/100904238
has comment: http://stackoverflow.com/comment/47726862
tagged with: asp.net
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47726815
has answer: http://stackoverflow.com/a/29834653
has comment: http://stackoverflow.com/comment/101009438
type: Question
tagged with: c#

http://stackoverflow.com/q/29824014
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29824399
score: 0
possible better answer: http://stackoverflow.com/a/36887602
has answer: http://stackoverflow.com/a/36887602
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29824399
tagged with: repeater
has body: <asp:Repeater runat="server" ID="rptPckgInclusions"> Parent MarkUp <asp:CheckBox runat="server" ID="chkApplyParentMarkUp" OnClick="javascript:EnableDisablePkgInclusionDropDown(<%# Container.ItemIndex %>);"/> </asp:Repeater> I am trying to pass container.ItemIndex as an argument to javascript function on checkbox OnClick event to enable/disable few controls.But Its not showing the value in Javascript function. Thanks in advance!
has title: Not able to pass repeater Container.ItemIndex to javascript function as an argument
type: Question
answer count: 2
tagged with: javascript

http://stackoverflow.com/comment/47809085
has text: I tried various ways.. the reason behind the "toggle" not working is the Panel gets opened before the `$("#popupPanel1").panel("open");` / `$("#popupPanel1").panel("toggle");` line, so while it comes to toggle it gets closed.
type: QuestionComment
comment on: http://stackoverflow.com/q/29825370
score: 0
type: Comment

http://stackoverflow.com/a/29799184
score: 0
has comment: http://stackoverflow.com/comment/47726994
has body: I guess it needs time for binding video. you can use setTimeout function for delay. var delay =100; setTimeout(function () {/*your function*/ }, delay); delay = delay + 300;
type: Answer
answers question: http://stackoverflow.com/q/29798678

http://stackoverflow.com/q/29759638
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has body: I am trying to apply a hover effect to the images in my WP theme. It is a grid of images created by the featured image on the posts. the grid is controlled in content.php &lt;?php /** * controls main grid images */ ?&gt; &lt;article id="post-&lt;?php the_ID(); ?&gt;" &lt;?php post_class('col-md-4 col-sm-4 pbox '); ?&gt;&gt; &lt;div class = "box-ovrly"&gt; &lt;h2 class="box-title"&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;" rel="bookmark"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt; &lt;div class="box-meta"&gt;&lt;?php the_category(', '); ?&gt;&lt;/div&gt; &lt;/div&gt; &lt;?php $thumb = get_post_thumbnail_id(); $img_url = wp_get_attachment_url( $thumb,'full' ); //get full URL to image (use "large" or "medium" if the images too big) $image = aq_resize( $img_url, 750, 560, true ); //resize &amp; crop the image ?&gt; &lt;?php if($image) : ?&gt; &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt; &lt;img class="img-responsive hover-decal" src="&lt;?php echo $image ?&gt;"/&gt;&lt;/a&gt; &lt;?php endif; ?&gt; &lt;/article&gt;&lt;!-- #post-## --&gt; I want to turn 'box-overly' div into the overlay on top of the image but can't find the proper js and css. the css I have right now ... .box-ovrly { z-index: 100; position: absolute; top: 0px left: 0px; } It puts the title and category on top of the image. I want it to have a background to cover the image on hover, but not to show up at all until hovered over the perfect example of what i'm looking to do (eventually different background colours, etc. But I don't want any text on the image until hovered) for is on this portfolio http://redantler.com/work/
type: UnansweredQuestion
tagged with: css
score: 3
upvote count: 3
tagged with: wordpress
type: Question
has answer: http://stackoverflow.com/a/29760111
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29759847
answer count: 2
has title: Hover effect over image

http://stackoverflow.com/a/29747319
downvote count: 0
has comment: http://stackoverflow.com/comment/47627282
has comment: http://stackoverflow.com/comment/47627185
type: Answer
upvote count: 3
has body: Here is an easy solution: Create the following CSS-Styles: .nav_content.visible { max-height: 400px; } .nav_content.invisible { max-height: 0px; } Set the overflow property for your nav_content to hidden: .nav_content{ overflow: hidden; } Now add the class invisible to your submenus, if you want them to be invisible by default (you can do this manually in the markup or by js code): Manually e.g.: &lt;div id="nav_prefs" class="nav_content invisible"&gt; or by code (after the elements have been loaded): $(".nav_content").addClass("invisible); Now, if you just need to adjust your drop_down function to toggle the element's invisible/visible class: function drop_down(dropdownID){ $('#'+dropdownID).toggleClass("visible invisible"); } UPDATE: To make all visible submenus disappear when clicked elsewhere use this piece of code, when the window is loaded: $(document).on('click', function (e) { if (!$(e.target).is('.nav_item') &amp;&amp; !$(".nav_item").has(e.target).length !== 0) { $('.nav_content.visible').toggleClass("visible invisible"); } }); If you only want to have one submenu visible at a time, you can use this version of your drop_down function: function drop_down(dropdownID) { $('.nav_content.visible').toggleClass("visible invisible"); $('#' + dropdownID).toggleClass("visible invisible"); } A working fiddle can be found here EDIT: Since you used jQuery in your original code, I assumed the answer can use jQuery too
answers question: http://stackoverflow.com/q/29746660
score: 3
accepted answer of: http://stackoverflow.com/q/29746660
type: AcceptedAnswer

http://stackoverflow.com/q/29824582
favorite count: 0
linked to: http://stackoverflow.com/q/31842504
accepted answer: http://stackoverflow.com/a/29881416
tagged with: xlsb
has body: I'm planing to use SheetJS with rhino. And sheetjs takes a binary object(BLOB if i'm correct) as it's input. So i need to read a file from the system using stranded java I/O methods and store it into a blob before passing it to sheetjs. eg :- var XLDataWorkBook = XLSX.read(blobInput, {type : "binary"}); So how can i create a BLOB(or appropriate type) from a binary file in java in order to pass it in. i guess i cant pass streams because i guess XLSX needs a completely created object to process.
has answer: http://stackoverflow.com/a/29881416
type: AnsweredQuestion
has title: Reading a binary file from the file system as a BLOB to use in rhino with javascript
tagged with: rhino
score: 1
tagged with: java
type: Question
upvote count: 1
downvote count: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/29762511
has body: I'm trying to dynamically stretch my divs based on the length of the string within it. How can this be done? &lt;div width=magic_function();&gt; pickle &lt;/div&gt; I'm currently using php's strlen in a clever way to achieve this, but I feel it is process-intense. &lt;style&gt; .tag { padding-bottom:2px; position:relative; background:#BFC9D9; margin-right:auto; margin-left:auto; width:???; text-align:center; border-top-right-radius:2px; border-bottom-right-radius:2px; margin-top:3px; margin-bottom:3px; } .tag:after { right:100%; top:50%; border:solid transparent; content: " "; height:0; width:0; position:absolute; border-right-color:#BFC9D9; border-width:10px; margin-top:-10px; } &lt;/style&gt;
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
tagged with: css
has title: How can I modify the length of a div based on the length of the string within it?
type: AnsweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/29762569
type: Question
has comment: http://stackoverflow.com/comment/47656773
accepted answer: http://stackoverflow.com/a/29762569
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/47753560
score: 0
type: Comment
has text: hey, ok, but it seems to count things 4 times, rather than just once??
comment on: http://stackoverflow.com/a/29812811
type: AnswerComment

http://stackoverflow.com/q/29743719
upvote count: 3
has answer: http://stackoverflow.com/a/30364926
accepted answer: http://stackoverflow.com/a/30364926
answer count: 1
favorite count: 0
tagged with: kendo-ui
has title: How to place pie charts instead of markers in kendo ui maps
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
downvote count: 0
type: Question
score: 3
tagged with: javascript
has body: I need to create a map widget using kendo map UI .I have to replace the markers with pie chart like this . Is it possible to create a map widget using kendo ??? , If it is possible how can I do that .I dont know how to make this I'm new to Kendo. Please Help me...

http://stackoverflow.com/a/29794762
score: 5
type: Answer
answers question: http://stackoverflow.com/q/29794552
has body: You can use the event.type. Some will say it's bad practice and others may find it useful. $("body").on("change click", ".element", function(event) { switch (event.type) { case 'click': break; case 'change': break; default: } }); jQuery event.type
upvote count: 5
downvote count: 0

http://stackoverflow.com/q/29831845
answer count: 1
tagged with: javascript
score: 0
has body: Below is the countdown timer. When I use two if statemtns the time jumps 2 seconds by 2 seconds. How do I add two if statemtns and keep the countdown normal (so the time changes every second instead of two seconds) function startTimer(duration, display) { var timer = duration, minutes, seconds; setInterval(function () { minutes = parseInt(timer / 60, 10) seconds = parseInt(timer % 60, 10); minutes = minutes &lt; 10 ? "0" + minutes : minutes; seconds = seconds &lt; 10 ? "0" + seconds : seconds; display.textContent = minutes + ":" + seconds; if (--timer &lt; 0.5) { alert("less than ½ minute") } else if (--timer &lt; 0) { alert("completed") } }, 1000); } FIddle
has title: Two if statements inside startTimer()
has answer: http://stackoverflow.com/a/29831905
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29831905
type: Question

http://stackoverflow.com/a/29803461
score: 0
type: Answer
has body: You can parse a Boolean Variable using : var myVar = Boolean("false"); var myVar = !!"false"; Note that any string which isn't the empty string or "false" will evaluate to "true".
answers question: http://stackoverflow.com/q/29803136

http://stackoverflow.com/comment/47664641
type: Comment
has text: @RameshRajendran. You can do that in comments. Anyways removed the downvote. :)
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29765862

http://stackoverflow.com/comment/68542478
type: Comment
has text: Which version are you using to do this? As if moment.js 2.16.0 it does not accept a string format like you've suggested - http://momentjs.com/docs/#/durations/creating/
score: 6
comment on: http://stackoverflow.com/a/29745757
type: AnswerComment

http://stackoverflow.com/comment/47638061
comment on: http://stackoverflow.com/a/29752678
score: 0
type: AnswerComment
type: Comment
has text: Thanks for the attempt but same issue. Have figured out that both r and the parsed variable obj are both ending up as strings

http://stackoverflow.com/comment/47606629
type: Comment
comment on: http://stackoverflow.com/a/29735219
score: 0
type: AnswerComment
has text: Well that might be one too many for now, but yes, everything you say is worth checking :}

http://stackoverflow.com/a/29767714
answers question: http://stackoverflow.com/q/29767476
score: 0
type: Answer
has body: I think you can do it by using ng-class and ng-change. your text field should be Add some code in your controller $scope.customClassName=undefined; $scope.changeBorder=function(){ $scope.customClassName=undefined; if(user.username.length&gt;1){ $scope.customClassName="bdr"; } } If you write any values in your input field, then the function will execute and check the condition, finally update the ng-class to your original class :)

http://stackoverflow.com/q/29720294
tagged with: javascript
tagged with: jquery
answer count: 1
favorite count: 0
tagged with: tabs
has title: Active window detection
has answer: http://stackoverflow.com/a/29721373
accepted answer: http://stackoverflow.com/a/29721373
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47575719
score: 1
has body: I am checking that the current tab/window is focused or not to perform some particular task.The following function is correctly working to detect the focus when i am switching tabs but when the tab is open and i open a software(music player/windows folders) keeping the tab active/open, the function still consider the window/tab as focused!The situation that i am trying to achieve is to detect that the window/tab is lost the focus due to opening application/software upon currently focused window/tab.It will be great if you provide a jsfiddle with your answer based on my code! $(document).ready(function() { var hidden, change, vis = { hidden: "visibilitychange", mozHidden: "mozvisibilitychange", webkitHidden: "webkitvisibilitychange", msHidden: "msvisibilitychange", oHidden: "ovisibilitychange" /* not currently supported */ }; for (hidden in vis) { if (vis.hasOwnProperty(hidden) &amp;&amp; hidden in document) { change = vis[hidden]; break; } } if (change) document.addEventListener(change, onchange); else if (/*@cc_on!@*/false) // IE 9 and lower document.onfocusin = document.onfocusout = onchange else window.onfocus = window.onblur = onchange; function onchange (evt) { evt = evt || window.event; if (evt.type == "focus" || evt.type == "focusin") window_focus = true; else if (evt.type == "blur" || evt.type == "focusout") window_focus = false; else window_focus = this[hidden] ? false : true; } }); Frame: &lt;frameset rows="130,*" style="border: 1px #CC3333" noresize="noresize" "&gt; &lt;frame name="showcountframe" src="https://jsfiddle.net/nvobhaor/1/" scrolling=no marginheight="2" marginwidth="2" noresize="noresize"&gt; &lt;frame name="showcontframe" src="showcontframe.html" marginheight="0" marginwidth="0" noresize="noresize"&gt; &lt;/frameset&gt;&lt;noframes&gt;&lt;/noframes&gt;
linked to: http://stackoverflow.com/q/1060008
type: Question
downvote count: 0

http://stackoverflow.com/q/29828470
type: Question
has body: While running a code inspection, I get many errors in my Node.js code indicating that I am referencing an undefined property prototype on my various classes. I don't understand as prototype should be on all objects. For example: var DeliveryFormatter = require('./_DeliveryFormatter.Abstract'); /** * @extends DeliveryFormatter */ function JSONDeliveryFormatter () { // ... } JSONDeliveryFormatter.prototype = Object.create(DeliveryFormatter.prototype); All the code is running correctly, so I know that DeliveryFormatter is resolving, but I get a wavy underline under the prototype word in Object.create(DeliveryFormatter.prototype). How can I get WebStorm to resolve the prototype object?
tagged with: javascript
tagged with: webstorm
tagged with: prototype
score: 0
has comment: http://stackoverflow.com/comment/52887977
has comment: http://stackoverflow.com/comment/62953959
has comment: http://stackoverflow.com/comment/47963165
has comment: http://stackoverflow.com/comment/50045764
type: UnansweredQuestion
has title: JetBrains WebStorm: "Unresolved variable prototype"
tagged with: node.js
answer count: 0

http://stackoverflow.com/comment/47686230
has text: `.next('form')` does not get the *"next form"*, but the next *element* (and only if it's a form)
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29777773

list
type: Tag
tags question: http://stackoverflow.com/q/29734977
tag name: list
tags question: http://stackoverflow.com/q/29763342
tags question: http://stackoverflow.com/q/29700565

http://stackoverflow.com/a/29715579
has comment: http://stackoverflow.com/comment/47566133
has comment: http://stackoverflow.com/comment/47566148
type: Answer
has body: Just pass the full url to redirectToIndex() from collection_select via proc. Try this in view: &lt;%= collection_select(nil, :id, @domains, -&gt; (d) {attendance_domain_path d}, :complete_name, {selected: -1}, {:onchange=&gt; "redirectToIndex(this.value)", :selected =&gt; params[:domain],class: "form-control"}) %&gt; In JS: function redirectToIndex(val){ window.location = val; }
has comment: http://stackoverflow.com/comment/47566245
upvote count: 1
has comment: http://stackoverflow.com/comment/47566291
has comment: http://stackoverflow.com/comment/47566044
has comment: http://stackoverflow.com/comment/47566109
score: 1
answers question: http://stackoverflow.com/q/29715307
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29715307
downvote count: 0
has comment: http://stackoverflow.com/comment/47566164

http://stackoverflow.com/a/29791131
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29772653
score: 1
has body: Maybe this can help a little more: /* We are using the below urlRouterProvider.otherwise() because of: https://github.com/angular-ui/ui-router/issues/600 */ $urlRouterProvider.otherwise(function($injector, $location) { var $state = $injector.get('$state'); $state.go('login'); }); With this code you can still use the otherwise(), the disadvantage of using when() is that other unknown routes will not match. Above code solved all of our infinite loops.
answers question: http://stackoverflow.com/q/29772653
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/48417767
score: 1
type: QuestionComment
has text: (Actually I didn't cop you were the OP - you could have cast a reopen vote at 250 rep :-)
comment on: http://stackoverflow.com/q/29828098
type: Comment

http://stackoverflow.com/comment/47772964
has text: With a recursive function and a timeout
comment on: http://stackoverflow.com/q/29823428
score: 0
type: QuestionComment
type: Comment

dreamweaver
type: Tag
tag name: dreamweaver
tags question: http://stackoverflow.com/q/29692997
tags question: http://stackoverflow.com/q/29800828

http://stackoverflow.com/comment/47705394
type: QuestionComment
comment on: http://stackoverflow.com/q/29723549
has text: This is the answer you need. http://stackoverflow.com/questions/3338642/updating-address-bar-with-new-url-without-hash-or-reloading-the-page
score: 0
type: Comment

http://stackoverflow.com/a/29756159
has body: You are listening on localhost, so unless the client is running on the same machine, it won't work. Try listening on the IP address that the remote machine has access to, or try listening on all addresses (not sure how it works on js, but on C passing the host address as NULL or empty string(depending on platform) does the trick).
has comment: http://stackoverflow.com/comment/47644873
type: Answer
answers question: http://stackoverflow.com/q/29755296
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/47713182
has text: From the answer: *You can not get the creation date*
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29791991

http://stackoverflow.com/comment/47847116
type: Comment
has text: It didn''t when I add class name to the tag. If I don't add class name, it changes all the path.
score: 0
comment on: http://stackoverflow.com/a/29838887
type: AnswerComment

http://stackoverflow.com/q/29771836
has comment: http://stackoverflow.com/comment/47674267
has comment: http://stackoverflow.com/comment/47674196
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29771974
tagged with: jquery
linked to: http://stackoverflow.com/q/18101099
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47674479
has title: Uncaught TypeError: elem.replace is not a function
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29771974
has comment: http://stackoverflow.com/comment/47674224
score: 1
has comment: http://stackoverflow.com/comment/47674133
has comment: http://stackoverflow.com/comment/47674212
upvote count: 1
type: Question
has body: Here what i'm trying to do : for loop inside the append is not working Here my code : $('body').append( $('&lt;section&gt;').append( $('&lt;form&gt;') .attr('class', "ac-custom ac-checkbox ac-cross") .attr('autocomplete', "off") .append( $('&lt;h2&gt;') .html( "Your to do list to uniquely deploy cross-unit s:" ), function() { options = ["ONE", "TWO", "THREE", "FOUR"]; var $container = $('&lt;ol&gt;&lt;/ol&gt;'); $.each(options, function(val) { $container.append($('&lt;li&gt;').append( $("&lt;input&gt;").attr('id', "cb" + val) .attr('name', "cb" + val) .attr('type', "checkbox"), $("&lt;label&gt;").attr('for', "cb" + val).append( $('&lt;span&gt;').html( "Quickly incentivize impactful actions" ) ) )); }) return $('&lt;ol&gt;').html(); } ) ) ) Error: jquery-2.1.1.js:5089 Uncaught TypeError: elem.replace is not a function What did I do wrong?
tagged with: javascript

http://stackoverflow.com/q/29723872
has comment: http://stackoverflow.com/comment/47581991
has body: I'm trying to spoof the jquery handle as I use grunt / bower in my WP projects to create concatenated minified builds of all my plugins and scripts. I'd like to include jQuery 2.1.3 within this, and dequeue the older version of jquery that ships with wordpress, but in order to make sure other plugins work I thought to (maybe in a bit of a hacky way) use the jquery handle for my script. Unfortunately it seems like localize script wont fire though. What I'm doing is this : wp_deregister_script('jquery'); wp_register_script( 'jquery', get_template_directory_uri().'/public/js/all.min.js', array(), false, true ); wp_enqueue_script( 'jquery' ); $localize_data = array( ....all the stuff I need in my scripts.... ); wp_localize_script( 'jquery', 'nona', $localize_data ); This is obviously wrapped in a function thats called on the appropriate hook, it works with a custom handle, but then there are compatibility issues, any ideas other than just creating an a array and converting it to a javascript object manually? any help would be appreciated.
has answer: http://stackoverflow.com/a/29724589
linked to: http://stackoverflow.com/q/27127030
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 2
upvote count: 2
type: UnansweredQuestion
tagged with: wordpress
has title: wp_localize_script not working with jquery handle

http://stackoverflow.com/q/29690528
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47518890
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47612473
tagged with: windows-store-apps
has comment: http://stackoverflow.com/comment/47892740
has comment: http://stackoverflow.com/comment/47603130
tagged with: windows-phone-8.1
has title: Multiple Javascript alerts not displaying in Windows Store App
has answer: http://stackoverflow.com/a/29723742
type: Question
has body: Multiple alerts are not working in windows store apps. If you put multiple alerts only the last one gets displayed. Is there any workaround for this. Like in the below example only c is displayed. function displayAlerts(){ alert("a"); alert("b"); alert("c"); }
tagged with: winjs
tagged with: javascript
tagged with: windows-runtime

http://stackoverflow.com/q/29779023
has comment: http://stackoverflow.com/comment/47707117
tagged with: jquery
type: Question
has comment: http://stackoverflow.com/comment/47688563
tagged with: http://stackoverflow.com/tag/html
score: 0
tagged with: ruby-on-rails
answer count: 1
has body: I have one js file which has one function and one html file from which i am calling that js function. I have done something and its able to find the path of js file but its not able to find function inside that js file. Any help pelase its very important? index.html.erb <%= javascript_include_tag "graph.js" %> Hello! graph.js function popup() { alert("some text"); }
has answer: http://stackoverflow.com/a/29781047
has comment: http://stackoverflow.com/comment/47690427
tagged with: javascript
type: UnansweredQuestion
has title: How to call javascript function from html tag in rails?

http://stackoverflow.com/q/29723549
tagged with: php
linked to: http://stackoverflow.com/q/3338642
has title: Replace the URL, contents and title without reloading the page
score: 0
has answer: http://stackoverflow.com/a/29723600
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29787869
has body: I want to create one page site by change div content with out load new page. So, I've implemented my code like this: HTML: Post title Script $(function() { $(".js-post-bt").on("click", function(e) { var post_id = $(this).attr("data-id"); $.ajax({ url: "post_title.php?id="+post_id, success: function(data) { var title = data; $.ajax({ url: "post.php?id="+post_id, success: function(data2) { // how to change url to post/post_id? document.title = title; $("#post-container").html(data2); } }); } }); e.preventDefault(); }); }); Is it possible to create only one ajax call and get returned data either title and post data. ANd how to change browser address to post/post_id after anchor link clicked.
has comment: http://stackoverflow.com/comment/47705394
type: Question
answer count: 2

http://stackoverflow.com/comment/47727608
comment on: http://stackoverflow.com/q/29798979
type: Comment
has text: check for input length using `variableName.length` and if it is equal to 0 then write `return false;`
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47561831
type: Comment
comment on: http://stackoverflow.com/a/29712221
type: AnswerComment
score: 0
has text: I'm new user and not enough reputation to vote your answer up. But I appreciate a lot for your teaching Nithin

http://stackoverflow.com/comment/47712442
type: QuestionComment
has text: You have post java code for `OAuth2Logout` instead of `OAuth2Login`
comment on: http://stackoverflow.com/q/29789262
score: 0
type: Comment

http://stackoverflow.com/q/29735715
favorite count: 0
accepted answer: http://stackoverflow.com/a/29745050
has body: I've got a series of apps that are embedded via Javascript in a variety of pages, so it's important to be as careful as possible about constructing selectors in a way that don't accidentally select something on the parent page. (I have no control over the parent markup, and iframes are not an option.) The parent pages all use jQuery in .noConflict() mode, and my app always lives inside a div with the class my_app_class (function($) { var el = $(".my_app_class"); //my code }(window.jQuery)); While I'm pretty good about always remembering to prepend my jQ selectors with "my_app_class", I would be more comfortable if that was implicit in $. Essentially, I would like: $(".headline") To always equal: $(el).find(".headline") The naïve way to do this would be like this: $ = function(selector) { return jQuery(el).find(selector); } But I would like to maintain a super function for situations when I really do need to make a selection on the parent page (which does happen from time to time). I also don't want to overwrite other uses of jQuery like $.ajax. What's the best was to alias a function and maintain the original? I want something like this (new $) = selection inside `.my_app_class` ($$) = (old $) Thanks!
has answer: http://stackoverflow.com/a/29745050
type: AnsweredQuestion
downvote count: 0
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 4
tagged with: conflicting-libraries
linked to: http://stackoverflow.com/q/3690447
has comment: http://stackoverflow.com/comment/47605510
tagged with: jquery-selectors
upvote count: 4
has title: Limit jQuery selectors to children of a certain element

http://stackoverflow.com/comment/47637070
type: Comment
type: QuestionComment
score: 1
has text: "due to..." ––– yeeeesss....?!
comment on: http://stackoverflow.com/q/29752376

http://stackoverflow.com/comment/47665466
type: Comment
type: QuestionComment
has text: You should also declare your variables (jsonObj), and put a console.log() on data to check.
comment on: http://stackoverflow.com/q/29767221
score: 0

http://stackoverflow.com/a/29748430
has body: You should be using the req.query: req.query An object containing a property for each query string parameter in the route. If there is no query string, it is the empty object, {}. api link
upvote count: 1
has comment: http://stackoverflow.com/comment/47629331
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29748343

http://stackoverflow.com/comment/47787126
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29830086
has text: @Trax Pretty sure it doesn't; you have a label with a block. You're not "calling" anything.
type: Comment

http://stackoverflow.com/a/29778469
has comment: http://stackoverflow.com/comment/47742404
answers question: http://stackoverflow.com/q/29777912
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/47695649
has body: Set a variable (validateStar) to false for boolean validation. Add onClick="starClick()" to each of your star buttons inside the span, and create a function for starClick() to set the value of validateStar to true. Once you've done this just create a validation check that checks if validateStar is true or false.

http://stackoverflow.com/q/29820074
tagged with: javascript
has body: How to remove the null value in json string using jquery var jsonstring=[null,null,{"rank":"23","credit":"10"},null,null,{"rank":"26","credit":"10"},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,{"rank":"31","credit":"05"}]
answer count: 3
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47766621
has answer: http://stackoverflow.com/a/29820355
has answer: http://stackoverflow.com/a/29820141
score: 2
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/23774231
linked to: http://stackoverflow.com/q/281264
upvote count: 2
has comment: http://stackoverflow.com/comment/47768385
possible better answer: http://stackoverflow.com/a/29820211
has comment: http://stackoverflow.com/comment/47766591
type: Question
has answer: http://stackoverflow.com/a/29820211
has comment: http://stackoverflow.com/comment/47767672
accepted answer: http://stackoverflow.com/a/29820141
has title: How to remove the null value in json string using jquery

http://stackoverflow.com/q/29786546
has comment: http://stackoverflow.com/comment/47824135
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29786628
type: Question
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47702950
accepted answer: http://stackoverflow.com/a/29786628
has body: I have some html and js code that loads an image from a url and allows you to rotate it. I want to be able to save the image after it has been rotated, preferably with a new url. I would also prefer to use html and js to do it if possible, but I'm open to jquery or w/e else you have in mind since I have no idea how to do this. rotate
has title: How to save image link after rotation with html and js?

http://stackoverflow.com/q/29774030
possible better answer: http://stackoverflow.com/a/29774450
upvote count: 1
has answer: http://stackoverflow.com/a/29774293
has body: Forgive, very very very new to Javascript. Adding in a slideshow for a project at uni, Really basic function to run to get these images to work in a slideshow, But after it completes it exits and doesn't repeat or loop like I would like it too, Also if i wanted to have a fade animation so its not just one image straight into next what would be the best way? Thanks. &lt;-- HTML --&gt; &lt;img id="Slide" src="images/okc4.jpg" width=640 height=400 /&gt; //javascript &lt;script type="text/javascript"&gt; var slideimages = new Array() slideimages[0] = new Image() slideimages[0].src = "image.jpg" slideimages[1] = new Image() slideimages[1].src = "image.jpg" slideimages[2] = new Image() slideimages[2].src = "image.jpg" var step = 0; function slideit(){ document.getElementById("Slide").src = slideimages[step].src if (step&lt;=2) { step++ }else{ step=0 } setInterval("slideit()",2500) } slideit() &lt;/script&gt;
has answer: http://stackoverflow.com/a/29774607
answer count: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/29774851
has answer: http://stackoverflow.com/a/29774575
type: AnsweredQuestion
has title: Looping slideshow and changing animation javascript
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29774293
downvote count: 0
score: 1
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/29774450

http://stackoverflow.com/q/29780489
accepted answer: http://stackoverflow.com/a/29780602
score: 0
has body: I try to run this code and gets "undefined". Does anyone have an idea what is wrong with this code? var casper = require('casper').create(); casper.start('http://casperjs.org/', function() { this.echo(document.querySelector('a')); }); casper.run();
possible better answer: http://stackoverflow.com/a/29780610
has answer: http://stackoverflow.com/a/29780610
tagged with: casperjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29780602
tagged with: screen-scraping
has title: Can't get links with CasperJS
type: Question
answer count: 2
tagged with: javascript

http://stackoverflow.com/q/29712314
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
score: -2
has comment: http://stackoverflow.com/comment/47560121
has comment: http://stackoverflow.com/comment/47561226
downvote count: 3
upvote count: 1
linked to: http://stackoverflow.com/q/4368946
type: Question
has comment: http://stackoverflow.com/comment/47560351
has answer: http://stackoverflow.com/a/29712337
duplicate of: http://stackoverflow.com/q/4368946
tagged with: javascript
has body: I got multiple ajax calls when my page loads, and I want to do something when all of them are finished, but I don't know when they are all finished Is it possible to know, if so, how? Thanks $(document).ready(function () { getStuff(); getStuff2(); getStuff3(); }) function getStuff() { $.ajax({ url: '/Link/To/Stuff', type: 'GET', success: function () { console.log('Success'); } }); } ....more functions like getStuff2(), getStuff3() etc
has title: Wait for multiple ajax calls?
answer count: 1

http://stackoverflow.com/q/29712116
has comment: http://stackoverflow.com/comment/47559778
tagged with: foreach
type: AnsweredQuestion
has body: Let's say myArray is as follows: var myArray = [1,2,3,4]; And I would like my outcome to be as follows when 'map' is applied as follows: map(myArray, function(val){ return val * 2; }); //[2, 4, 6, 8] I have been able to do it with the following codes: var map = function(collection,callback){ var newArray = []; for (var i = 0; i &lt; collection.length; i++){ newArray.push(callback(collection[i])); } return newArray; } However, if I have customised the 'forEach' function earlier(as shown below) and would like to use my customised 'forEach' function in my 'map' function, how can I do it? var forEach = function(collection,callback){ if(Array.isArray(collection)){ for(var i = 0; i &lt; collection.length; i++){ callback(collection[i]); } } else { for(var prop in collection){ callback(collection[prop]); } } }; I have difficulty in getting the value from customised forEach function 'returned' to be used in callback. Thanks in advance!
has comment: http://stackoverflow.com/comment/47560635
score: 1
accepted answer: http://stackoverflow.com/a/29712169
type: Question
tagged with: arrays
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: callback
has title: How to get the value from customised forEach function returned to be used in callback?
has answer: http://stackoverflow.com/a/29712169
favorite count: 0
tagged with: return
upvote count: 1

http://stackoverflow.com/a/29807657
answers question: http://stackoverflow.com/q/29805866
score: 1
upvote count: 1
has body: I've read your code and wrote a sample code in jsfiddle, that does things that you are writing about. In my solution I use CSS selector #tabelaPedido tr:last to select the last added row, and then write values to fields in this row. Hope this helps.
accepted answer of: http://stackoverflow.com/q/29805866
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47744720
type: Answer
has comment: http://stackoverflow.com/comment/47788769

http://stackoverflow.com/q/29702552
type: Question
tagged with: canvas
tagged with: javascript
has body: I serialize my canvas with the following code: var user_canvas = JSON.stringify(canvas.toDatalessObject()); All works fine. I then load the serialized canvas with the following code where 'serial' is the var for the serialized canvas: canvas.loadFromJSON(serial,canvas.renderAll.bind(canvas)); All elements are displayed on the page as expected. From here though I cannot figure out how to reference these objects, canvas.getObjects() comes up as a blank array, however if I console.log(canvas) I can see the elements inside, I just cannot reference them. How can I do this?
score: 0
accepted answer: http://stackoverflow.com/a/29703120
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: serialization
has answer: http://stackoverflow.com/a/29703120
has title: FabricJS - referencing after loading serialized canvas
type: AnsweredQuestion
tagged with: fabricjs

http://stackoverflow.com/q/29812021
has comment: http://stackoverflow.com/comment/47753222
score: 2
possible better answer: http://stackoverflow.com/a/29812373
has comment: http://stackoverflow.com/comment/47752245
has comment: http://stackoverflow.com/comment/47754500
downvote count: 1
has comment: http://stackoverflow.com/comment/47753059
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29813520
has comment: http://stackoverflow.com/comment/47752741
has title: Retrieving an element nested within another element using id
has comment: http://stackoverflow.com/comment/47752167
tagged with: dom
has comment: http://stackoverflow.com/comment/47752553
type: Question
has comment: http://stackoverflow.com/comment/47752485
has answer: http://stackoverflow.com/a/29813520
answer count: 2
has answer: http://stackoverflow.com/a/29812373
has comment: http://stackoverflow.com/comment/47752026
has comment: http://stackoverflow.com/comment/47752225
has comment: http://stackoverflow.com/comment/47752074
has comment: http://stackoverflow.com/comment/47752160
has comment: http://stackoverflow.com/comment/47752232
has comment: http://stackoverflow.com/comment/47752024
tagged with: javascript
linked to: http://stackoverflow.com/q/1353381
linked to: http://stackoverflow.com/q/1643349
has comment: http://stackoverflow.com/comment/47753102
upvote count: 3
has body: I have the following code which simply parses HTML markup to a DOM object. var html_str = ' \ \ This is the first container - Line 1 \ This is the first container - Line 2 \ \ \ \ This is the second container - Line 1 \ This is the second container - Line 2 \ This is the second container - Line 3 \ \ \ \ Test \ \ \ '; var elem_obj = document.createElement("div"); elem_obj.innerHTML = html_str; How do I get the element with id == container-1 from within elem_obj? Vanilla JavaScript only and something other than elem_obj.querySelector('#container-1') because I need to support IE below version 8. Thanks.
favorite count: 0

http://stackoverflow.com/comment/47535771
type: Comment
has text: I don't think you can get all your parameters with a single match
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29699871

http://stackoverflow.com/q/29835730
has title: Replace checkbox with image button
downvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29835919
type: Question
has body: I am looking for a way to allow for the user to select multiple months, days, hours and minutes where this will be used for scheduling tasks. The easiest way I can imagine doing this is using checkboxes for each element since they have a boolean properly I can use to determine if its selected or not. In using this approach, I would like to either entire replace the checkbox with an image (different image for checked/unchecked) or just hide the existing image and style the text area to give the effect of an image using CSS. How can I replace the default checkbox with an image or hide the default checkbox image entirely? Example:
tagged with: http://stackoverflow.com/tag/html
score: 1
favorite count: 0
upvote count: 1
tagged with: checkbox
tagged with: css
has answer: http://stackoverflow.com/a/29835788
has answer: http://stackoverflow.com/a/29835806
answer count: 4
has answer: http://stackoverflow.com/a/29835840

http://stackoverflow.com/a/29751362
has comment: http://stackoverflow.com/comment/47634863
has body: Since you're saying you want the menu to show when you hover the area it uses to be, you should try this. .nav_accordion { opacity: 0; } .nav_accordion:hover { opacity: 1; } Be sure to remove your display: hidden; because hover won't apply on hidden elements. Example: https://jsfiddle.net/qx7c3p72/ ( move your mouse to the upper left corner of the result window )
score: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29744499
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29744499
has comment: http://stackoverflow.com/comment/47635192
type: Answer
upvote count: 1

http://stackoverflow.com/comment/47692701
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29781303
score: 0
has text: possible duplicate of [Storing Objects in HTML5 localStorage](http://stackoverflow.com/questions/2010892/storing-objects-in-html5-localstorage)

http://stackoverflow.com/comment/47695826
score: 0
has text: You can't append `text` to `circle` elements. Use a `g` element to group them like in [this example](http://bl.ocks.org/mbostock/950642).
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29782832

http://stackoverflow.com/q/29842016
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47810703
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47810426
has title: Jquery button click event not working after adding jquery keyboard
has body: I try to get user input from a textbox using jquery keyboard.js. If I omit the virtual keyboard code its work fine. URL : https://github.com/Mottie/Keyboard/wiki Here is my textbox and button: Get current status I have include header file as: JavaScript code for virtual keyboard: $('#txtpnr').keyboard({ layout: 'custom', customLayout: { 'default' : [ '8 9 {a} {c}', '4 5 6 7', '0 1 2 3', '{bksp}' ] }, maxLength : 10, restrictInput : true, useCombos : false, acceptValid: true, validate: function(keyboard, value, isClosing){ return value.length === 10; } }).addTyping(); Code I use for button : $('#btnCheckpnr').on('click',function(){ $('#flag-0').hide(); $('#flag-1').hide(); $('#flag-2').hide(); if($('#txtpnr').val() == '' || $('#txtpnr').val().length < 10){ $(".help-block").show().delay(5000).fadeOut(); $('#txtpnr').focus(); }else{ $('#big-loading').show(); $("*[name^='flag']").hide(); $('#pnr-info').hide(); $.ajax({ 'method':'POST', 'url':'backEnd/jsonProcess.php', 'data':'pnrno='+$('#txtpnr').val()+'&RequestType=checkpnr', success: function(getPnrStatus){ $('#big-loading').hide(); if(getPnrStatus == '0'){ $('#flag-0').show(); } else if(getPnrStatus == '1'){ $('#flag-1').show(); } else if(getPnrStatus == '2'){ $('#flag-2').show(); } else if(getPnrStatus == ''){ $('#flag-2').show(); }else{ $('#pnr-info').show(); var pnrinfo = getPnrStatus.split('#'); $('.pnr').empty().html(pnrinfo[0]); $('.journy').empty().html(pnrinfo[1]); $('.trainname').empty().html(pnrinfo[2]); $('.trainno').empty().html(pnrinfo[3]); $('.class').empty().html(pnrinfo[4]); $('.brdfrom').empty().html(pnrinfo[5]); $('.bkpoint').empty().html(pnrinfo[6]); $('.brdto').empty().html(pnrinfo[7]); $('.chartinfo').empty().html(pnrinfo[8]); $('#passenger-info tbody').empty().html(pnrinfo[9]); } } }); } }); After add value through virtual keyboard the button click event not working. How to I solve this? I have use bootstrap 3 css framework.
has comment: http://stackoverflow.com/comment/47810698
has answer: http://stackoverflow.com/a/29895065
has comment: http://stackoverflow.com/comment/47811852
has comment: http://stackoverflow.com/comment/47813537
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47810287
downvote count: 1
type: Question
score: 3
tagged with: virtual-keyboard
has comment: http://stackoverflow.com/comment/47810890
has comment: http://stackoverflow.com/comment/47814169
has comment: http://stackoverflow.com/comment/47814490
has comment: http://stackoverflow.com/comment/47841940
upvote count: 4
has comment: http://stackoverflow.com/comment/47810362

http://stackoverflow.com/a/31494709
has comment: http://stackoverflow.com/comment/50962502
downvote count: 0
has comment: http://stackoverflow.com/comment/50971491
has comment: http://stackoverflow.com/comment/50961058
has comment: http://stackoverflow.com/comment/112026107
has comment: http://stackoverflow.com/comment/50981810
has comment: http://stackoverflow.com/comment/51469881
type: Answer
has comment: http://stackoverflow.com/comment/111981189
has comment: http://stackoverflow.com/comment/112001505
has comment: http://stackoverflow.com/comment/50980431
score: 4
answers question: http://stackoverflow.com/q/29776757
has comment: http://stackoverflow.com/comment/50978074
has comment: http://stackoverflow.com/comment/112007098
has comment: http://stackoverflow.com/comment/111994455
has comment: http://stackoverflow.com/comment/51471915
upvote count: 4
has body: Your problem is append CSS to iframe head. Use the code below to update your iframe head for CSS. function loadCSS() { var $head = $("#preview").contents().find("head"); $head.html(" "); }; HTML textarea should be updated with CSS. Add loadCSS() to your updatePreview2()(html textarea update function). function updatePreview2() { var previewFrame2 = document.getElementById('preview'); var preview2 = previewFrame2.contentDocument || previewFrame2.contentWindow.document; preview2.open(); preview2.write(editor2.getValue()); preview2.close(); // added this line loadCSS(); } And when your CSS textarea changes, the preview content will be updated by updatePreview()(CSS textarea update function) with CSS content. It should update head only. function updatePreview() { loadCSS(); } Here is the Jsfiddle, please take a demo here. By the way, try to name your variable and function precisely will make more people help you. Update A clean JsFiddle version.

http://stackoverflow.com/q/29693004
has comment: http://stackoverflow.com/comment/47522804
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47522724
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29693299
favorite count: 0
has comment: http://stackoverflow.com/comment/47522642
tagged with: css-position
tagged with: http://stackoverflow.com/tag/html
has body: I have two &lt;div&gt;s with absolute position. One is displayed and the other is display: none on load. When the link on the visible one is clicked it is moved and the other is displayed. I have a third &lt;div&gt; with link that I would like to display directly below these. Since they’re both position: absolute I have not been able to find a way to do this. I have found various solutions, but most of them are workarounds for using absolute position. Since my &lt;div&gt;s need to show ontop of each other I unfortunately can’t remove the absolute positioning. As such I have tried various combinations of position: absolute and position: relative on the three &lt;div&gt;s, but so far nothing has worked. JSFiddle with my problem: https://jsfiddle.net/dagz9tLw/1/ &lt;div&gt; with id linkbar is the one that needs to be at the bottom. The other two &lt;div&gt;s don’t have a set height so margin-top won’t work. linkbar also needs to be just below the &lt;div&gt;s and not right at the bottom of the page.
tagged with: css
has title: Positioning below absolutely positioned divs
type: AnsweredQuestion
upvote count: 7
type: Question
score: 7
has comment: http://stackoverflow.com/comment/47522867
tagged with: javascript
has answer: http://stackoverflow.com/a/29693299

http://stackoverflow.com/comment/47669294
has text: if you can set up a sample `fiddle` on this it can will be easy . cheers
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29766548
score: 1

http://stackoverflow.com/comment/47906153
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29826080
has text: No, it won't make any easier for me since I have to create everything from scratch (I have to deal with the sizing, coloring, shadowing, texting, text positioning), while all I need is just to change the color. The resulting custom markers probably won't look as nice as the default ones either.
type: Comment

http://stackoverflow.com/comment/47780236
type: Comment
comment on: http://stackoverflow.com/a/29826665
score: 0
type: AnswerComment
has text: Unfortunately, one can be forgiven for assuming that anything in javascript/jQuery cannot be made safe from malicious (or just nosey) users. Best keep anything truly sensitive in the code-behind.

http://stackoverflow.com/q/29758569
upvote count: 1
tagged with: http://stackoverflow.com/tag/json
downvote count: 3
type: Question
score: -2
tagged with: javascript
has body: When I type Monday and click Search I want to get all of Monday's JSON data and not just the first row. I've tried modifying the forEach function and also using two ng-repeats in html. So I guess it's the JSON Data structure? Fiddle. "Monday": [{ "Name": "John", "Address": "Street", "Phone": "111", "Status": "Sleep" }, { "Name": "Sam", "Address": "Street2", "Phone": "2", "Status": "Awake" } ], "Tuesday": [{..............................
has title: Display multiple same JSON keys using Angularjs
answer count: 1
tagged with: angularjs-ng-repeat
favorite count: 0
has answer: http://stackoverflow.com/a/29759022
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/47662243
type: QuestionComment
score: 1
has text: What if you pass the entire path?
type: Comment
comment on: http://stackoverflow.com/q/29765430

http://stackoverflow.com/q/29776273
type: UnansweredQuestion
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29784083
has title: Problems with editable-text and beforeUpdate hook (Meteor)
has body: folks. I'm working on my first serious Meteor project, and I'm running into a bit of an issue. I've got a small page here that contains a table of Categories, and I am using editable-text to allow for edit-in-place functionality for a couple of the fields. Editing seems to work, but to handle some verification, I've written/attached a callback to handle the beforeUpdate callback on the limit field for my document. The callback seems to be...well...called back, but it's not having the effect on my data that I believe it should have. Basically, if a user types in a value of something like 43, I want this callback to force the value to 43.00 (two decimal places mandatory). This code segment contains the callback itself: EditableText.registerCallbacks({ // Callback for editing category limit/budget. budgetCurrency: function(doc) { // Variables based on editing. var oldVal = this.oldValue; var newVal = this.newValue; // Verification: if (isNaN(newVal)) { // Reject value if not a number, don't make change. oldVal; } else { newVal = Number(newVal); console.log(newVal.toFixed(2)); return _.extend(doc, {limit: newVal.toFixed(2)}); } } }); I'm not sure if I'm doing something wrong or not. The value that is returned via console.log() is just as I would expect it to be, however the same value (in code) is not what ends up being stored in the updated document. Any assistance would be greatly appreciated. I could just be overlooking something as far as how beforeUpdate works (callback), for all I know. Documentation for the package in question is located at: https://atmospherejs.com/babrahams/editable-text
score: 0
answer count: 1
tagged with: meteor
tagged with: callback

http://stackoverflow.com/comment/47626380
score: 0
comment on: http://stackoverflow.com/q/29746917
type: Comment
type: QuestionComment
has text: have you heard about `switch` statement && try `x = parseInt(x);`

http://stackoverflow.com/comment/47637447
type: AnswerComment
comment on: http://stackoverflow.com/a/29751354
score: 0
has text: ah yeah, ASP, such sh***y errors are Microsoft tailored: "0x8000ffff - JavaScript runtime error: Invalid calling object" :D
type: Comment

http://stackoverflow.com/comment/94198973
score: 0
has text: This does not seem to work for css or image files. I have my assets in `src/assets` and I get a **Module not found** error from react that says I'm attempting to import something that falls outside the src directory. YMMV.
type: Comment
comment on: http://stackoverflow.com/a/41181321
type: AnswerComment

http://stackoverflow.com/a/29710125
answers question: http://stackoverflow.com/q/29709783
score: 0
has body: The best language to use would be javascript and the library JQuery. Use the command .toggleSlide and .hover() I put some code down below as an example. Research more into it to get more advanced. $(document).ready(function(){ $('.home').hover(function(){ $('#home_div').toggleSlide('slow'); }); }); ".home would" be the menu tab that say "Home" "#home_div" would be the red box that appears. to summarize all the code: You are basically saying that when you hover over the html element with the class "home" (in the case the menu item) to have the html element with the id "home_div" to slide down slow. and then slide back once you stop hovering your mouse. Good luck. If you want to know more about jquery just research it.
type: Answer

http://stackoverflow.com/comment/47815104
type: AnswerComment
comment on: http://stackoverflow.com/a/29830848
type: Comment
has text: Do you want to merge additional fields also ? What happens when two objects with the same "name" have different "ssn" or "address"
score: 0

http://stackoverflow.com/a/29835610
answers question: http://stackoverflow.com/q/29835529
upvote count: 1
has comment: http://stackoverflow.com/comment/47798353
has comment: http://stackoverflow.com/comment/47798223
has body: You have double double quotes in the JS file code, should just be: $("div[id*='Name'] input[id*='" + checkBoxID + "']") The '@' is used to escape the double quotes in C#, that's why the in-line code works, you don't need that in JS
has comment: http://stackoverflow.com/comment/47830067
has comment: http://stackoverflow.com/comment/47826276
has comment: http://stackoverflow.com/comment/47798097
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/q/29798444
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29798788
has title: inner like merge in lodash
type: Question
has answer: http://stackoverflow.com/a/29799028
has body: I am trying to do an object merge with lodash in node.js. The merge works great in the fact that it won't overwrite property objects that result in undefined. However I would like the means for it to only overwrite objects that exist in the destination object. See example below: var e1 = { name: 'Jack', surname: 'Root' }; merge with var e2 = { name: 'Rex', surname: undefined, age: 24 }; Current result: { name: 'Rex', surname: 'Root', age: 24 } result I would like: { name: 'Rex', surname: 'Root' } So what I am trying to get is for the source object to only overwrite properties that exist in both, and only if they are not undefined. I tried searching for other functions, but only found merge and assign to do similar things. But alas it is not exactly what I wanted. The whole idea behind this is to build some method that will get objects fields from a web form and then bind them to a mongoose.js model object for persisting. This is to avoid always having to manually bind each property to another object.
upvote count: 5
answer count: 2
score: 5
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/29798788
possible better answer: http://stackoverflow.com/a/29799028
tagged with: merge
tagged with: lodash

http://stackoverflow.com/comment/47579607
comment on: http://stackoverflow.com/a/29722640
type: AnswerComment
score: 0
type: Comment
has text: Ah! Yes! Should've realized that! Thank you!

http://stackoverflow.com/comment/47698503
score: 0
comment on: http://stackoverflow.com/q/29783146
type: Comment
type: QuestionComment
has text: But people with an Apple (me) can't play your game anymore.

http://stackoverflow.com/q/29764691
has answer: http://stackoverflow.com/a/29764866
has answer: http://stackoverflow.com/a/29764766
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29764728
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29764738
type: Question
downvote count: 0
answer count: 7
tagged with: jquery
has answer: http://stackoverflow.com/a/29764787
favorite count: 0
has answer: http://stackoverflow.com/a/29764738
upvote count: 3
possible better answer: http://stackoverflow.com/a/29764728
has answer: http://stackoverflow.com/a/29764724
tagged with: http://stackoverflow.com/tag/html
has body: Help Needed I have some sets of divisions available, where all of the div's are with the same classes. Each div contains a button and some other div's. change t A change t A change t A and the css used .box { width:100px; height:100px; display:block; margin:5px; float:left; } .box-small { width:20px; height:20px; display:block; margin:5px; float:left; } .sb { width:10px; height:10px; display:block; margin:5px; float:left; } .red {background-color:red;} .yellow {background-color:yellow;} .border{border:1px solid #000;} Now, when i click on the button inside the div, the div with 'box-small' class has to be changed. It works with the following jQuery. $('.changecolo').click(function () { var $this = $(this); $this.closest(function(){ $('.box-small').removeClass('yellow'); $('.box-small').addClass('red'); }); }); but the problem is when i click on the button, styles for all the divs are changing. I want to change the current divs class only. You can find the Fiddle for the same here http://jsfiddle.net/om749rbd/6/ Your valuable help will be appreciated. Thanks
tagged with: onclick
has answer: http://stackoverflow.com/a/29764932
has title: On Click Change Multiple Div Classes in Current Div Only

http://stackoverflow.com/comment/47777688
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29825396
type: QuestionComment
has text: Adding parentheses is it. I've never liked how knockout magically decides between whether to display the value of a binding or to invoke it then display the return value. Now I have a concrete reason for my distrust! I always place parenths so there's no confusion. There shouldn't be any significant difference between the two, and you won't be introducing any x-browser issues.

http://stackoverflow.com/q/29805648
has answer: http://stackoverflow.com/a/47926090
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47739224
has title: SlickGrid onSelectedRowsChanged not firing
has answer: http://stackoverflow.com/a/30196759
accepted answer: http://stackoverflow.com/a/29905912
has comment: http://stackoverflow.com/comment/47779712
has comment: http://stackoverflow.com/comment/47739201
has body: I have the following issue with slickgrid: Left click row 1 (onSelectedRowsChanged fires as expected) Hold down the control button Left click row 2 (onSelectedRowsChanged fires as expected) Left click row 1 (onSelectedRowsChanged fires as expected) Let go of the control button Click row 1 (onSelectedRowsChanged does not fire! If you click on the same row 1 cell as before) Issues as described on step 6 above. Here is a link to a jsfiddler showing the issues: http://jsfiddle.net/fortesl/oLj8otsj/1/ Code also attached: var grid; var data = []; var columns = [{ id: "title", name: "Title", field: "title", width: 300, selectable: false, resizable: false }, { id: "priority", name: "Priority", field: "priority", width: 200, selectable: false, resizable: false }]; var options = { editable: true, enableAddRow: true, enableCellNavigation: true, forceFitColumns: true, autoEdit: false }; for (var i = 0; i &lt; 100; i++) { var d = (data[i] = {}); d["title"] = "Task " + (i + 1); d["priority"] = "Medium"; } grid = new Slick.Grid("#myGrid", data, columns, options); grid.setSelectionModel(new Slick.RowSelectionModel()); grid.onSelectedRowsChanged.subscribe(function () { var selectedRows = grid.getSelectedRows(); for (var i = 0; i &lt; selectedRows.length; i++) { selectedRows[i] = selectedRows[i] + 1; } $('.selected-rows')[0].innerHTML = selectedRows; }); grid.onClick.subscribe(function () { $('.selected-rows')[0].innerHTML = ''; }); Please help
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/30196759
tagged with: slickgrid
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29905912
type: Question
has comment: http://stackoverflow.com/comment/47739251
has comment: http://stackoverflow.com/comment/47778005
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29736942
has body: sorry my bad english My problem is How can I declare scope inside of .config when I eter scope inside of config like this app.config(['$scope', function($scope){//...}]); It throws the following error Uncaught Error: [$injector:modulerr] Any ideas?
tagged with: angularjs-scope
type: Question
score: 0
has comment: http://stackoverflow.com/comment/47655022
answer count: 1
has answer: http://stackoverflow.com/a/29737355
tagged with: javascript
has title: How to declare scope element inside of config?
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29737355
type: AnsweredQuestion

http://stackoverflow.com/q/29708998
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47553667
has answer: http://stackoverflow.com/a/29709220
tagged with: angularjs-ng-repeat
has title: Hiding sibling element when clicking element
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47553677
tagged with: javascript
answer count: 1
downvote count: 0
has body: While in an ng-repeat, I'm trying to hide a sibling element when I click an element. Inside my controllerClickMethod I check to see if item.attribute equals the attribute value in data-group. How would I be able to accomplish this? Label
score: 1

http://stackoverflow.com/a/57718411
has comment: http://stackoverflow.com/comment/102775507
score: 12
upvote count: 12
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/106433179
has comment: http://stackoverflow.com/comment/117516413
has comment: http://stackoverflow.com/comment/102772087
answers question: http://stackoverflow.com/q/29738381
has body: Following José and Marius's approach, (with update of Babel's latest version in 2019): Keep the latest JavaScript files in a src directory, and build with npm's prepublish script and output to the lib directory. .npmignore /src .gitignore /lib /node_modules Install Babel (version 7.5.5 in my case) $ npm install @babel/core @babel/cli @babel/preset-env --save-dev package.json { "name": "latest-js-to-npm", "version": "1.0.0", "description": "Keep the latest JavaScript files in a src directory and build with npm's prepublish script and output to the lib directory.", "main": "lib/index.js", "scripts": { "prepublish": "babel src -d lib" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "@babel/cli": "^7.5.5", "@babel/core": "^7.5.5", "@babel/preset-env": "^7.5.5" }, "babel": { "presets": [ "@babel/preset-env" ] } } And I have src/index.js which uses the arrow function: "use strict"; let NewOneWithParameters = (a, b) =&gt; { console.log(a + b); // 30 }; NewOneWithParameters(10, 20); Here is the repo on GitHub. Now you can publish the package: $ npm publish ... &gt; latest-js-to-npm@1.0.0 prepublish . &gt; babel src -d lib Successfully compiled 1 file with Babel. ... Before the package is published to npm, you will see that lib/index.js has been generated, which is transpiled to es5: "use strict"; var NewOneWithParameters = function NewOneWithParameters(a, b) { console.log(a + b); // 30 }; NewOneWithParameters(10, 20); [Update for Rollup bundler] As asked by @kyw, how would you integrate Rollup bundler? First, install rollup and rollup-plugin-babel npm install -D rollup rollup-plugin-babel Second, create rollup.config.js in the project root directory import babel from "rollup-plugin-babel"; export default { input: "./src/index.js", output: { file: "./lib/index.js", format: "cjs", name: "bundle" }, plugins: [ babel({ exclude: "node_modules/**" }) ] }; Lastly, update prepublish in package.json { ... "scripts": { "prepublish": "rollup -c" }, ... } Now yo…

http://stackoverflow.com/comment/47761625
score: 0
type: AnswerComment
has text: @MohammadIqbal a div can only have one `id` attribute
comment on: http://stackoverflow.com/a/29816657
type: Comment

http://stackoverflow.com/q/29844400
score: 0
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47815701
has body: I'm wrtting an API v3 map with multiple markers and multiple infoWindows. I wanted to be able to jump from an InfoWindows to the other with a link. I used the code of Wolfgang Pichler although I want to add a different picture and a description in content of each infowindows. I'v try to add and image in the maker array : var data = [ // Data of points and coords of sprite icons { name:"Germany", lat:"51.179342", lng:"10.50292", top: 64, left: 32, img:"imgs/D1/01-barbes.jpg" }, ]; Then to put it in Create Marker function : function createMarker(point, top, left, name, i, img) { var g = google.maps; var base = "http://sites.google.com/site/mxamples/icons-dot.png"; var image = { url: base, size: new g.Size(32, 32), origin: new g.Point(top, left), anchor: new g.Point(15, 32) }; var photos = img; and fanilly to add it to the content of my infowindows : var html ="&lt;div class='infowindow'&gt;" + "&lt;h3 class='firstHeading'&gt;"+ name + "&lt;\/i&gt;&lt;span&gt;&lt;\/span&gt;&lt;\/h3&gt;"+ "&lt;div class='bodyWin'&gt;"+ photos + "&lt;p&gt;My friend Addi is sitting on his chair waiting for customers." + "&lt;\/p&gt;"+ "&lt;a href='javascript:void(0)' onclick='infoopen(event, " + i + ")'&gt;Next step&lt;\/a&gt;" + "&lt;\/div&gt;"+ "&lt;\/div&gt;"; But it return "undefined" He is my example on a jsfiddle : https://jsfiddle.net/coraMashed/kohceobm/1/ Is anyone can help. I've been through all the API doccumentation and on stackoverflow question, but I've find anything taht use the same code. Thank you very much
has answer: http://stackoverflow.com/a/29940990
tagged with: google-maps
answer count: 1
favorite count: 0
has title: Adding content in google API map multiple infowindows (marker in an array)
accepted answer: http://stackoverflow.com/a/29940990
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47823230

http://stackoverflow.com/a/29754497
score: 0
type: Answer
has body: I think $.click is failing you. Try this $(document).ready(function(){ $("#chk").change(function(){ if(!$(this).is(':checked')){ $("#emailtext input").removeAttr("disabled"); } else{ $("#emailtext input").val(""); $("#emailtext input").attr("disabled", "disabled"); } }); }); https://jsfiddle.net/0hwsLs4y/ Edit, this above was correct, the ids are on the containers, not the inputs
answers question: http://stackoverflow.com/q/29754362

http://stackoverflow.com/q/29813983
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47766961
has answer: http://stackoverflow.com/a/56947976
answer count: 2
tagged with: google-maps
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/30016713
has comment: http://stackoverflow.com/comment/48150421
favorite count: 0
possible better answer: http://stackoverflow.com/a/56947976
has title: Draw kml layer on google map from a text area
tagged with: google-maps-api-3
has body: I'd like to draw a kml layer on a google map with the javascript api having the kml code copied in a textarea, like what they do in this page: http://display-kml.appspot.com/ All the examples that I found in the documentation load the kml layer from a file;
upvote count: 1
has answer: http://stackoverflow.com/a/30016713
type: Question

http://stackoverflow.com/comment/47808405
type: AnswerComment
type: Comment
has text: You answer is incorrect, I edited out that code as it is extraneous
comment on: http://stackoverflow.com/a/29841076
score: 0

http://stackoverflow.com/comment/47651462
type: Comment
has text: Yes, absolutely. Just place the image inside of the A tags (replacing the text).
comment on: http://stackoverflow.com/a/29759390
type: AnswerComment
score: 0

http://stackoverflow.com/q/29692316
favorite count: 0
has answer: http://stackoverflow.com/a/29692416
has title: Jquery second drop down depending on the first drop down does not change
score: 0
possible better answer: http://stackoverflow.com/a/29694831
upvote count: 1
has answer: http://stackoverflow.com/a/29694831
downvote count: 1
has comment: http://stackoverflow.com/comment/47521223
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29692416
type: Question
answer count: 2
has body: Hi I have the problem of filtering the second drop down that depends on the first drop down,It is like the second drop down options they are static they does not do change based on what i have chosen here is my code to get secon drop down data. $.ajax({ dataType: "json", url: "{{action('CampaignController@getAdvertiser')}}/"+$("#advertiserId").val() }).done(function(results){ $("#brandId").empty(); $(results).each(function(index,value){ newOption = $("&lt;option value=\""+value.id+"\"&gt;"+value.brandName+"&lt;/option&gt;"); $("#brandId").append(newOption); }); please check my entire script maybe somewhere is refreshing that drop down $(document).ready(function () { $(function () { $("#multiselect").multiselect({ includeSelectAllOption: true }); $('#btnSelected').click(function () { var selected = $("#multiselect option:selected"); var message = ""; selected.each(function () { message += $(this).text() + " " + "\n"; }); alert(message); }); }); function loadBrands() { $.ajax({ dataType: "json", url: "{{action('CampaignController@getAdvertiser')}}/" + $("#advertiserId").val() }).done(function (results) { $("#brandId").empty(); $.each(results, function (index, value) { var newOption = $("&lt;option value=\"" + value.id + "\"&gt;" + value.brandName + "&lt;/option&gt;"); $("#brandId").append(newOption); // $("#brandId").trigger("chosen:updated"); }); //$("#brandId").empty(); // hardcode 1 it must be remove asap $.ajax({ dataType: "json", url: "{{action('ReportingController@getCamp')}}/" + 1 }).done(function (results) { $("#campaignId").empty(); console.debug(get); $(results).each(function (index, value) { $("#campaignId").append("&lt;option value=\"" + value.campaignId + "\"&gt;" + value.campaignName + "&lt;/option&gt;"); $('#campaignId').trigger('change'); }); }); //loading city $.ajax({ dataType: "json", url: "{{action('CampaignLocationController@getLocations')}}/" + 1 }).done(function (results) { $("#city").empty(); $(results).each(function (index, value) { getCityDet…
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/47665143
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29765152
has text: i edit the question and test it. my goal is i want to use basket function within my loop. i want to get the same effect when i'm using : basket.require({ url: first_script.js}).then(function(){ basket.require({ url: second_script.js } )}); but i want to loop another then function as long as my loop. sorry for bad explanation. hope it explains. :(
score: 0

http://stackoverflow.com/q/29794689
score: 0
has answer: http://stackoverflow.com/a/29795461
tagged with: http://stackoverflow.com/tag/pdf
answer count: 1
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/png
linked to: http://stackoverflow.com/q/28226677
type: Question
has body: I’ve got a flowery pattern (http://pages.bangor.ac.uk/~abp4d9/) where user moves sliders (for inner circles and petals) and flowers change. I’ve got 3 ‘Save as’ buttons. 1st one (SVG) works great. The other 2 work only half-way. The saved file comes up in the appropriate format but then it doesn’t open, saying that there was an error. All 3 JS functions are almost identical – I basically copied them from the working 1st function. I’m not sure what to correct – probably ‘new Blob’ format, but I’m not sure what to put instead. So, to sum up: • How to get a working ‘Save as SVG’ button to do the same with PDF and PNG? Here is my JS for half-working PDF button: function downloadPdf(){ var svg = document.getElementsByTagName("svg")[0]; var svg_xml = (new XMLSerializer).serializeToString(svg); var blob = new Blob([svg_xml]); var url = window.URL || window.webkitURL; var blobURL = url.createObjectURL(blob); var a = document.createElement('a'); a.download = "Pattern.pdf"; a.href = blobURL; document.body.appendChild(a); a.click(); }
tagged with: javascript
linked to: http://stackoverflow.com/q/23681325
has title: Saving SVG pattern as PDF and PNG

http://stackoverflow.com/comment/47767555
score: 1
comment on: http://stackoverflow.com/q/29819188
type: Comment
type: QuestionComment
has text: and with and effect called translate3d you can move it with the gpu.

http://stackoverflow.com/a/29920420
downvote count: 0
score: 11
upvote count: 11
has body: I was sent this answer from the Apple Support Communities. All I had to do was to add '-nocookie' after youtube in the src of the iframe HTML5 Video Standalone Test It worked for me in my test app.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29794859
type: Answer
accepted answer of: http://stackoverflow.com/q/29794859
has comment: http://stackoverflow.com/comment/64049676

http://stackoverflow.com/q/29814201
has comment: http://stackoverflow.com/comment/47755939
has title: Javascript is not working when ng-repeat is used
score: 0
answer count: 1
has body: I am new to AngularJs and working on a website. I am retrieving the data from Rest services in a page,I am able to display the data using ng-repeat. But the problem is I have a normal javascript functioning element in the page. It is not working when i include the angularjs(ng-repeat). Suggest me to work on it.
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47756283
has comment: http://stackoverflow.com/comment/47756058
has comment: http://stackoverflow.com/comment/47755906
has comment: http://stackoverflow.com/comment/47755914
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/29814539

http://stackoverflow.com/a/29830014
answers question: http://stackoverflow.com/q/29829382
score: 0
has comment: http://stackoverflow.com/comment/47815181
has comment: http://stackoverflow.com/comment/47822564
type: Answer
has body: When you use 0xff0000 it is a representation of an integer (i.e. 16711680) which is different than when you use "0xff0000" which is a string. So depends what you want to do.

http://stackoverflow.com/comment/47682670
has text: thnx @tsuensiu but i still cannot scroll down.
comment on: http://stackoverflow.com/q/29773273
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47558151
score: 0
type: Comment
has text: @FelixKling I think mine is simpler :D
comment on: http://stackoverflow.com/a/29711233
type: AnswerComment

http://stackoverflow.com/comment/47540591
type: Comment
type: QuestionComment
has text: Just an `app.js` file. I'm using browserify to bundle that script file.
comment on: http://stackoverflow.com/q/29702255
score: 0

http://stackoverflow.com/comment/47685473
type: Comment
has text: `retrieveCurrentPositions()` is the only one missing because it goes for a REST call to my server. What else is missing?
comment on: http://stackoverflow.com/a/29776829
score: 0
type: AnswerComment

http://stackoverflow.com/q/29769342
has answer: http://stackoverflow.com/a/29791101
has body: In My Codeigniter web application I'm using an ajax function to get some data from the database inorder to show it in the view.The data from database contains an image url and other fields. My problem is that when I get the data in ajax success function, the image url looks like this: Since the url contains these characters \ my view is not rendering properly. I tried using stripslash function to remove this. But didn't work. I didn't know where am going wrong. my ajax function $.ajax({ type: "get", url: "index.php?module=pos&view=ajaxproducts1", data: {category_id: cat_id, per_page: p_page}, dataType: "html", success: function(data) { var x= data; alert(x); if(data!=1) { $('#proajax').empty(); var newPrs = $(' '); newPrs.html(data); newPrs.appendTo("#proajax"); //$('#gmail_loading').hide(); } else { bootbox.alert('Product is Not Available in this Category!'); $('#gmail_loading').hide(); } } }); Controller function ajaxproducts1() { $mn;$data1; $img="assets/uploads/thumbs/default.png"; //this is my image path, when this comes in ajax success,\ character adds $img=str_replace('\"', '', $img); if($this->input->get('category_id')) { $category_id = $this->input->get('category_id'); } if($this->input->get('per_page')) { $per_page = $this->input->get('per_page'); } if($item = $this->pos_model->getProductsByCategory($category_id,$per_page)) { foreach ($item as $i) { $button=" id."' type='button' value=".$i->id." class='blue' > ".$i->name; $mn=$mn.$button; } $data1=$mn; } else { $data1=1; } echo json_encode($data1); } Can anyone help me with this ?
has answer: http://stackoverflow.com/a/29769661
tagged with: codeigniter
downvote count: 1
accepted answer: http://stackoverflow.com/a/29791101
type: Question
has comment: http://stackoverflow.com/comment/47669607
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 2
upvote count: 0
has title: Unexpected characters in image url in ajax response Javascript
favorite count: 0
score: -1
has comment: http://stackoverflow.com/comment/47669654
tagged with: php
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29769661

http://stackoverflow.com/comment/47523522
score: 0
has text: 5 is the second array item and 3 is used when 20 % 6 = 2;
type: AnswerComment
comment on: http://stackoverflow.com/a/29692937
type: Comment

http://stackoverflow.com/a/29728136
score: 1
type: Answer
answers question: http://stackoverflow.com/q/29715073
upvote count: 1
has body: As per comments CSS .overlay { background:black; border-radius: 50em; min-height: 10em; height: 18em; width: 18em; min-width: 10em; margin: 3rem; position:relative; } HTML &lt;div class="overlay"&gt;&lt;img src="http://media.treehugger.com/assets/images/2011/10/ice-energy-store.jpg"/&gt;&lt;/div&gt; CODE $(document).on("mouseover", "img", function() { $(".overlay").css({"z-index": "999"}); $("img").css("opacity",".5"); }); Demo http://jsfiddle.net/79zty3h7/
downvote count: 0

http://stackoverflow.com/q/29719519
type: Question
has comment: http://stackoverflow.com/comment/47573610
linked to: http://stackoverflow.com/q/1470488
upvote count: 1
has body: It seems to me that anytime a variable is declared, it should use the var keyword (unless it's specifically trying to access a global variable). Particularly because local variables can be collected when their function exits. But does it make any difference in something like a for loop? for(var i = 0; i &lt; ...; i++) Generally, is there any standard best practice about the use of var keyword?
has answer: http://stackoverflow.com/a/29719569
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/29719576
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/29719569
duplicate of: http://stackoverflow.com/q/1470488
has comment: http://stackoverflow.com/comment/47573603
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29719562
accepted answer: http://stackoverflow.com/a/29719562
tagged with: javascript
has title: Javascript, is using the var keyword a best practice?

http://stackoverflow.com/a/29777659
type: Answer
downvote count: 0
has body: Yes, as with the other answers: drawImage(image, srcX, srcY, srcW, srcH, dstX, dstY, dstW, dstH); So in this case you would have to reverse the order of destination and source as well as calculating the width and height: boolean Graphics.drawImage(Image img, int dstx1, int dsty1, int dstx2, int dsty2, int srcx1, int srcy1, int srcx2, int srcy2, ImageObserver observer); Will become: ctx.drawImage(img, srcx1, srcy1, srcx2 - srcx1, srcy2 - srcy1, dstx1, dsty1, dstx2 - dstx1, dsty2 - dsty1); or as a wrapper function, parameter-compatible with the Java version: function drawImage(img, dstx1, dsty1, dstx2, dsty2, srcx1, srcy1, srcx2, srcy2) { ctx.drawImage(img, srcx1, srcy1, srcx2-srcx1, srcy2-srcy1, dstx1, dsty1, dstx2-dstx1, dsty2-dsty1); } Width and height of 0 is invalid, source must be inside the source image boundaries.
score: 1
answers question: http://stackoverflow.com/q/29769906
accepted answer of: http://stackoverflow.com/q/29769906
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/29827459
has body: I'm pretty new to ajax.Following is my use case : I am developing a side project that will show news and scores of different sports. For performing same, I am using rss feeds from different sources. I am able to fetch and parse the rss feeds in django views using 'feedparser' plugin, and passing the same as context to the corresponding template. Following is my view function and template(for cricket). def cricket(request): feeds_cric = feedparser.parse('http://www.espncricinfo.com/rss/content/story/feeds/0.xml') #espncricinfo feed. feeds_cric_scores = feedparser.parse('http://static.cricinfo.com/rss/livescores.xml') #espncricinfo feed. context = {'feeds_cric': feeds_cric,'feeds_cric_scores' : feeds_cric_scores} return render(request,'scorecenter/cricket.html', context) Following is the corresponding template. {% extends "scorecenter/index.html" %} {% block content %} {% for entry in feeds_cric.entries %} {{ entry.title }} {{ entry.description }} {% endfor %} {% endblock content %} {% block score %} {% for entry in feeds_cric_scores.entries %} {{ entry.title }} {% endfor %} {% endblock score %} Following is index.html file. Now, I want to use AJAX to reload only certain blocks of my page, rather than reloading and redirecting the complete page. I have written a script to check the Allscores Cricket Football Basketball Tennis This should be updated Latest News {% block content %} {% endblock content %} Latest scores {% block score %} {% endblock score %} Copyright © acllscores.com In my urlChecker() script, I check which anchor tag is clicked and assign the corresponding url. Following is the script : function urlChecker (route) { switch(route) { case 'cricket': $.post( "/scorecenter/cricket/", function( data ) { $( ".result" ).html( data ); }); break; case 'football': $.post( "/scorecenter/football/", function( data ) { $( ".testingData" ).html( data ); }); break; case 'tennis': $.post( "/scorecenter/tennis/", function( data ) { $( ".testingData" ).html( data ); }); …
answer count: 1
has title: Passing RSS feeds to django view using AJAX
tagged with: ajax
type: UnansweredQuestion
tagged with: django
has answer: http://stackoverflow.com/a/29829056
tagged with: rss
has comment: http://stackoverflow.com/comment/47783904
type: Question
has comment: http://stackoverflow.com/comment/47781901
tagged with: javascript
has comment: http://stackoverflow.com/comment/47784675
score: 0

http://stackoverflow.com/comment/47702325
has text: still nothing and if somebody can explain me what the real diffrent between name and id? but if it a big topic just skip it .
type: QuestionComment
comment on: http://stackoverflow.com/q/29786025
type: Comment
score: 0

http://stackoverflow.com/q/29715714
type: Question
score: 0
tagged with: google-pagespeed
has comment: http://stackoverflow.com/comment/47567112
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has title: fullpage.js and content above the fold
tagged with: fullpage.js
has body: I'm using fullpage.js and everytime I try to move the scripts at the bottom of the page I have never the 100/100 Google PageSpeed Insights. Is there any way to defer or async the codes in order to unblock the contents above the fold? The jqu.js is the jQuery
answer count: 0
has comment: http://stackoverflow.com/comment/47567714

http://stackoverflow.com/comment/47521492
type: QuestionComment
comment on: http://stackoverflow.com/q/29692286
score: 0
has text: Also, please provide your data model for reference.
type: Comment

http://stackoverflow.com/comment/47524628
type: AnswerComment
comment on: http://stackoverflow.com/a/29692416
type: Comment
has text: Yes, it would be great if you could do that
score: 0

http://stackoverflow.com/comment/47543217
type: Comment
comment on: http://stackoverflow.com/a/29700206
score: 0
has text: `.val(token)` do not change the value-attribute of the tag. So replacing it with `.attr("value", token);` should solve your first Problem.
type: AnswerComment

http://stackoverflow.com/comment/47650850
type: Comment
type: QuestionComment
has text: @Pointy - Have made a change to the Literal as above and have set the mode to strict in my html file. Are the edits what you are getting at with your comments??
comment on: http://stackoverflow.com/q/29758843
score: 0

http://stackoverflow.com/a/29833827
has comment: http://stackoverflow.com/comment/57097042
has comment: http://stackoverflow.com/comment/47799348
downvote count: 2
has comment: http://stackoverflow.com/comment/76683535
has comment: http://stackoverflow.com/comment/57097816
answers question: http://stackoverflow.com/q/29833676
has comment: http://stackoverflow.com/comment/47794698
type: Answer
has body: The code you provided with the jsonfile library looks like a good start: you parse the json into an object, call .push(), and save something. With raw Node calls (assuming the json file is a representation of an array): var fs = require('fs'); function appendObject(obj){ var configFile = fs.readFileSync('./config.json'); var config = JSON.parse(configFile); config.push(obj); var configJSON = JSON.stringify(config); fs.writeFileSync('./config.json', configJSON); } appendObject({OnetimeCode : WEAS_Server_NewOneTimeCode});
score: 11
upvote count: 13

http://stackoverflow.com/a/29701031
has body: You're not far from the solution. Seriously, I used to try to remember the difference between service and factory. In the end, both can be used exactly in the same way, to fulfill the same requirement. app.factory('dmFactory', function() { //name.value should equal to system.value from the controller var somethingIWantToRemember = {}; return { set: set, get: get } function get(key){ //You can forget about the key if you want return somethingIWantToRemember[key]; } function set(key, value){ somethingIWantToRemember[key] = value; } }); and in your controller, you just have to call both functions that way : $scope.something = dmFactory.get(key); or dmFactory.set(key, $scope.something);
has comment: http://stackoverflow.com/comment/47566685
answers question: http://stackoverflow.com/q/29700783
type: Answer
score: 3
upvote count: 3
downvote count: 0

http://stackoverflow.com/comment/47827956
comment on: http://stackoverflow.com/a/29831613
score: 0
type: AnswerComment
has text: `appendChild()` expects a node. You could instead do something like `someElement.innerHTML = e.data`.
type: Comment

http://stackoverflow.com/a/29807936
has body: I have been able to solve this problem. I used &lt;map&gt; and &lt;area&gt; to define each of the areas (pizza slices) I need. Then I added the onclick() and onmouseover() event handler to each area to call a function to change the picture. HTML &lt;area shape="circle" coords="200,250,25" onmouseover = "changePic('newImage.png')" /&gt; &lt;img src='start_pic.png' name='mainPic' /&gt; JavaScript function changePic(img){ mainPic.src = img; } PREVIEW LINK
answers question: http://stackoverflow.com/q/29803836
has comment: http://stackoverflow.com/comment/47744018
score: 0
type: Answer

preloadjs
tags question: http://stackoverflow.com/q/29832706
type: Tag
tag name: preloadjs

http://stackoverflow.com/comment/47596550
score: 0
has text: Hi @EliezerSteinbock, it works to be honest. I thought I was doing something wrong. I've replaced value _id with value name.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29730045

http://stackoverflow.com/q/29799444
has answer: http://stackoverflow.com/a/29858513
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29858513
type: Question
has title: Google+ vs Google Identity Platform API
tagged with: google-identity
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
upvote count: 8
has body: tl;dr: can someone explain what exactly is the difference in implementing client-side Google login flow between these two platforms? The backstory: I've been trying to implement client-side Google sign in to my website. First, I implemented the Google+ platform with global settings using tags, so user session is monitored. Got the info here: https://developers.google.com/+/web/signin/ However, I encountered a problem where the site would automatically check for user login state if the user is not logged in, which resulted in many 'toastr' messages of 'Logged out', which I implemented in the signInCallback function. It was pretty annoyting. So I did some research and stumbled across their 'quick start app' and browsed through it. It is WAY more complicated than their guide, many elements were documented on Google Identity Platform, here: https://developers.google.com/identity/sign-in/web/reference Now I don't really understand what is the correct way of implementing their login - is it the lightweight Google+ button with tag callback check for user state, or is it the robust GIP way with listeners, gapi instances and all? What exactly different do these platforms offer?
tagged with: google-plus
tagged with: web
tagged with: client
score: 8

http://stackoverflow.com/q/29751878
has body: I'm looking for a way to display the img title &amp; alt tags in a div (.image-caption). This is my code so far: owl.on('changed.owl.carousel', function(event) { var comment = $(this).find('img').attr('alt'); var title = $(this).find('img').attr('title'); if(comment) $('#desktop .image-caption').html('&lt;h4&gt;'+title+'&lt;/h4&gt;&lt;p&gt;'+comment+'&lt;/p&gt;'); }) Any ideas? Thanks!
tagged with: carousel
has comment: http://stackoverflow.com/comment/47645666
tagged with: owl-carousel-2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29765718
upvote count: 3
tagged with: owl-carousel
type: Question
accepted answer: http://stackoverflow.com/a/29765718
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29758900
has answer: http://stackoverflow.com/a/29758900
has comment: http://stackoverflow.com/comment/47645698
answer count: 2
linked to: http://stackoverflow.com/q/29769409
score: 3
has comment: http://stackoverflow.com/comment/47647359
downvote count: 0
has comment: http://stackoverflow.com/comment/47642380
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47649552
has title: Owl Carousel 2 - caption div (img title & alt tags)

http://stackoverflow.com/comment/47740444
type: QuestionComment
comment on: http://stackoverflow.com/q/29806040
score: 0
has text: @Steve It's all there as I want, but check out my edit for more information.
type: Comment

http://stackoverflow.com/q/29840549
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47821903
answer count: 0
type: Question
tagged with: google-analytics
has comment: http://stackoverflow.com/comment/47870835
linked to: http://stackoverflow.com/q/29717151
tagged with: javascript
has body: I am looking at my Google Analytics user flow. Normally this just shows which pages people have visited on my site In the 'Other Pages' section I can see that some visitors are visiting a website page that is not mine - its clearly some form of dodgy website. - ie they seem to be getting to that website through some link on my website? How can I stop this or solve the problem? Where is the problem? Thanks
score: 0
has title: Google Analytics User Flow

http://stackoverflow.com/q/29704189
has body: I'm working on a Restful API with node.js and mongoose. I need to return an object with the results of a search. Here is my code: var Get = function (criteria) { var result; Users.findOne(criteria, function(err, res){ console.log('Error: ' + err); console.log('Results: ' + res); result = err || !res ? err || errors['404']: res; console.log(result); }); console.log('Final results: ' + JSON.stringify(result)); return result; }; Since I was having problems, I added those console.logs to watch where the result is lost. Here are the logs: Final results: undefined Error: null Results: { //user... } I need that result to be returned. How can I solve this?
type: Question
has answer: http://stackoverflow.com/a/29704306
accepted answer: http://stackoverflow.com/a/29704306
tagged with: mongoose
tagged with: javascript
upvote count: 2
answer count: 1
has title: Return the result of a mongoose model function
linked to: http://stackoverflow.com/q/14220321
favorite count: 0
has comment: http://stackoverflow.com/comment/47544511
tagged with: node.js
score: 2
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/47544776

http://stackoverflow.com/q/29749899
has title: Resource + Socket.io factory in Angular.JS
tagged with: javascript
has comment: http://stackoverflow.com/comment/56692225
favorite count: 0
upvote count: 5
tagged with: angularjs
type: UnansweredQuestion
tagged with: sockets
tagged with: angular-resource
tagged with: node.js
has comment: http://stackoverflow.com/comment/50383063
answer count: 0
downvote count: 0
has body: I'm writing a web application using Angular.JS, which uses a backend system written in Express and Socket.IO (a Node module). I've written a factory in Angular.JS for listing Elements: angular.module('myApp.api', ['ngResource']) .factory('Element', function($resource, Socket) { return $resource( 'http://localhost:4000/elements/:id', { id : '@id' }, { update: { method: 'PATCH' } } ); }); This factory is used in ElementCtrl and shows the elements accordingly, which works perfectly: angular.module('myApp.element', []) .controller('ElementCtrl', ['$scope', 'Element', function($scope, Element) { var elements = Element.query(); }]); However, I've also implemented Socket.io in the backend, which sends a message if an element is added to the elements list. I want to alter the Element factory or find some other way to handle this transparently for the controller. My client Socket.io code is as follows: angular.module('myApp.socket', []) .factory('ElementRealtime', function($resource, Socket) { var socket = io.connect('http://localhost:4000'); return { on: function (eventName, callback) { socket.on(eventName, function () { var args = arguments; $rootScope.$apply(function () { callback.apply(socket, args); }); }); }, emit: function (eventName, data, callback) { socket.emit(eventName, data, function () { var args = arguments; $rootScope.$apply(function () { if (callback) { callback.apply(socket, args); } }); }) }, send: function(eventName, data, callback) { socket.send(eventName, data, function() { var args = arguments; $rootScope.$apply(function() { if (callback) { callback.apply(socket, args); } }); }); } }; }); In the controller, I can update the code like so: Socket.on('connect', function (data) { Socket.emit('subscribe', { channel: 'element' }); }); Socket.on('message', function (data) { elements = Element.query(); }); Is there anyway to build just one factory/service that handles the $resource and socket part, so I just can write: var elements = Element.someFunction(); in…
type: Question
score: 5

http://stackoverflow.com/comment/47689129
score: 0
comment on: http://stackoverflow.com/a/29774932
has text: Have you checked to be sure that your Javascript file is loading and firing while you are in the admin?
type: Comment
type: AnswerComment

http://stackoverflow.com/q/29785694
tagged with: node.js
has title: Why are console.log calls showing up in a different order than they are written?
upvote count: 3
downvote count: 2
has comment: http://stackoverflow.com/comment/47701281
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47702280
score: 1
has answer: http://stackoverflow.com/a/29785923
answer count: 1
has comment: http://stackoverflow.com/comment/47701225
tagged with: javascript
favorite count: 0
has body: I'm new to Node.js and I think I don't understand how it's supposed to work. I'm using steam-tradeoffers, and in my mind, this should first go through one trade offer, then for each item I am going to receive, it loads their inventory and compares it to their inventory until it finds the matching item and prints it. However, it loads all the offers first, then loads all their inventories. steam.on('webSessionID', function (sessionID) { steam.webLogOn(function (newCookie) { offers.setup({ sessionID: sessionID, webCookie: newCookie }, function (err) { if (err) { throw err; } offers.getOffers({ get_received_offers: 1, active_only: 1, }, function (error, body) { if (body.response.trade_offers_received) { body.response.trade_offers_received.forEach(function (offer) { console.log('TRADE OFFER') offer.items_to_receive.forEach(function (offerItem) { offers.loadPartnerInventory({ contextId: 2, partnerSteamId: offer.steamid_other, tradeOfferId: offer.tradeofferid, appId: 730 }, function (err, items) { var item; // Load tradable items in inventory for (var i = 0; i &lt; items.length; i++) { if (items[i].tradable) { item = items[i]; //if item matches item from their inventory we can get the market name if (item.id == offerItem.assetid){ console.log(item.market_name) } } } }); }); }); } }); }); }); }); Output: TRADE OFFER TRADE OFFER TRADE OFFER Sticker Capsule 2 Sticker Capsule 2 Sticker Capsule 2 What I expect: TRADE OFFER Sticker Capsule 2 TRADE OFFER Sticker Capsule 2 TRADE OFFER Sticker Capsule 2 Could someone explain to me what is happening? e: Example of this being annoying for (var i = 0; i &lt; items.length; i++) { if (items[i].tradable) { item = items[i]; //if item matches item from their inventory we can get the market name if (item.id == offerItem.assetid){ // Configure the request console.log(item.market_name) var options = { url: 'http://steamcommunity.com/market/priceoverview/?country=US&amp;currency=1&amp;appid=730&amp;market_hash_name=' + item.market_name, metho…
accepted answer: http://stackoverflow.com/a/29785923
has comment: http://stackoverflow.com/comment/47701193

http://stackoverflow.com/comment/47603931
type: AnswerComment
type: Comment
has text: the real problem is how to return from the www.mydomain.com/file.php to file:///mypath.file.html @Snake
comment on: http://stackoverflow.com/a/29735100
score: 0

http://stackoverflow.com/q/29797589
type: Question
has body: Is it possible to access and modify the JSX used to create a React class and re-transpile it on the fly. For example, if you had the following: var Item = React.createClass({ render: function () { return Hello } } How could we: access the raw JSX, modify it to return something else, then transpile so the changes could be seen? YES I understand this could be extremely dangerous.
has comment: http://stackoverflow.com/comment/47726795
upvote count: 2
tagged with: reactjs
has comment: http://stackoverflow.com/comment/47748359
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47724520
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29798917
has comment: http://stackoverflow.com/comment/47728157
score: 2
downvote count: 0
has title: Re-transpile JSX on the fly in a reactjs app

http://stackoverflow.com/comment/47869018
comment on: http://stackoverflow.com/a/29842080
type: Comment
has text: Note that this is a bug in Firefox's implementation, and therefore likely to get fixed.
type: AnswerComment
score: 0

http://stackoverflow.com/q/29736499
type: Question
has answer: http://stackoverflow.com/a/29740244
tagged with: reactjs
has answer: http://stackoverflow.com/a/29740257
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29740257
upvote count: 2
answer count: 2
has body: Situation: I have a several input components but depending on the route (react-router) different ones are shown. Problem: I want the input values the user already entered to be preserved when switching back and forth between routes and dropping/re-adding input components. I came up with two solutions so far: 1) Always render everything but hide via CSS if not to be shown (breaks the idea of React for me somehow) 2) Implement some kind of "input value store" in the flux architecture (pretty elabortate) Any other ideas? Am I missing something more fundamental?
downvote count: 0
favorite count: 0
has title: Preserve Input Values when switching between views in React
possible better answer: http://stackoverflow.com/a/29740244
type: AnsweredQuestion
score: 2
tagged with: react-router
tagged with: forms

http://stackoverflow.com/q/29798300
has answer: http://stackoverflow.com/a/29798711
type: Question
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29798509
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47724846
tagged with: http://stackoverflow.com/tag/html
tagged with: datatables
has title: How to change the thead's html of the dataTables
has body: I need to add two &lt;span&gt;(clear and check all) to the thead cell(except the frist one). I add this to fnDrawCallback $("#authManageUserListTable thead tr th").each(function(){ console.log($(this).html()); $(this).html(".....");//change something here, but it does not help }); I use the same method to the tbody and it does work. I look at the html dom and I found th within #authManageUserListTable does not have any text(html), instead, it has aria-label. How should I add two button to the thead which can manipulate all the data at that column

http://stackoverflow.com/q/29739371
downvote count: 2
tagged with: wordpress
tagged with: audio-recording
answer count: 1
has comment: http://stackoverflow.com/comment/47611822
tagged with: audio
has title: How can I use RecordJs in Wordpress
has answer: http://stackoverflow.com/a/29873764
type: AnsweredQuestion
upvote count: 0
accepted answer: http://stackoverflow.com/a/29873764
tagged with: javascript
favorite count: 0
has body: I need to create a page in wordpress with an audio recorder, after this audio be recorded, I need to send it by mail to me. know I can record audio with the recorderjs javascript library. GitHub RecorderJs However I'm not getting implement the example link above is possible to use RecordJs for this in wordpress? is there any other way? You guys know any free plugin for wordpress with this audio recorder?
type: Question
score: -2

http://stackoverflow.com/comment/47543645
has text: Thanks for this article. I am following the instruction if I can make it works
comment on: http://stackoverflow.com/a/29703503
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/119446556
type: AnswerComment
type: Comment
score: 2
comment on: http://stackoverflow.com/a/29810180
has text: Good is deprecated. "Note: this module is being deprecated on December 31st, 2020 due to lack to available support resources. Please consider using another logging plugin."

http://stackoverflow.com/comment/47784512
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29828359
has text: thank you but this code show numbers like this:100008,100010,100013,100012,i don't know why

http://stackoverflow.com/a/29729392
type: Answer
has comment: http://stackoverflow.com/comment/47642509
has comment: http://stackoverflow.com/comment/47642853
answers question: http://stackoverflow.com/q/29729242
has comment: http://stackoverflow.com/comment/47642174
has comment: http://stackoverflow.com/comment/47633237
has comment: http://stackoverflow.com/comment/47640787
upvote count: 4
has body: While doing minification you should for array annotation of DI. You are not using angular di array notation inside you app.js, you need to do below changes. From app.config(routeConfig); To app.config(['$stateProvider', routeConfig]); For more Information Refer this SO Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/47619637
score: 4
has comment: http://stackoverflow.com/comment/47642130

http://stackoverflow.com/comment/47730862
type: AnswerComment
has text: Sublime Text is an editor. The [Javascript console](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers) is part of your browser.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29800092

http://stackoverflow.com/q/29812485
tagged with: twitter-bootstrap
upvote count: 1
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29998512
score: 1
has answer: http://stackoverflow.com/a/29812682
type: Question
has body: I loaded bootstrap css and js files and added the html code of following. Both are succesfully loaded - css in head tag and js below footer. Other functions are also working fine. Toggle navigation NekTime Home About {% if current_user and current_user.is_authenticated() %} Logged in as {{ current_user.username }} {% elif form %} Create account {{ form.hidden_tag() }} {{ form.username(placeholder="Username", class_="form-control") }} {{ form.password(placeholder="Password", class_="form-control") }} Log in {% endif %} When I shrink the browser, the toggle button replaces other menus, but I cannot expand that toggle button. I managed to get the right data-target.. i don't know what to do next
answer count: 2
possible better answer: http://stackoverflow.com/a/29812682
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/29998512
has title: bootstrap navbar mobile toggle not working
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/29796314
type: AnsweredQuestion
has body: I am trying to teach myself javascript and for my first small project I am trying to animate by looping two images from the array depending on situation. Ie. a win scenario would loop heroIdle and heroWave. After a few hours of searching I have turned here in hope of any guidance. image.push({ id: "heroIdle", src: "heroIdle.png" }); image.push({ id: "heroWave", src: "heroWave.png" }); image.push({ id: "heroStomp", src: "heroStomp" }); I have tried to simply return image["heroIdle"]; and still nothing is displayed. What am I doing wrong?
has comment: http://stackoverflow.com/comment/47720816
upvote count: 3
has comment: http://stackoverflow.com/comment/47720883
type: Question
has answer: http://stackoverflow.com/a/29796403
has answer: http://stackoverflow.com/a/29796482
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/29796666
favorite count: 0
has answer: http://stackoverflow.com/a/29796491
possible better answer: http://stackoverflow.com/a/29796482
has comment: http://stackoverflow.com/comment/47720747
answer count: 4
accepted answer: http://stackoverflow.com/a/29796403
score: 2
downvote count: 1
has title: Trying to loop through two elements of a push array

http://stackoverflow.com/q/29812287
tagged with: d3.js
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29813958
type: Question
has title: how do I labels to the axis in this d3 example
has body: I figured out how to enter my data into this d3 chart but I can't seem to figure out how to put labels on both the x and y axis. I am looking to put strings as the values in the x-axis. Any help would be greatly appreciated. thank you Grouped Stacked
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/q/29823424
possible better answer: http://stackoverflow.com/a/29823713
has body: My code of sliding menu is not working in the project although i tested it on jsfiddle it is working there fine but it is not working in my project .actually the problem is in inclusion of file " jquery-1.11.2.min.js" i have also downloaded this file and included in my project and provided a path for the same but still it is not working this is the code for including the file am i doing anything wrong for including that file this is the path in the directory of my project
type: Question
has answer: http://stackoverflow.com/a/29823713
has title: jquery-1.11.2.min.js is not working in sliding menu
tagged with: slidingmenu
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47773205
has answer: http://stackoverflow.com/a/29823820
answer count: 2
has comment: http://stackoverflow.com/comment/47773002
accepted answer: http://stackoverflow.com/a/29823820
has comment: http://stackoverflow.com/comment/47772984
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47772987
score: 0

http://stackoverflow.com/a/29725337
type: Answer
score: 2
downvote count: 0
has body: As was suggested in the comment by @dandavis, you should trim the string in PHP before it gets sent to your browser: case "gettickettemp": if(isset($_POST["categorie_id"])){ $categorie_id = $sql-&gt;escape_string($_POST["categorie_id"]); $getTemp = $sql-&gt;query("SELECT * FROM `ticket_categories` WHERE `id` = '$categorie_id'"); $tempData = $getTemp-&gt;fetch_assoc(); $data = str_replace('&lt;br&gt;', "\n", $tempData['body']); echo trim($data); // &lt;-- remove whitespace here. } break; You can check if the payload contains the whitespace by using Chrome's dev tools. If you press Command+Shift+I (Mac) and then click on the network tab, new AJAX requests should show up there. If not, then reload the page, and you should see all the requests, with new ones showing up at the bottom. You can inspect the content that the server sent back to you by clicking on the response tab.
answers question: http://stackoverflow.com/q/29725117
accepted answer of: http://stackoverflow.com/q/29725117
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/q/29806318
possible better answer: http://stackoverflow.com/a/29806850
has answer: http://stackoverflow.com/a/29806850
has comment: http://stackoverflow.com/comment/47741215
has comment: http://stackoverflow.com/comment/47740896
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47741221
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47741093
score: 3
has answer: http://stackoverflow.com/a/29806739
has title: jQuery .each() won't iterate independently
tagged with: javascript
upvote count: 4
answer count: 2
has body: I'm using the following piece of jQuery to apply span styles to the currency symbol and decimals of a bunch of monetary values. $('td.priceBox').each(function() { $(this).html('&lt;span class="price_currency price_element"&gt;' + $(this).html().substr(0, 1) // this styles the currency unit + "&lt;/span&gt;" + $(this).html().substr(1, $(this).html().length-3) // this leaves the rounded value as is + '&lt;span class="price_cents price_element"&gt;' + $(this).html().substr(-2) + "&lt;/span&gt;") // this styles the decimals }); This code works for the first value on the page, e.g. "$180.65," but then copies that value and replaces every value on the page with "$180.65". What am I doing wrong? How can I get this to iterate independently for each td.priceBox? Note: The contents of td.priceBox are generated dynamically and I don't have access to them. I cannot write the spans inline. EDIT: I had another script designed to remove the decimal $('.bannerContent td').html($('.bannerContent td').html().replace(".",""));. This targeted the same td, but didn't identify it by its class. This successfully removed the decimal, but for some reason it broke the .each() method. Why?
has comment: http://stackoverflow.com/comment/47741023
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29806739
favorite count: 0
has comment: http://stackoverflow.com/comment/47740576

http://stackoverflow.com/comment/47585723
comment on: http://stackoverflow.com/a/29725648
type: AnswerComment
type: Comment
score: 0
has text: Avoid `Array.prototype.slice.call`; better to just use a `for` loop here. https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments

http://stackoverflow.com/comment/47760134
type: QuestionComment
has text: First of all, [avoid the deferred antipattern](http://stackoverflow.com/q/23803743/1048572)!
type: Comment
comment on: http://stackoverflow.com/q/29816137
score: 2

google-chrome-extension
tags question: http://stackoverflow.com/q/29773833
tags question: http://stackoverflow.com/q/29809200
tags question: http://stackoverflow.com/q/29732195
tags question: http://stackoverflow.com/q/29700887
tags question: http://stackoverflow.com/q/29726016
tag name: google-chrome-extension
tags question: http://stackoverflow.com/q/29698988
tags question: http://stackoverflow.com/q/29825934
tags question: http://stackoverflow.com/q/29726604
tags question: http://stackoverflow.com/q/29733573
tags question: http://stackoverflow.com/q/29723060
tags question: http://stackoverflow.com/q/29697561
tags question: http://stackoverflow.com/q/29736331
tags question: http://stackoverflow.com/q/29747809
tags question: http://stackoverflow.com/q/29724974
tags question: http://stackoverflow.com/q/29829628
tags question: http://stackoverflow.com/q/29802740
tags question: http://stackoverflow.com/q/29784423
tags question: http://stackoverflow.com/q/29816689
tags question: http://stackoverflow.com/q/29794207
tags question: http://stackoverflow.com/q/29744566
tags question: http://stackoverflow.com/q/29813340
tags question: http://stackoverflow.com/q/29786672
type: Tag
tags question: http://stackoverflow.com/q/29709354
tags question: http://stackoverflow.com/q/29762033
tags question: http://stackoverflow.com/q/29707434
tags question: http://stackoverflow.com/q/29783960
tags question: http://stackoverflow.com/q/29789841
tags question: http://stackoverflow.com/q/29752326
tags question: http://stackoverflow.com/q/29818685
tags question: http://stackoverflow.com/q/29793301
tags question: http://stackoverflow.com/q/29795933
tags question: http://stackoverflow.com/q/29835004
tags question: http://stackoverflow.com/q/29787549
tags question: http://stackoverflow.com/q/29795924
tags question: http://stackoverflow.com/q/29795807
tags question: http://stackoverflow.com/q/29712793
tags question: http://stackoverflow.com/q/29818457

http://stackoverflow.com/a/34967270
score: 1
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29824242
has body: UPDATING MY ANSWER FOR A MORE GENERIC AND "SAFER" SOLUTION It turns out that we could share data across namespaces, but we have to do that by referring the socket instance from once namespace to another. Suppose there are two namespaces, namely, namespace_A and namespace_B. To get the corresponding socket object on namepsace_A from within namespace_B, we fetch it by using the current socket object's ID (as it will be similar) from the connected object in the namespace_A namespace object. Though this is still kind of an workaround, but this is by far the best and safest way I have been able to share session data among namespaces. We'll use the socket.id to refer to the required sockets. The IDs look something like this: /namespace#vCpuzzUi4RI1DHqfAAAH. Each socket instance within the namespaces have the IDs similar except for the namespace portion, i. e., for namespace_A, the ID would be something like /namespace_A#vCpuzzUi4RI1DHqfAAAH and for namespace_B it would be /namespace_B#vCpuzzUi4RI1DHqfAAAH. Therefore we could refer one socket instance from one namespace in another if we could generate a socket ID similar to the present socket and use it. What we need to do is first declare a variable at the beginning like: var self = this; This is used to hold a reference to the present object. Next within one namespace, suppose namespace_A, we need data from socket instance of namespace_B by writing this code in A: ns_b_socket = self.namespace_B.connected['/namespace_B#' + buildSocketID(socket.id)]; We refer to the namespace_B of the present instance using self.namespace_B and then call connected over it. Namespace#connected:Object Hash of Socket objects that are connected to this namespace indexed by id. I use a custom function to generate the ID. function buildSocketID(iden) { return iden.split('#')[1]; } Now, if you call ns_b_socket.username from namespace_A, you'd get the value set for socket.username from namespace_B. NOTE: This works for version 1.0.x and above. For…
downvote count: 0

http://stackoverflow.com/a/64859279
answers question: http://stackoverflow.com/q/29743729
has body: For a more accurate solution, you can listen to the events that trigger the seek such as mousedown on progress bar, left key, right key etc., and get the current time from these events. For example in version 7.10.2 you can do the following, let seekStartTime; player.controlBar.progressControl.on('mousedown', () => seekStartTime = player.currentTime()); player.controlBar.progressControl.seekBar.on('mousedown', () => seekStartTime = player.currentTime()); player.on('keydown', (e) => { if (e.key === "ArrowLeft" || e.key === "ArrowRight") { seekStartTime = player.currentTime(); } }); console.log(seekStartTime); Note 1: There are two seperate mousedown event listeners for progress control and seek bar. This is because the video can be seeked by clicking outside the seek bar on the progress control as well. Note 2: Seeking using hotkey numbers does not pause the video. However, if necessary you can add those keydown listeners too.
score: 0
type: Answer

http://stackoverflow.com/q/29725220
answer count: 2
has title: jQuery search filter show the list item header
possible better answer: http://stackoverflow.com/a/29725311
has answer: http://stackoverflow.com/a/29725311
tagged with: jquery
has answer: http://stackoverflow.com/a/29725249
favorite count: 0
upvote count: 12
type: AnsweredQuestion
downvote count: 0
has body: I have following list -ABC- 123 258 189 545 -CDE- 789 215 897 999 -EFG- 701 566 511 When searching the item it should show the list item header For example when i am searching '9' It should show -ABC- 189 -CDE- 789 897 999 Now I am getting search list only: function filter(element) { var value = $(element).val(); $("#fromList li").each(function() { if ($(this).text().search(new RegExp(value, "i")) > -1) { $(this).show(); } else { $(this).hide(); } }); } ABC 123 258 189 545 CDE 789 215 897 999 E 701 566 511
type: Question
tagged with: jquery-ui
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29725249
score: 12

http://stackoverflow.com/a/31812126
type: Answer
has body: I've been having exactly this same issue, and it's been driving me up the wall. I came here hoping to find an answer, but no luck. So after much research, it seems to me that this is just a bug in ng-grid. There seems to be no way to resolve it... except to upgrade to the renamed new version of ng-grid, ui-grid. It looks fairly straightforward, and all the common gotchas in upgrading are documented here. I've forked and updated the second Plunk from your question (Plunk), and while it doesn't quite look perfect, it's a good proof of concept. In a nutshell, change the module dependency from ngGrid to ui.grid plus any additional features you need: var app = angular.module('myApp', ['ui.grid', 'ui.grid.cellNav', 'ui.grid.edit', 'ui.grid.selection']); ...and add these same dependencies as directives on the same element as ui-grid="gridOptions": &lt;div class="gridStyle" ui-grid="gridOptions" ui-grid-cellNav ui-grid-edit ui-grid-selection&gt; &lt;/div&gt; You can see in the Plunk that tabbing beyond the edge of the viewport just works in ui-grid (with ui-grid-cellNav), no hacky workaround required.
score: 0
answers question: http://stackoverflow.com/q/29809699

http://stackoverflow.com/comment/47658462
type: Comment
has text: If you've included jQuery, why wouldn't you use `$.ajax`, it's one of the best parts ?
score: 0
comment on: http://stackoverflow.com/q/29763428
type: QuestionComment

http://stackoverflow.com/comment/47802613
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29835788
has text: @mistermansam OP may very well already have div and span elements in use as he has a calendar built. The example shows how he can simply wrap his existing code in label tags. Targeting input was also just an example. The best way would be to assign a class to the check boxes that need to be hidden.

http://stackoverflow.com/a/29787050
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has body: I made a few assumptions on what the values are and after I Added a few verifications like if(node.attributes.length>0)into your code, it seems to work. var payment={htmlContent:[[' sometext ', ' sometexthere '],[' sometext ', ' sometext ']]}; var getParents = function(node, parentNodes){ if(node.nodeName == 'span'){ if(node.attributes.length>0) parentNodes.push(node.attributes[0].nodeValue); } else if(node.nodeName == 'p' && node.attributes.length > 0) { parentNodes.push(node.nodeName); if(node.attributes.length>0) parentNodes.push(node.attributes[0].nodeValue); } else { parentNodes.push(node.nodeName); } if(node.parentNode.nodeName != '#document'){ getParents(node.parentNode, parentNodes); } return parentNodes; }; var parse = function(node, vertical, horizontal, paragraph){ if(node.childNodes.length > 0){ for(var int = 0; int < node.childNodes.length; int++){ parse(node.childNodes[int], vertical, horizontal, paragraph); } } else{ var object = {}; var attributes = getParents(node, []); console.log(attributes); for(var int = 0; int < attributes.length; int++) { // right alignment if(/text-align/i.test(attributes[int])){ object.alignment = attributes[int].split(": ")[1].replace(';',''); } else if (/color/i.test(attributes[int])) { // color object.color = attributes[int].split(":")[1]; } else if (attributes[int] == 'em') { // italic if (object.italics) { delete object.bold; object.bolditalics = true; } else { object.italics = true; } } else if (attributes[int] == 'strong') { // bold if (object.italics) { delete object.italics; object.bolditalics = true; } else { object.bold = true; } } else if (attributes[int] == 'u') { // underline object.decoration = 'underline'; } else if (attributes[int] == 's') { // strike object.decoration = 'lineThrough'; } } object.text = node.textContent; if(!pdfContent[vertical])pdfContent[vertical]=[]; if(!pdfContent[vertical][horizontal]) pdfContent[vertical][horizontal]=[]; pdfContent[vertical][horizontal].push(object); } }; var pdfConten…
accepted answer of: http://stackoverflow.com/q/29783391
type: Answer
answers question: http://stackoverflow.com/q/29783391

http://stackoverflow.com/q/29772837
score: 4
has body: I would like some help with mouse-over on jquery. An automatic mouse-over popup needs to occur on every event, on a jquery calendar. Here's a similar example. However I'd like to create an automatic mouse-over on every event present on the calendar. $(document).on('pageshow','#index',function(e,data){ var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); $('#calendar').fullCalendar({ editable: true, events: [ { title: 'All Day Event', start: new Date(y, m, 1) }, { title: 'Long Event', start: new Date(y, m, d-5), end: new Date(y, m, d-2) }, { id: 999, title: 'Repeating Event', start: new Date(y, m, d-3, 16, 0), allDay: false }, { id: 999, title: 'Repeating Event', start: new Date(y, m, d+4, 16, 0), allDay: false }, { title: 'Meeting', start: new Date(y, m, d, 10, 30), allDay: false }, { title: 'Lunch', start: new Date(y, m, d, 12, 0), end: new Date(y, m, d, 14, 0), allDay: false }, { title: 'Birthday Party', start: new Date(y, m, d+1, 19, 0), end: new Date(y, m, d+1, 22, 30), allDay: false }, { title: 'Click for Google', start: new Date(y, m, 28), end: new Date(y, m, 29), url: 'http://google.com/' } ] }); }); My Page My Team
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29935701
upvote count: 4
has title: Jquery event calendar tool tip
downvote count: 0
has answer: http://stackoverflow.com/a/29774708
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/47652440
has text: You should be able to send requests with ajax, you just can't receive the result, not that it's clear how one would do that with a form submit either ?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29760054

http://stackoverflow.com/q/29741416
tagged with: http://stackoverflow.com/tag/svg
answer count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47621342
tagged with: javascript
has title: How to show multiline text with scrollbar on SVG
score: 0
has comment: http://stackoverflow.com/comment/47621842
has comment: http://stackoverflow.com/comment/47619259
tagged with: d3.js
has body: I am looking for a way by which I can show some multiline text data on a SVG along with scrollbar. I have tried the option of adding a textarea along with foreignObject which works with Chrome, FF, Opera but fails in IE. d3.select("g") .append('foreignObject') .attr("class", "csFObject") .attr("x", mouse[0] + 160) .attr("y", mouse[1] + 10) .attr('width', 280) .attr('height', 290) .append("textarea") .attr("cols", 37) .attr("rows", 14) .attr("readonly", "true") .attr("style", "overflow:auto;font-size: 14px;background-color:#ededed;border: 0px; width:280px;") .attr("x", mouse[0] + 160) .attr("y", mouse[1] + 20) .attr("id", "txtAreaGeoDescription") .attr("class", "txtAreaGeoDescription"); var textarea; { textarea = document.getElementById("txtAreaGeoDescription"); textarea.value = geoDescription; //textarea.scrollTop = textarea.scrollHeight; } So looking for other options, Another way I tried is : d3.select("g").append("g") .attr("width", 280) .attr("height", 290) .attr("class", "overlay") .append("text") .attr("x", mouse[0] + 160) .attr("y", mouse[1] + 20) .call(wrap, 280,geoDescription); Here I am able to get the data visible on all the browsers but I need a scroll bar to appear after 5 lines of data shown. Any suggestion on how can I achieve to show a multiline data on a SVG with scrollbar.

http://stackoverflow.com/q/29774838
has comment: http://stackoverflow.com/comment/47682294
tagged with: angularjs
answer count: 3
has answer: http://stackoverflow.com/a/29777076
favorite count: 0
score: 2
has answer: http://stackoverflow.com/a/29775768
has title: Angular: $rootScope variable vs event
has comment: http://stackoverflow.com/comment/47680104
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47685434
has body: I'm dealing with an app that manages users login. Like in many apps, i want to change the header when the user logs in. I've a main file (index.html) which uses ng-include to include the header.html I found two solutions (i'm new to angular, so both may be wrong): 1) use a $rootScope.broadcast() So when the user logs in I broadcast (the auth.js, it's inside a factory) a message that is intercepted by the controller in the header. the auth.js $rootScope.$broadcast('logged',user); the controller.js $scope.$on('logged', function(evnt, message){ $scope.user = message; }); the header.html ... User: {{user.name}} 2) set a $rootScope variable As far as I understood $rootScope is the root of all the scope (the naming is quite smart) and all the $scope have access to it. the auth.js $rootScope.user=user; the heaeder.html (no controller is needed here) ... User: {{user.name}} Now, what's the correct way to handle it? the first seems a bit more expensive since the broadcast may have to do many checks. the second .. well, I'm not a fan of global variables.. EDIT 3) use service after the comment of alex I add this options, even if I'm not able to make it working. (here the plunkr) it does not work without events index.html ... ... header.html as for the number 1) controller.js .controller('GcUserCtrl', ['$scope','my.auth','$log', function ($scope, auth, $log) { $scope.user = auth.currentUser(); }]); my.auth.js .factory('my.auth', ['$rootScope', '$log', function ($rootScope, $log, localStorageService) { var currentUser = undefined; return { login: function (user) { currentUser = user; ... }, ... currentUser: function () { return currentUser; } }; }]); The problem here is that the controller is called only the first time and nothing happens after the login.
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/47681686
possible better answer: http://stackoverflow.com/a/29775768
has answer: http://stackoverflow.com/a/29775960
accepted answer: http://stackoverflow.com/a/29775960
downvote count: 0
has comment: http://stackoverflow.com/comment/47680903
tagged with: javascript

http://stackoverflow.com/a/29844954
has body: You can use the filter() function to find all option elements in other select elements with matching values, and hide them. Try this: $('.fields-mapping').change(function() { var value = $(this).val(); var $otherOptions = $('.fields-mapping').not(this).find('option').show(); $otherOptions.filter(function() { return $(this).text() == value; }).hide(); }); Example fiddle Note this will work for any number of selects without any changes (so long as there are enough option elements within those select elements to make one choice from each).
downvote count: 0
answers question: http://stackoverflow.com/q/29844746
type: Answer
has comment: http://stackoverflow.com/comment/47957213
upvote count: 3
score: 3
accepted answer of: http://stackoverflow.com/q/29844746
type: AcceptedAnswer

http://stackoverflow.com/comment/47948031
type: AnswerComment
type: Comment
has text: Thanks @rbrundritt. My first experience with Bing Maps + DbGeometry is that documentation could be better with more examples or just a few extra sentences compared to Google. e.g. the DbGeometry.FromText method ( https://msdn.microsoft.com/en-us/library/hh506050(v=vs.110).aspx ) What are the possible SRID's, what exactly is wellKnownText etc..
comment on: http://stackoverflow.com/a/29834629
score: 0

http://stackoverflow.com/comment/81707276
comment on: http://stackoverflow.com/a/29746871
score: 0
type: AnswerComment
type: Comment
has text: @SurendraJnawali If `reload()` is not defined (when using IE), you can define the reload function and put `window.location=window.location` inside it. This should do the trick.

http://stackoverflow.com/comment/47814490
score: 1
comment on: http://stackoverflow.com/q/29842016
type: QuestionComment
type: Comment
has text: This script is missing. addTyping() is part of it.

http://stackoverflow.com/comment/47596688
has text: Where is your `html` code then?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29731757
type: Comment

http://stackoverflow.com/q/29764260
tagged with: hover
has body: Currently, I'm facing a problem of hover link dynamic data table with an area of the map shows on website. The script I use for table show as below: $(function () { $("[id*=buildingView] td").hover(function () { $("td", $(this).closest("tr")).addClass("hover_row"); }, function () { $("td", $(this).closest("tr")).removeClass("hover_row"); }); }); For the floor image as below: &lt;img src="images/classroom.png" usemap="#A1floor" style="max-width:100%; display:block;height:auto" &gt; &lt;map id="image_map" name="A1floor"&gt; &lt;area href="#" state="room101" shape="rect" coords="72, 52, 258, 130"&gt; I am using hover to let the dynamic table show the hover on background, the problem is I have no idea how to link the floor image with the table by using hover. How to make the table and map synchronize by using hover?
has comment: http://stackoverflow.com/comment/47661274
type: Question
has comment: http://stackoverflow.com/comment/47662425
has comment: http://stackoverflow.com/comment/53546468
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47662137
has title: How to use hover link dynamic table data with an area of the map?
tagged with: synchronized
score: 0
has comment: http://stackoverflow.com/comment/54351390
tagged with: css
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47663507

http://stackoverflow.com/comment/47713128
type: QuestionComment
has text: how are you testing to see if the id is added?
score: 1
comment on: http://stackoverflow.com/q/29792208
type: Comment

http://stackoverflow.com/comment/47576345
has text: ok. here is what am intendding to do: First, declare an array named myArray Great! Now populate myArray with two strings. Put your full name in the first string, and your Skype handle in the second. Next, declare a function named cutName. It should take a string as an argument. cutName should return an array by breaking up the input string into individual words. For example "Douglas Crockford" should be returned as ["Douglas", "Crockford"]
score: 0
comment on: http://stackoverflow.com/q/29719678
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29758233
answer count: 2
tagged with: fieldofview
has title: three.js - check if object is still in view of the camera
has comment: http://stackoverflow.com/comment/47649144
downvote count: 1
upvote count: 23
tagged with: javascript
score: 22
favorite count: 0
type: UnansweredQuestion
tagged with: three.js
has answer: http://stackoverflow.com/a/41094121
type: Question
has answer: http://stackoverflow.com/a/69955650
tagged with: camera
has body: When working with a 2d canvas, if you want to check if something is no longer "on screen" you simply do something like this: if( pos.x &gt; window.innerWidth || pos.x &lt; 0 || pos.y &gt; window.innerHeight || pos.y &lt; 0 ) { // has left the screen } How would I check to see if something is still "on screen" ( in view of the camera ) in a three.js scene?
has comment: http://stackoverflow.com/comment/47651857

http://stackoverflow.com/comment/47808378
comment on: http://stackoverflow.com/a/29841059
has text: in my scenarios i need to append the style in dynamically.. when i hover the window that time i can get the element color and add the class(highlightStyle)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29753153
has body: Basically, the button will open a dialog page to verify a license agreement then request a file from the user, by pathname only, but will not use that value to post or partial post the form for this point. I have tried numerous searches, but due to the negative logic, searches return false results as far as I have discovered. After the file is selected and the user is ready, the file selected is uploaded, and that could post, but the rest of the form content and validation must be excluded at that point, chrome is having it all go at once.
score: 0
answer count: 2
tagged with: asp.net
has title: I need detail on how to make a button in an asp updatepanel that does NOT post back to the server
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29753319
has answer: http://stackoverflow.com/a/29753696
type: Question
has comment: http://stackoverflow.com/comment/47638583
possible better answer: http://stackoverflow.com/a/29753319
accepted answer: http://stackoverflow.com/a/29753696
tagged with: javascript

http://stackoverflow.com/comment/47680381
type: Comment
comment on: http://stackoverflow.com/a/29774450
score: 0
type: AnswerComment
has text: Thank you Mikey, such a simple error that had me confused for awhile.

word-break
tags question: http://stackoverflow.com/q/29694784
type: Tag
tag name: word-break

http://stackoverflow.com/a/29727445
type: Answer
has body: Add an id to your form as a handler for JQuery. Then add a placeholder element (in this case it is #reply-user) to output your message (greeting) to the user. The placeholder is a way you can bypass an alert popup. &lt;form id="your-form" method="GET"&gt; &lt;input type="text" class="form" name="name" placeholder="Your name here!" id="name"&gt; &lt;input type="submit" onclick="return clicked();" value="I'm ready!"&gt; &lt;/form&gt; &lt;h3 id="reply-user"&gt;&lt;/h3&gt; &lt;br&gt; &lt;script&gt; function clicked() { var name = document.getElementById('name').value; $('#your-form').fadeOut(); $('#reply-user').append('Hello ' + name + ', great to see you!'); } &lt;/script&gt;
score: 0
answers question: http://stackoverflow.com/q/29727378

http://stackoverflow.com/q/29770341
has body: I have the following ajax function: $("#signInButton2").click(function() { $.ajax({ type: "POST", data: {couponcode: $('#couponCode').val(), userEmail: $('#login-username').val() }, url: 'coursePayment.php', success: function (response) {//response is value returned from php (for your example it's "bye bye" } }); }); My problem are as follow: It does not seem to post anything to the coursePayment.php userEmail can be refered in both the login-username and the registration, username, how do i associate both id with the userEmail variable essentially similar to point 2. I have couponCodeRegisterAmount and I have couponCodeLoginAmount ID that I would like to associate with one post variable called couponCodeAmount, and which I would like to be able to retrieve on the coursePayment page For any clarification, let me know thanks Update HTML <?php ?> Sign In to Proceed with Purchase Don't have an account! Sign Up Here Remember me Forgot password? Sign Up Sign In Error: First Name Last Name Email Phone Number Password Company Name Position
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47671718
tagged with: php
has comment: http://stackoverflow.com/comment/47671271
type: Question
has title: working with ajax variables and post
has comment: http://stackoverflow.com/comment/47671184
score: 0
has comment: http://stackoverflow.com/comment/47671456
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/47674333
tagged with: http://stackoverflow.com/tag/html
answer count: 0

http://stackoverflow.com/q/29705717
score: 3
has comment: http://stackoverflow.com/comment/47547347
tagged with: modal-dialog
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47547322
has comment: http://stackoverflow.com/comment/47547060
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/29706060
has body: I have been trying for a while now to create a modal window that opens with dynamic id's that are generated in php. The id's are all stored within a database and called when needed to create a user table. I want to be able to click on a user and have all of their settings and options appear in the modal window, although as I have said above I want one modal that opens the correct information for the user depending upon which users has been clicked. I have the current code displaying the users: if ($result->num_rows > 0) { echo " Name Username "; // output data of each row while($row = $result->fetch_assoc()) { echo " ".$row["name"]." ".$row["username"]." "; } echo " "; } else { echo "There are 0 clients in the system matching your search criteria"; and I have tried the following to get the modal to open. Use the map below to select the closest agent to the breakdown THIS IS A MODAL Am I using the wrong id for the modal?
has comment: http://stackoverflow.com/comment/47547535
has comment: http://stackoverflow.com/comment/47547133
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47547121
tagged with: php
has title: Can I create a modal with a dynamic id?
type: Question

http://stackoverflow.com/comment/47753996
type: Comment
has text: No. Your question is general. I gave a general answer. I gave some suggestions, but you have to choose what tools and approach to use. If you make a decision and still have problems, you can ask another question about the specifics.
type: AnswerComment
comment on: http://stackoverflow.com/a/29789500
score: 1

http://stackoverflow.com/comment/47566164
type: AnswerComment
comment on: http://stackoverflow.com/a/29715579
has text: gem 'rails', '4.0.4' and ruby something like 2.2.0
type: Comment
score: 0

http://stackoverflow.com/a/29743210
type: Answer
has comment: http://stackoverflow.com/comment/47619686
has comment: http://stackoverflow.com/comment/47619644
has body: As the intention of the code is to equalise the heights of all the divs, you can negate the need for any if statements and use jQuery's map() to get all the heights, then use Math.max to get the tallest. Try this: $('.container').each(function(){ var $divs = $('.first, .seconds, .third, .fourth', this); var heights = $divs.map(function() { return $(this).height(); }).get(); $divs.height(Math.max.apply(this, heights)); }); Note that the initial selector could be improved by adding a single common class to all the divs.
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/47619877
has comment: http://stackoverflow.com/comment/47619891
has comment: http://stackoverflow.com/comment/47619852
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29742593
answers question: http://stackoverflow.com/q/29742593

logstash
tags question: http://stackoverflow.com/q/29701796
type: Tag
tag name: logstash

http://stackoverflow.com/a/66736212
has comment: http://stackoverflow.com/comment/125573957
answers question: http://stackoverflow.com/q/29810914
score: 38
has comment: http://stackoverflow.com/comment/128721067
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/125458614
has comment: http://stackoverflow.com/comment/128341903
has comment: http://stackoverflow.com/comment/128720976
has comment: http://stackoverflow.com/comment/125643853
has comment: http://stackoverflow.com/comment/125599740
upvote count: 39
has body: React Hooks Solution 2022 const arr = [ { id: 1, txt: 'One' }, { id: 2, txt: 'Two' }, { id: 3, txt: 'Three' }, ] const App = () => { const handleClick = useCallback( (id) => () => { console.log("ID: ", id) }, [], ) return ( {arr.map((item) => ( {item.txt} ))} ) } You can pass a function to useCallback's return, you can then call your function normally in the render by passing params to it. Works like a charm! Just make sure you set your useCallback's dependency array appropriately. Best Solution with React >= 16 The cleanest way I've found to call functions with multiple parameters in onClick, onChange etc. without using inline functions is to use the custom data attribute available in React 16 and above versions. const App = () => { const onClick = (e) => { const value1 = e.currentTarget.getAttribute("data-value1") const value2 = e.currentTarget.getAttribute("data-value2") const value2 = e.currentTarget.getAttribute("data-value2") console.log("Values1", value1) console.log("Values2", value2) console.log("Values3", value3) } return ( ) } Above example is for a functional component but the implementation is pretty similar even in class components. This approach doesn't yield unnecessary re-renders because you aren't using inline functions, and you avoid the hassle of binding with this. It allows you to pass as many values as you would like to use in your function. If you are passing values as props to your children to be used in the Child Component's onClick, you can use this approach there as well, without creating a wrapper function. Works with array of objects as well, in cases where you want to pass the id from the object to the onClick, as shown below. const App = () => { const [arrState, setArrState] = useState(arr) const deleteContent = (e) => { const id = e.currentTarget.getAttribute("data-id") const tempArr = [...arrState] const filteredArr = tempArr.filter((item) => item.id !== id) setArrState(filteredArr) } return ( {arrState.map((item) => ( <React.Fragmen…
has comment: http://stackoverflow.com/comment/125490979
has comment: http://stackoverflow.com/comment/125649930

http://stackoverflow.com/q/29838772
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29838860
has comment: http://stackoverflow.com/comment/47804468
accepted answer: http://stackoverflow.com/a/29838887
type: Question
has answer: http://stackoverflow.com/a/29838832
tagged with: javascript
tagged with: jquery
score: -1
has title: Replace all path on image file name
has answer: http://stackoverflow.com/a/29838887
has answer: http://stackoverflow.com/a/29839002
upvote count: 2
downvote count: 3
answer count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/47803880
has body: I have a list of image in a page. &lt;img src="image/one.jpg"/&gt; &lt;img src="image/two.jpg"/&gt; &lt;img src="image/three.jpg"/&gt; &lt;img src="image/four.jpg"/&gt; &lt;img src="image/five.jpg"/&gt; &lt;img src="image/six.jpg"/&gt; &lt;img src="image/seven.jpg"/&gt; How to change the path of image/ into 'http://mywebsite.com/folder/' when the first time the page is load? I want to use javascript, or jquery. Thanks in advance.
has comment: http://stackoverflow.com/comment/47803894
possible better answer: http://stackoverflow.com/a/29839002

http://stackoverflow.com/a/41234524
score: 9
has comment: http://stackoverflow.com/comment/73283978
answers question: http://stackoverflow.com/q/29763280
type: Answer
upvote count: 9
has body: You can make User subclass the Record definition and parse address in the constructor: import {Record} from 'immutable' const Address = Record({street: '', city: '', zip: ''}); class User extends Record({name: '', address: new Address()}) { constructor({name, address} = {}) { super({name, address: new Address(address)}) } } const user = new User({ name: 'Andy', address: { street: 'wherever', city: 'Austin', zip: 'TX' } }) console.log(user) console.log('user.address instanceof Address:', user.address instanceof Address) const user2 = new User({name: 'Bob'}) console.log(user2) console.log('user2.address instanceof Address:', user2.address instanceof Address) Output: User { "name": "Andy", "address": Record { "street": "wherever", "city": "Austin", "zip": "TX" } } user.address instanceof Address: true User { "name": "Bob", "address": Record { "street": "", "city": "", "zip": "" } } user2.address instanceof Address: true
downvote count: 0
has comment: http://stackoverflow.com/comment/73250838

http://stackoverflow.com/q/29792199
score: 0
tagged with: canvas
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47713531
has comment: http://stackoverflow.com/comment/47713391
has answer: http://stackoverflow.com/a/29806231
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47713212
has comment: http://stackoverflow.com/comment/47713446
type: Question
has body: I have a canvas with width = 900, height = 574. I have all the pixels of the canvas. Inside the canvas there are some rectangles, knowing all the pixels of a rectangle what I want is to find the coordinates of the 4 points of a rectangle and then find the width and height of the rectangle. So what I did is: pMinX = (_.min(points)/ 4) % highlightCanvas.width pMinY = Math.floor((_.min(points) / 4) / highlightCanvas.width) pMaxX = (_.max(points) / 4) % highlightCanvas.width pMaxY = Math.floor((_.max(points) / 4) / highlightCanvas.width) Points is the array of the pixels (4 channels rgba) of the rectangle of which the coordinates I want to find. pMinY and pMaxY seem to work well while pMinX, pMaX sometimes seem correct while others are wrong. To test, I created a floating div and resize it according to: { width: pMaxX - pMinX height: pMaxY - pMinY } The height of the div is always correct. But the width there are cases that fails. Any idea why sometimes the calculation fails?
accepted answer: http://stackoverflow.com/a/29806231
has title: Canvas pixels to coordinates

http://stackoverflow.com/q/29759171
has body: I have multiple charts - an interactive line chart, a couple of bar charts, and a pie chart. Is there a framework where I can combine all the charts into one framework and allow me to toggle between charts? I've looked extensively and there doesn't seem to be a good answer to addressing this question.
upvote count: 1
linked to: http://stackoverflow.com/q/20734716
type: Question
score: 1
has comment: http://stackoverflow.com/comment/47655957
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47651088
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29762450
has title: Combining Multiple D3 Charts of Different Types
tagged with: d3.js
has comment: http://stackoverflow.com/comment/47739078

http://stackoverflow.com/a/29835519
type: Answer
score: 0
has body: TO deal with this issue, First you have to check if the marker is currently present on the map or not. Use the following method to know if the city under search has the Latitude and Longitude on the Map or not. This method will return true if the coordinates of the city under search are present on the map else would return false. map.getBounds().contains(marker.getPosition()); Once it returns true, you can assign it with some color. Hope that helps!!
answers question: http://stackoverflow.com/q/29804245

http://stackoverflow.com/a/29832611
accepted answer of: http://stackoverflow.com/q/29832176
type: Answer
score: 1
upvote count: 1
has body: It must be some custom event that the plugin is triggering some where in the code. Here is an example of custom events that can be created in jQuery DEMO: http://jsfiddle.net/Lk79jovg/ $('.test').on('keyup', function(){ var $this = $(this); if($this.val() == 'some text'){ $(window).trigger('custom'); } }); $(window).on('custom', function(){ alert('some text was typed in the input'); });
answers question: http://stackoverflow.com/q/29832176
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47607391
comment on: http://stackoverflow.com/a/29736915
score: 0
type: AnswerComment
has text: You are rounding in wrong place. The values in your css are still decimals. You need to do it like this: $('.mountains1' ).css('top', '1640' -(Math.round($scrollY * 0.75)) + 'px');
type: Comment

http://stackoverflow.com/comment/47697651
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29783754
type: Comment
has text: No errors in the console, really confused :\

http://stackoverflow.com/a/29767927
upvote count: 1
has comment: http://stackoverflow.com/comment/47667812
has comment: http://stackoverflow.com/comment/47668182
has body: Why don't you simply return that value from the async call in the first place? You can chain promises so by attaching a success handler in your factory and returning a value from that you can simplify your code to: as.factory("abbdata", function GetAbbData($http,$rootScope,$routeParams) { return { async: function () { return $http.get($rootScope.appUrl + '/nao/summary/' + $routeParams['id']).success(function(d) { return d.data.abbData; }); } } }); And then use it like abbdata.async().then(function(data) { $scope.abbData = data; //Contains data });
type: Answer
has comment: http://stackoverflow.com/comment/47667295
answers question: http://stackoverflow.com/q/29767842
has comment: http://stackoverflow.com/comment/47667949
has comment: http://stackoverflow.com/comment/47667459
has comment: http://stackoverflow.com/comment/47667150
downvote count: 0
has comment: http://stackoverflow.com/comment/47667765
has comment: http://stackoverflow.com/comment/47666689
has comment: http://stackoverflow.com/comment/47667622
has comment: http://stackoverflow.com/comment/47666898
has comment: http://stackoverflow.com/comment/47668288
has comment: http://stackoverflow.com/comment/47667492
score: 1
has comment: http://stackoverflow.com/comment/47667639
has comment: http://stackoverflow.com/comment/47666770
has comment: http://stackoverflow.com/comment/47667561
has comment: http://stackoverflow.com/comment/47666875
has comment: http://stackoverflow.com/comment/47666983

http://stackoverflow.com/q/29694874
type: Question
tagged with: flash
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47526577
tagged with: actionscript
has comment: http://stackoverflow.com/comment/47572005
score: 0
type: UnansweredQuestion
has title: On Load Popup Window - Adobe Flash
has body: I'm trying to load an popup window on launch when I use an swf file in adobe flash, would anyone have a code that can do that either using javascript or actionscript?
tagged with: popup
has answer: http://stackoverflow.com/a/29695487
has comment: http://stackoverflow.com/comment/47526077

http://stackoverflow.com/q/29828439
type: Question
has answer: http://stackoverflow.com/a/29828915
tagged with: javascript
score: 0
answer count: 2
has title: Looking for a Cloud Code ( javascript ) expert, dealing with Installations and channels
has body: So my biggest problem is that I never wrote a single line of javascript before but as I developing my application it has become more and more clear I have to use it in Cloud Code. I have a parse class named Groups, in this I store groups with the following data: Name, Description, Users, Requests. If a user creates a group from their device it will be here with the given name, description and the user pointer in it, and I'm using the new objectId with a + "C" char (sometimes objectId starts with a number but its not valid for a channal) to subscripte that user ( installation ) to a channel, so if I query the groups, I get the objectId and I can send every member of the group a push notification. My first problem is here, that if i store the channel to a installation object in parse with the following code: groups = new Groups(); groups.setName(groupName.getText().toString()); groups.put("members", ParseUser.getCurrentUser()); groups.setDesc(description.getText().toString()); groups.saveEventually(new SaveCallback() { @Override public void done(ParseException e) { //Subscribe to push ParsePush.subscribeInBackground("C" + groups.getObjectId(), new SaveCallback() { @Override public void done(ParseException e) { if (e == null) { Log.d("com.parse.push", "successfully subscribed to the broadcast channel."); } else { Log.e("com.parse.push", "failed to subscribe for push", e); } } }); If the user has multiple devices then he wont get the push notifications on every device just on that where he created the group. I searched for it and I am sure I have to use a Parse Cloud function for the subscribing process and with it all the Installations of a specific user will subscribe to the same channels. Here is my first problem. Can anyone help with it or just give me some reference to solve this (I read all the Cloud Documentation) Notice: After the registration I add the user pointer to the Installation like this: ParseInstallation.getCurrentInstallation().put("user", ParseUser.g…
tagged with: parse-cloud-code
tagged with: parse-platform
has answer: http://stackoverflow.com/a/29832869
type: UnansweredQuestion
tagged with: android

http://stackoverflow.com/a/29723168
has body: Change this: var elem = document.getElementById('listPlacesForm:hiddenMapCenter') To this: var elem = document.getElementById('hiddenMapCenter')
answers question: http://stackoverflow.com/q/29723110
type: Answer
has comment: http://stackoverflow.com/comment/47580626
downvote count: 2
has comment: http://stackoverflow.com/comment/47580632
upvote count: 0
score: -2

http://stackoverflow.com/comment/47724180
comment on: http://stackoverflow.com/q/29797367
has text: Ok if you only need the account val in the second one, you can save it into session `$_SESSION['account_val']` and then use it in the updatefacilities.php that will be much more reliable
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29773192
upvote count: 1
answer count: 1
tagged with: javascript
type: UnansweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29774716
favorite count: 0
has body: In Ember, I want to create a link with an optional class. In the template, I should be able to define the binding, on which the optional class is set. The target HTML should look like this Index < completed Index < active Index < in-active So the active/in-active states can be achieved with the link-to helper; {{#link-to "index" tagName="li"}}Index{{/link-to}} However, this doesn't allow me to define the optional "complete" binding. So I'm thinking about creating a subclass of LinkView, which does provide said binding. So the next step would be to create said subclass, and implement the binding. However I don't feel like duplicating the link-to helper, and am fine with using the view helper. However I cannot figure out how the view helper is supposed to work with LinkView: {{#view Ember.LinkView "index" }}Index{{/view}} DEPRECATION: Global lookup of Ember.LinkView from a Handlebars template is deprecated. Uncaught TypeError: Cannot read property 'length' of undefined {{#view Ember.LinkView target="index" }}Index{{/view}} DEPRECATION: Global lookup of Ember.LinkView from a Handlebars template is deprecated. Uncaught TypeError: Cannot read property 'length' of undefined I've been reading both the source of LinkView and link-to, but can't figure out how to proceed.
type: Question
tagged with: ember.js
has title: Ember how to use LinkView with view helper?

http://stackoverflow.com/comment/47521678
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29692196
has text: QuerySelector returns only the first element. You want QuerySelectorAll
type: AnswerComment

http://stackoverflow.com/comment/96076657
comment on: http://stackoverflow.com/q/29815389
has text: Is this still not possible in 2019?
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29827545
score: 6
type: Answer
accepted answer of: http://stackoverflow.com/q/29827439
upvote count: 6
answers question: http://stackoverflow.com/q/29827439
has body: If you want to be able to chain your function after a jQuery selector you can extend the default functionality of jQuery using its $.fn.extend() method: $.fn.extend({ CapFirstWord: function() { $word = $(this); var k = $word.length; alert(k); } }); The jQuery.fn.extend() method extends the jQuery prototype ($.fn) object to provide new methods that can be chained to the jQuery() function. Then you can call $(".pStyle").CapFirstWord();. Demo $.fn.extend({ CapFirstWord: function() { $word = $(this); var k = $word.length; alert(k); } }); $(document).ready(function (e) { $(".pStyle").CapFirstWord(); }); Of all of these "new" selectors, ::nth-letter is likely the most useful. For instance, Lettering.js wraps letters in for us so that we can select individual letters. This would be entirely unnecessary with ::nth-letter.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29823388
tagged with: c#
has comment: http://stackoverflow.com/comment/47772931
tagged with: javascript
tagged with: copy
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: Is there a way to set the data of the clipboard as html instead of plain text ? I know this is easely done in C# with : Clipboard.SetData(DataFormats.Rtf, (Object)temp); But i'm looking for a javascript solution ( can include jquery etc ... ) Edit: this only needs to work for Internet Explorer
has title: Clipboard setData ( html ) in javascript
answer count: 0
tagged with: clipboard
duplicate of: http://stackoverflow.com/q/400212
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47773067
linked to: http://stackoverflow.com/q/400212
has comment: http://stackoverflow.com/comment/47776382
type: Question

http://stackoverflow.com/comment/47783658
comment on: http://stackoverflow.com/q/29828021
has text: I tried insert in database: `function process(val) { return val.toUpperCase(); }` but keeps not working
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47836125
type: Comment
has text: no. I don't have plunker. Will have to go home and see. But i have followed what you have mentioned in here. Currently still not working. could be i am using angular bootstrap and registering the controller dynamically. but need to see
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29839369

http://stackoverflow.com/comment/47553822
has text: I changed the answer @JoseRicardoBustosM. :)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29708835
score: 1

http://stackoverflow.com/a/29725776
score: 0
has comment: http://stackoverflow.com/comment/47586036
has comment: http://stackoverflow.com/comment/47585811
answers question: http://stackoverflow.com/q/29725712
type: Answer
has body: var inputElements = document.querySelectorAll('.className'); for(var i = 0, len = inputElements.length ; i &lt; len ; i++) { inputElements[i].addEventListener('input', doSomethingFunction); } querySelectorAll returns you a static NodeList. You need to iterate and attach the event. Instead of using getElementsByClassName which returns a live HTMLCollection, working with querySelectorAll would be preferrable.
has comment: http://stackoverflow.com/comment/47585790
has comment: http://stackoverflow.com/comment/47585835
has comment: http://stackoverflow.com/comment/47586016
has comment: http://stackoverflow.com/comment/47585850

http://stackoverflow.com/q/29773790
has body: I would like to use a custom window as popup editor of a Kendo UI Grid. Its content will be complex with search fields and a grid to display search results. To do that, I don't want to use the Kendo template mechanism but a real popup window. While doing tests with custom editor I faced an issue. Even with a very basic and simple scenario (just the create command), I'm only able to open the editor once. The second time I get an error, the editor doesn't show up anymore and the grid becomes empty. Here is my HTML code : &lt;div id="main-content"&gt; &lt;div id="custom-window"&gt; &lt;/div&gt; &lt;table id="my-table-grid"&gt; &lt;/table&gt; &lt;/div&gt; The JavaScript part : function openCustomWindow(e) { e.preventDefault(); myWindow.center().open(); } function editorWindowClosed(e) { myGrid.cancelRow(); } var myWindow = $("#custom-window").kendoWindow({ modal: true, resizable: false, title: "Test", visible: false, close: editorWindowClosed }).data("kendoWindow"); var dummyDataSource = new kendo.data.DataSource( { schema : { model : { id: "id", fields: { postion: { type: "number"}, name: { type: "string"}, } } } }); dummyDataSource.add({postion: 1, name: "gswin"}); var myGrid = $("#my-table-grid").kendoGrid({ dataSource: dummyDataSource, toolbar: [ { name: "create", text: "Create" } ], editable: { mode: "popup", window: { animation: false, open: openCustomWindow, } }, columns: [ { field: "postion", title: "Postion" }, { field: "name", title: "Name" } ] }).data("kendoGrid"); The error message in the JavaScript console : Uncaught TypeError: Cannot read property 'uid' of undefinedut.ui.DataBoundWidget.extend.cancelRow @ kendo.all.min.js:29ut.ui.DataBoundWidget.extend.addRow @ kendo.all.min.js:29(anonymous function) @ kendo.all.min.js:29jQuery.event.dispatch @ jquery-2.1.3.js:4430jQuery.event.add.elemData.handle @ jquery-2.1.3.js:4116 And finally a jsfiddle link to show what I'm doing. (The popup is empty because I just want to fix the open / close mechanism before going …
tagged with: kendo-ui
has title: Kendo UI custom grid popup editor window only opens once
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/74518674
has answer: http://stackoverflow.com/a/29801668
type: Question
tagged with: kendo-grid
tagged with: javascript
has answer: http://stackoverflow.com/a/29823650
accepted answer: http://stackoverflow.com/a/29823650
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/29801668
tagged with: jquery

http://stackoverflow.com/q/29834131
has comment: http://stackoverflow.com/comment/47797269
has comment: http://stackoverflow.com/comment/47795003
upvote count: 2
score: 0
downvote count: 2
has comment: http://stackoverflow.com/comment/47794987
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29834191
has comment: http://stackoverflow.com/comment/47794967
type: Question
has comment: http://stackoverflow.com/comment/47795122
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47795021
favorite count: 0
has comment: http://stackoverflow.com/comment/47795056
has body: Can someone please loot at my HTML and tell me why it's not working correctly and what I can do to resolve it. The issue is that text inside the span is not displaying correctly. What I don't understand is that ><12(a number) displays correctly. Here's the fiddle https://jsfiddle.net/rwfg0wtL/ Here's the full code ><test ><12 ><1test
has answer: http://stackoverflow.com/a/29834191
has comment: http://stackoverflow.com/comment/47794963
tagged with: http://stackoverflow.com/tag/html
has title: text does not display correctly in HTML

http://stackoverflow.com/a/29701291
answers question: http://stackoverflow.com/q/29701127
downvote count: 0
score: 4
has body: Let's see what jQuery docs say about .add() method: When all elements are members of the same document, the resulting collection from .add() will be sorted in document order; that is, in order of each element's appearance in the document. If the collection consists of elements from different documents or ones not in any document, the sort order is undefined. To create a jQuery object with elements in a well-defined order and without sorting overhead, use the $(array_of_DOM_elements) signature. https://api.jquery.com/add/ So if you want to preserve the order, try $(items) as they suggest..?
type: Answer
upvote count: 4

http://stackoverflow.com/comment/47769683
type: QuestionComment
has text: Separate form for each product on the page sounds like deadly wrong solution.
comment on: http://stackoverflow.com/q/29821756
score: 0
type: Comment

http://stackoverflow.com/a/29799850
has comment: http://stackoverflow.com/comment/47730325
answers question: http://stackoverflow.com/q/29799628
has comment: http://stackoverflow.com/comment/47944512
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29799628
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47769375
type: Answer
downvote count: 0
has body: You already have a Controller assigned to your #tab-content. I suggest you add a scope variable keeping track of which view is active, then you can either use ng-if or ng-switch to only include the necessary views. Set the model either using ng-click (and pass it by a service if the navigation is under another controller) or append a routeParameter and set your "activeTab" scope variable using that.
score: 1

dom
tags question: http://stackoverflow.com/q/29724205
type: Tag
tags question: http://stackoverflow.com/q/29692049
tags question: http://stackoverflow.com/q/29807155
tags question: http://stackoverflow.com/q/29751778
tags question: http://stackoverflow.com/q/29747581
tags question: http://stackoverflow.com/q/29820876
tags question: http://stackoverflow.com/q/29734851
tags question: http://stackoverflow.com/q/29707322
tags question: http://stackoverflow.com/q/29787185
tags question: http://stackoverflow.com/q/29814145
tags question: http://stackoverflow.com/q/29732741
tags question: http://stackoverflow.com/q/29723088
tags question: http://stackoverflow.com/q/29769050
tags question: http://stackoverflow.com/q/29788661
tags question: http://stackoverflow.com/q/29690037
tags question: http://stackoverflow.com/q/29793148
tags question: http://stackoverflow.com/q/29751094
tags question: http://stackoverflow.com/q/29772994
tags question: http://stackoverflow.com/q/29763285
tags question: http://stackoverflow.com/q/29731451
tags question: http://stackoverflow.com/q/29701075
tags question: http://stackoverflow.com/q/29688345
tags question: http://stackoverflow.com/q/29762886
tags question: http://stackoverflow.com/q/29725712
tags question: http://stackoverflow.com/q/29814227
tags question: http://stackoverflow.com/q/29721044
tags question: http://stackoverflow.com/q/29731688
tags question: http://stackoverflow.com/q/29704596
tags question: http://stackoverflow.com/q/29781327
tags question: http://stackoverflow.com/q/29798182
tags question: http://stackoverflow.com/q/29758498
tags question: http://stackoverflow.com/q/29825229
tags question: http://stackoverflow.com/q/29783391
tags question: http://stackoverflow.com/q/29762748
tags question: http://stackoverflow.com/q/29780571
tags question: http://stackoverflow.com/q/29762060
tags question: http://stackoverflow.com/q/29812021
tags question: http://stackoverflow.com/q/29798548
tags question: http://stackoverflow.com/q/29761107
tags question: http://stackoverflow.com/q/29779126
tags question: http://stackoverflow.com/q/29720389
tags question: http://stackoverflow.com/q/29798252
tags question: http://stackoverflow.com/q/29726902
tags question: http://stackoverflow.com/q/29799316
tags question: http://stackoverflow.com/q/29693531
tags question: http://stackoverflow.com/q/29790142
tags question: http://stackoverflow.com/q/29763062
tag name: dom
tags question: http://stackoverflow.com/q/29693127
tags question: http://stackoverflow.com/q/29759713
tags question: http://stackoverflow.com/q/29787964
tags question: http://stackoverflow.com/q/29803652
tags question: http://stackoverflow.com/q/29807535

http://stackoverflow.com/comment/47671649
type: AnswerComment
type: Comment
has text: Note: Running `({a:1} && {b:2})` in console returns only the second object. It's possible that you're really only listening to `this.operators`.
score: 1
comment on: http://stackoverflow.com/a/29769915

http://stackoverflow.com/q/29749070
linked to: http://stackoverflow.com/q/19429025
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47630439
has comment: http://stackoverflow.com/comment/47767499
has body: As i say in the question, what i'm trying to achieve is the equivalent of code like these in Angular only: jQuery way $(document).ready(function(){ var windowHeight = $(window).height(); var headerHeight = $('header').height(); var footerHeight = $('footer').height(); var contentHeight = $('.content').height(); var paginationHeight = $('.pagination').height(); var footerMarginTop = (windowHeight - headerHeight - footerHeight) - (contentHeight + paginationHeight); $('footer').on('content.loaded', function() { if(footerMarginTop &gt; 0) { $(this).css('margin-top', footerMarginTop + 'px'); } } }); On document ready i have to set the margin top of the footer based on the calculation of the height of other elements, after the content of the page is loaded. Thinking in jQuery is easy to do but in Angular only i didn't find other way except translating it directly like this, with a directory Angular way angular.module('myApp', []).directive('FooterMargin', ['$window', '$document', function($window, $document){ return { restrict: 'A', link: function(scope, element, attrs) { var windowHeight = $window.innerHeight; var headerHeight = $document[0].getElementById('header').offsetHeight; var footerHeight = $document[0].getElementById('footer').offsetHeight; var paginationHeight = $document[0].getElementById('pagination').offsetHeight; var contentHeight = $document[0].getElementById('content').offsetHeight; var footerMarginTop = (windowHeight - headerHeight - footerHeight) - (contentHeight + paginationHeight); scope.$on('content.loaded', function(){ if(footerMarginTop &gt; 0) { attrs.$set('style', 'margin-top: ' + footerMarginTop + 'px'); } } }); } }; }]); I've added IDs to my elements to retrieve them in Angular, but even if it's working it seems to me that it is not a good way to do this, and it is also hard to unit testing it. I can't use jQuery in this project and i've used Angular for other directive for events that are easier to get with it (like modals and dropdowns) in a …
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29929493
has comment: http://stackoverflow.com/comment/47630711
has comment: http://stackoverflow.com/comment/47639301
type: Question
possible better answer: http://stackoverflow.com/a/29928813
has answer: http://stackoverflow.com/a/29929493
upvote count: 5
has comment: http://stackoverflow.com/comment/47662111
tagged with: javascript
answer count: 2
score: 5
downvote count: 0
tagged with: jquery
has title: How can i set the margin of footer based on height of other elements, in Angular and no jQuery?
favorite count: 0
has answer: http://stackoverflow.com/a/29928813

http://stackoverflow.com/q/29706898
has comment: http://stackoverflow.com/comment/48622907
upvote count: 1
tagged with: squarespace
answer count: 1
has comment: http://stackoverflow.com/comment/47549633
has comment: http://stackoverflow.com/comment/47554096
has title: Is there a secure way to store a password across pages on the client side?
favorite count: 0
has comment: http://stackoverflow.com/comment/47550034
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47551626
tagged with: web-storage
downvote count: 0
score: 1
has body: I have a form that via AJAX validates login credentials from an external php script and database. I am attempting to password protect pages of a Squarespace website. I am wondering if there is a way to securely store some kind of token returned when the user logs in using the login form that can be checked on each page the user attempts to access and redirects them or allows the to stay on the page based on if they successfully logged in. I have looked into using cookies, web storage/local storage, window.name and several other methods that other people have used but none actually seem secure and I am not able to use php. Is there a secure way to do this?
has comment: http://stackoverflow.com/comment/47553555
type: Question
has comment: http://stackoverflow.com/comment/47550587
tagged with: javascript
has answer: http://stackoverflow.com/a/29707459
tagged with: ajax
tagged with: security

http://stackoverflow.com/comment/47528660
has text: Thanks alot , i am just curious , is ur definition of infer = "to find out" ??
type: Comment
comment on: http://stackoverflow.com/a/29696273
score: 0
type: AnswerComment

http://stackoverflow.com/comment/48033829
comment on: http://stackoverflow.com/a/29721373
has text: Oh, I see, but as I've said, that's an issue with JSFiddle, it'll work properly on any other page. That's because JSFiddle loads the HTML/JS only on that section, and therefore the code thinks that this section is the whole window. That would happen as well with any other focus detection code. It can happen as well if you're loading the script on an , but I don't think there's a solution for that else than loading the script out of the
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47643688
type: QuestionComment
has text: Does `document.getElementsByTagName('body')[0].innerHTML.indexOf('Hello World')` accomplish what you want??
comment on: http://stackoverflow.com/q/29755686
score: 1
type: Comment

http://stackoverflow.com/comment/54638234
has text: $cookieStore has been deprecated in favor of $cookie
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29749492
type: Comment

http://stackoverflow.com/q/29782419
has comment: http://stackoverflow.com/comment/47695114
upvote count: 1
has comment: http://stackoverflow.com/comment/47694861
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47694927
answer count: 0
downvote count: 0
type: UnansweredQuestion
type: Question
score: 1
has comment: http://stackoverflow.com/comment/47696394
has body: I have this code that displays a regular clock and an octal clock by ID. It works if I just have 1 of each clock on a page (just use each ID once), but if I have more than 1 of each clock (use each ID more than once) then the latter clocks won't work. What might be inhibiting the latter clocks from working? JS: function checkTime(i) { 'use strict'; if (i &lt; 10) { i = "0" + i; } return i; } function a() { 'use strict'; var oct = ["0", "1", "2", "3", "4", "5", "6", "7"], octtime, oct1, oct2, oct3, oct4, oct5, oct6, octvalue, point = ".", now = new Date(), hours = now.getHours(), minutes = now.getMinutes(), seconds = now.getSeconds(), h = checkTime(hours), m = checkTime(minutes), s = checkTime(seconds), totsecs = [hours * 3600 + minutes * 60 + seconds + (now.getTime() % 1000) / 1000]; octtime = Math.floor(totsecs / (86400 / 262144)); oct1 = Math.floor(octtime / 32768); octtime -= 32768 * oct1; oct2 = Math.floor(octtime / 4096); octtime -= 4096 * oct2; oct3 = Math.floor(octtime / 512); octtime -= 512 * oct3; oct4 = Math.floor(octtime / 64); octtime -= 64 * oct4; oct5 = Math.floor(octtime / 8); octtime -= 8 * oct5; oct6 = octtime; octvalue = point + oct[oct1] + oct[oct2] + oct[oct3] + oct[oct4] + oct[oct5] + oct[oct6]; document.getElementById('j').innerHTML = h + ":" + m + ":" + s; document.getElementById('k').innerHTML = octvalue; window.setTimeout(a); } window.onload = a; Test page: http://www.gloryhood.com/articles/zztest.html
has title: JS Onload Works In One Instance But Not Another

http://stackoverflow.com/q/29709874
has comment: http://stackoverflow.com/comment/47555419
has comment: http://stackoverflow.com/comment/47628726
has comment: http://stackoverflow.com/comment/47636584
has comment: http://stackoverflow.com/comment/47555392
has body: I have some code that works locally but when I put it up live, it causes an error. Not just an error, but the page doesn't load and I get a huge error page that states: '/Clients/CMCDFMIS/gateway.htm?p=Dallas' is not a valid virtual path. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: '/Clients/CMCDFMIS/gateway.htm?p=Dallas' is not a valid virtual path. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [HttpException (0x80004005): '/Clients/CMCDFMIS/gateway.htm?p=Dallas' is not a valid virtual path.] System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options) +8877083 System.Web.VirtualPath.Create(String virtualPath) +9 System.Web.UI.PageParser.GetCompiledPageInstance(String virtualPath, String inputFile, HttpContext context) +163 AtgHttpHandler.AtgHttpHandler.ProcessRequest(HttpContext context) +804 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +75 Version Information: Microsoft .NET Framework Version:2.0.50727.4062; ASP.NET Version:2.0.50727.5692 HTML: &lt;a href="../gateway.htm?p=Dallas"&gt; What I am doing with it is in JavaScript: urlExtract = location.search foundExtract = urlExtract.split("=")[1]; if(foundExtract == "Dallas"){ //do something } else if(foundExtract == "Legacy"){ //do something } I don't think it is really getting to the JavaScript though. I have used this urlextract code on another site years and years ago so I am not sure why in this case it is giving me problems?
has comment: http://stackoverflow.com/comment/47634484
type: Question
has comment: http://stackoverflow.com/comment/47637405
has comment: http://stackoverflow.com/comment/47636998
tagged with: javascript
has comment: http://stackoverflow.com/comment/47628860
score: 0
has comment: http://stackoverflow.com/comment/47555461
has comment: http://stackoverflow.com/comment/47555722
answer count: 0
has comment: http://stackoverflow.com/comment/47638074
type: UnansweredQuestion
tagged with: iis
has comment: http://stackoverflow.com/comment/47637943
has title: What is causing this link to error saying "is not a valid virtual path"?
has comment: http://stackoverflow.com/comment/47628532

http://stackoverflow.com/q/29838183
has title: Meteor.call Callback Function Returns Undefined
downvote count: 0
tagged with: meteor
accepted answer: http://stackoverflow.com/a/29841796
favorite count: 0
tagged with: node.js
type: AnsweredQuestion
upvote count: 3
has answer: http://stackoverflow.com/a/29838747
type: Question
tagged with: mongodb
score: 3
possible better answer: http://stackoverflow.com/a/29838747
has answer: http://stackoverflow.com/a/29857247
tagged with: javascript
has body: I have this code on the client: var Checklist = { title: this.title, belongs_to: this.belongs_to, type: this.type, items: this.items }; Meteor.call( 'create_checklist', Checklist, function(error,result){ console.log('error',error,'result',result); // if(!error) { // Router.go('/checklist/'+response); // } } ); And this on the server: create_checklist: function(Checklist) { Checklists.insert( { title: Checklist.title, belongs_to: Checklist.belongs_to, type: Checklist.type, items: Checklist.items }, function(error,id){ console.log(error,id); if(id) { return id; } else { return error; } } ); }, The Meteor.call passes the information successfully to the server, as the checklist is created. I can see in the server console the ID of the new checklist. However, the client only sees undefined for both error and result.
has answer: http://stackoverflow.com/a/29841796
answer count: 3

http://stackoverflow.com/q/29770185
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I have been working on a project, and in the project, I've decided to make a mobile version of the website. What I want to do is to set a cookie that temporarily (for 20 min) "disables" a welcome message that will be viewed when the page loads. The problem with the cookie is that it's not working on either Chrome or Opera, but it works on Firefox. I don't know what the problem is. Can someone please point me in the right direction? I'm kind of new to web development. Here's the code: Welcome function: function welcome1 () { $('.message').each(function(i) { $(this).delay((i++) * 2000).fadeTo(700, 1); $(this).delay(1400).fadeOut(300); }), setTimeout(function() { $('.solar-body').each(function(i) { $(this).delay((i++) * 200).fadeTo(400, 1); }) }, 5000); } Cookie: // c_name = cookie name // c_value = cookie value // ex_min = expiration in minutes function setCookie(c_name, c_value, ex_min) { var d = new Date(); d.setTime(d.getTime() + (ex_min * 60 * 1000)); var expires = "expires="+d.toUTCString(); document.cookie = c_name + "=" + c_value + "; " + expires; } OnLoad Function: function welcomeMessage() { var lastVisitedCookieName = 'last-visited'; if (!document.cookie.contains(lastVisitedCookieName)) { welcome1(); setCookie(lastVisitedCookieName, "1", 20); } else if (document.cookie.contains(lastVisitedCookieName)) { setTimeout(function() { $('.solar-body').each(function(i) { $(this).delay((i++) * 200).fadeTo(400, 1); }) }, 500); } } Any help is appreciated.
accepted answer: http://stackoverflow.com/a/29770568
upvote count: 1
answer count: 1
tagged with: cookies
has answer: http://stackoverflow.com/a/29770568
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
has title: Cookies only working in Firefox

http://stackoverflow.com/comment/47561586
type: Comment
type: QuestionComment
has text: This is unclear. In your first sentence "in facebook people can directly open links without switching to safari." Why would someone switch browsers? Are you using a facebook app on a mobile device? And if so which one? And what do you mean by "app-wrapped browser"?
comment on: http://stackoverflow.com/q/29713070
score: 0

http://stackoverflow.com/comment/47821659
score: 0
has text: `if(response === 'success'){ alert('Yay!'); }` ? or `if(response === 'category'){ alert('Yay!'); }` ?
type: Comment
comment on: http://stackoverflow.com/a/29846421
type: AnswerComment

http://stackoverflow.com/q/29807700
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 0
type: UnansweredQuestion
type: Question
has body: My tooltip is in the outside of my container, I can see that my tooltip cut. I want to make my tooltip to be outside of the container, so that it would be totally visible. I tried to change the z-index, overflow, and etc. However, nothing happens. I need your help please! Jsfiddle Example $('[data-toggle="tooltip"]').tooltip() $(".nano").nanoScroller(); /** initial setup **/ .nano { position : relative; width : 200px; height : 150px; overflow : hidden; } .action{ width:100%; height:35px } .nano > .nano-content { position : absolute; overflow : scroll; overflow-x : hidden; top : 0; right : 0; bottom : 0; left : 0; border : 1px solid red; } .nano > .nano-content:focus { outline: thin dotted; } .nano > .nano-content::-webkit-scrollbar { display: none; } .has-scrollbar > .nano-content::-webkit-scrollbar { display: block; } .nano > .nano-pane { background : rgba(0,0,0,.25); position : absolute; width : 10px; right : 0; top : 0; bottom : 0; visibility : hidden\9; /* Target only IE7 and IE8 with this hack */ opacity : .01; -webkit-transition : .2s; -moz-transition : .2s; -o-transition : .2s; transition : .2s; -moz-border-radius : 5px; -webkit-border-radius : 5px; border-radius : 5px; } .nano > .nano-pane > .nano-slider { background: #444; background: rgba(0,0,0,.5); position : relative; margin : 0 1px; -moz-border-radius : 3px; -webkit-border-radius : 3px; border-radius : 3px; } .nano:hover > .nano-pane, .nano-pane.active, .nano-pane.flashed { visibility : visible\9; /* Target only IE7 and IE8 with this hack */ opacity : 0.99; } aaaaaaa bbbbbbb ccccccc vvvvvvvv ddddddd aaaaaaa eeeeeeeee wwwwww eeerr errrrtte
has title: tooltip is outside my div
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29807929

http://stackoverflow.com/q/29735690
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47632937
has answer: http://stackoverflow.com/a/29760422
downvote count: 2
has comment: http://stackoverflow.com/comment/47605929
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29760422
has title: How to change content of via JQuery?
has comment: http://stackoverflow.com/comment/47651839
has body: I wonder how I could change the content of this Leaflet code, Im trying to update those L.markers after a search, like <?php include 'conexion.php'; $q=$_POST[q]; $con=conexion(); $sql="select * from pdi where name LIKE '".$q."%'"; $res=mysql_query($sql,$con); if(mysql_num_rows($res)==0){ echo 'No hay sugerencias'; }else{ echo 'Sugerencias: '; while($fila=mysql_fetch_array($res)){ echo ' '.$fila['cat'].' '.$fila['name'].' '.$fila['dir'].' Más...'; } } ?> First, I dont know if I got to use JQuery's text() or html().
has comment: http://stackoverflow.com/comment/47605281
has comment: http://stackoverflow.com/comment/47604632
upvote count: 0
score: -2

http://stackoverflow.com/q/29821854
has comment: http://stackoverflow.com/comment/47769939
favorite count: 0
has answer: http://stackoverflow.com/a/29822233
has comment: http://stackoverflow.com/comment/47770473
has comment: http://stackoverflow.com/comment/47770275
has answer: http://stackoverflow.com/a/29822125
accepted answer: http://stackoverflow.com/a/29822125
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29822621
has title: JavaScript/jQuery trouble with making a trigger
downvote count: 0
has answer: http://stackoverflow.com/a/29822328
score: 1
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 1
has body: So, I simply want to trigger an element from it's position to another when I click on a button. Then, if I click the button again, I want it to go back where it was. I have this code. $(document).ready(function() { $('.trigger').click(function() { $('.trigger').toggle( function() { $('.mod').css({'margin-left':'0px'}); }, function() { $('.mod').css({'margin-left':'-100px'}); } ); }); }); When I press the button the element does what I want. But the button disappears. And I am not quite sure, that the element will be triggered back. Now I just want a working code that can do the job.
possible better answer: http://stackoverflow.com/a/29822233

http://stackoverflow.com/q/29763483
tagged with: mysql
has body: Trying to get info from a database based on a click event and load the data into variables to be used later in the form. This is part of the code. A connection to reps table has been made using PDO:: function fill_contact(evt) //display click event { var country_id = evt.target.id document.getElementById('country_name').firstChild.data = country_id <?php $country = $_GET['country_name']; try { // Establish server connection and select database $dbh = new PDO("mysql:host=$host;dbname=$database", $user, $password); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(PDOException $e){ die("Sorry, we could not connect you to this database, please contact the Administrator to sort this out.". $e->getMessage());/** try open contact form here**/ } /** run prepare to select records **/ $stmt = $dbh->prepare("SELECT firstname, lastname, email, photo FROM reps WHERE country = :country"); $stmt->bindParam(':country', $country, PDO::PARAM_STR); $stmt->execute(); ?> Country: Regional Representative: $firtname $lastname Photo: email form here email address is $email <svg id="map" version="1.1" rest of svg code This goes with my other question about svg. (displaying data from sql from clicking on svg map) Once i click on a svg, it populates variables used to display data about country clicked. The variables are also used to populate a contact form. It does not want to populate the table?
has answer: http://stackoverflow.com/a/29763570
has title: pdo call to fill variables to use later
answer count: 2
tagged with: javascript
linked to: http://stackoverflow.com/q/29714789
tagged with: pdo
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/47782390
has comment: http://stackoverflow.com/comment/47658680
score: 0
has answer: http://stackoverflow.com/a/29828150
type: UnansweredQuestion
tagged with: php
type: Question

http://stackoverflow.com/comment/47810754
type: Comment
comment on: http://stackoverflow.com/a/29841723
has text: Thanks for reply! I used your code in my page, but it did not solved the problem. If you can tell me exactly how to use this method. Give some example. Thank you!
type: AnswerComment
score: 0

http://stackoverflow.com/q/29766119
type: UnansweredQuestion
tagged with: node.js
has title: Using reflection in javascript to get a name of a test function on failure
linked to: http://stackoverflow.com/q/9795773
tagged with: reflection
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29770046
tagged with: async.js
tagged with: javascript
tagged with: mocha.js
downvote count: 0
answer count: 1
has body: How can we determine the name of variable function that was called? I have a function that acts as a test utility function to setup my test cases. Depending on the parameters passed by the test to the test utility function, certain sub-functions may or may not be executed. Sometimes these sub-functions fail and I need to know which one failed, but am not sure how to do this. In other languages, reflexion is what I would use here. Is that an option? Here's an abstracted example of what we're doing: exports.test_util_func = function(params, callback){ //initialize the functions var a = function(callback){ ... //response might be "{status:400, body: {error: {...} } }" callback(error, response); } var b = function(callback){ ... callback(error, response); } //determine what functions to run var functions_to_run = []; if(params.a) functions_to_run.push(a); if(params.b) functions_to_run.push(a); async.series(functions, function(error, responses){ if(error) throw new Error(error); for(var i in responses){(function(response){ //verify that we received a 200 success status from the server //if we didn't, capture the error if(response.status!==200){ console.log(response.body); console.log(i); //HELP NEEDED HERE - how do we capture better than the function iteration so we know what actually failed? Ideally, we would have: "reflective call() throw new Error(i+": "+JSON.stringify(response.body)); } })(responses[i]);} }) } Edit: there might be something in this following post that we can use, but I imagine there must be some easier way by using the __prototype info: Get variable name. javascript "reflection"
favorite count: 0

http://stackoverflow.com/q/29748813
has comment: http://stackoverflow.com/comment/47631322
tagged with: javascript
tagged with: jquery
score: 0
has title: How javascript detects where the function is defined, top/bottom?
tagged with: ajax
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29750487
has body: I have the below code is working as long as I load the employee section and its scripts as part of the index.html index.html Working Demo Employee Details loaded as usual and sript is executing able to see alert Script.js var empModule = (function (empModule) { var Years = null; $(document).ready(function () { var empdata = { Name: 'Billa' } var myVM = new empModule.viewModel(empdata); }); empModule.viewModel = function (data) { var that = this; that.Name = data.Name; alert(that.Name); }; return { empModule: empModule } } (empModule || {})); Error Scenario: We decide to move employee related section based on some condition. Hence we are loading this section and section related script(emp.js) via Ajax. But now it is throwing the error empModule.viewModel is not a constructor. Why is it so? If I move the document.ready section at the bottom like the below order, it is working Emp.js(moved from script.js to emp.js and load via ajax( var empModule = (function (empModule) { var Years = null; // Code not working when we load this script file using Ajax. // But works if we move this document.ready at bottom //$(document).ready(function () { // var empdata = { Name: 'Billa' } // var myVM = new empModule.viewModel(empdata); //}); empModule.viewModel = function (data) { var that = this; that.Name = data.Name; alert(that.Name); }; //Working only if I keep the ready section here $(document).ready(function () { var empdata = { Name: 'Billa' } var myVM = new empModule.viewModel(empdata); }); return { empModule: empModule } } (empModule || {})); The function empModule will get executed automatically as it is self executing function. When it is executing it needs to prepare a empModule.viewModel object, but failed to do that when viewModel definition is located after document.ready (caller). This happens only when I load this script via Ajax, but works if I pre load it in a page
has comment: http://stackoverflow.com/comment/47630376
has comment: http://stackoverflow.com/comment/47630252
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29749124

http://stackoverflow.com/comment/47942941
comment on: http://stackoverflow.com/q/29818811
score: 0
type: Comment
type: QuestionComment
has text: @serg10: why dont you put this question on their github as an issue, may be they will come up with something..

http://stackoverflow.com/a/29821413
answers question: http://stackoverflow.com/q/29821057
downvote count: 0
has body: The solution is pretty simple: remove the recursion. You can aswell use a stack and push the nodes to the stack instead of a recursive call. pseudocode: stack nodes//create a new stack add(nodes , startNode)//initialize the stack with the first node while ! isEmpty(nodes)//still nodes available that haven't been processed node p = peek(nodes) if ! nodeInArray(p) OR getColor(p) == 1 //this node has already been visited or is not in the array //continue with the next node in the stack pop(nodes) continue color(p , 1)//mark the node as visited push(nodes , node(x(p) - 1 , y(p))//add node to be processed in the future ...//push all other neighbours to the stack
has comment: http://stackoverflow.com/comment/47769597
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47769764
has comment: http://stackoverflow.com/comment/47771870
type: Answer
accepted answer of: http://stackoverflow.com/q/29821057
score: 2

http://stackoverflow.com/a/29723821
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29722100
has body: Maybe you want to use some more advanced data structure that allows easier adding and dropping of elements. If that is your struggle (?) :) Potentially some linked List

http://stackoverflow.com/comment/47624452
has text: Could you create a fiddle ? That will be easy to check and get us back to you soon :)
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29746118
type: Comment

file-put-contents
type: Tag
tag name: file-put-contents
tags question: http://stackoverflow.com/q/29801246

http://stackoverflow.com/comment/83740452
has text: @MannVerma why would you want to use such an old version? The current version is 3.3. What exactly is not working for you?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29770676
type: Comment

http://stackoverflow.com/comment/47694374
type: QuestionComment
has text: Keep in mind that `twitter-bootstrap` requires jQuery, and I notice you only use Javascript here. You might have it included, but I figured I'd add this note just in case.
comment on: http://stackoverflow.com/q/29776760
score: 0
type: Comment

http://stackoverflow.com/comment/47720595
type: Comment
comment on: http://stackoverflow.com/a/29795185
type: AnswerComment
score: 0
has text: So do you want pass a JavaScript variable to the PHP Session variable ?

key
tags question: http://stackoverflow.com/q/29732916
type: Tag
tag name: key
tags question: http://stackoverflow.com/q/29730000
tags question: http://stackoverflow.com/q/29723117
tags question: http://stackoverflow.com/q/29730570

http://stackoverflow.com/a/54017692
score: 0
has body: your syntax is wrong, but the idea is right. Better yet try it this way. using a string literal. wrap the i like this --> ${i} for example: &lt;center&gt; &lt;img src="${i.url}"&gt; &lt;/center&gt; using string literal quotes allows you to interpolate values wrapped with dollar sign and braces instead of plus signs all over the place.
type: Answer
answers question: http://stackoverflow.com/q/29800556

http://stackoverflow.com/comment/47572449
score: 0
type: Comment
type: QuestionComment
has text: @RobertoNovelo .Nope.I see no errors
comment on: http://stackoverflow.com/q/29718849

http://stackoverflow.com/comment/47599493
comment on: http://stackoverflow.com/a/29733050
score: 0
type: AnswerComment
type: Comment
has text: Nah didn't mean to call you out or anything. Just generally wondered.

http://stackoverflow.com/comment/47709174
has text: @MichaelHampton - that's a huge stretch to say. For one, it's not worth it to spend time designing your web site to offer all functionality without Javascript. It's such a rare situation these days, that it's a poor use of resources to design for it when you can offer a richer experience by using Javascript. Try using either GMail or Yahoo Mail without Javascript. At best, you get a reduced set of features.
score: 1
comment on: http://stackoverflow.com/a/29787408
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29813788
has answer: http://stackoverflow.com/a/29813863
score: 2
type: AnsweredQuestion
has body: How can I increase numeric values in a element using jquery? I tried the following but no luck. I have a button with the id="#increaseNum", and am trying to change the td cell value with its click. html: 1 5 10 js: $(document).ready(function() { $("#increaseNum").click(function() { $("#num").html(Number(("#num").innerText) + 1); }); }); This only makes the first value disappear. Any suggestions?
possible better answer: http://stackoverflow.com/a/29813812
has answer: http://stackoverflow.com/a/29813812
type: Question
has title: Change numeric value in td with jquery
has answer: http://stackoverflow.com/a/29813884
accepted answer: http://stackoverflow.com/a/29813863
has comment: http://stackoverflow.com/comment/47755174
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29813889
has answer: http://stackoverflow.com/a/29813820
tagged with: html-table
has answer: http://stackoverflow.com/a/29813916
downvote count: 0
answer count: 7
has answer: http://stackoverflow.com/a/29813860
has comment: http://stackoverflow.com/comment/47755190
favorite count: 0
has comment: http://stackoverflow.com/comment/47755156
has comment: http://stackoverflow.com/comment/47755198
upvote count: 2
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47602200
type: AnswerComment
comment on: http://stackoverflow.com/a/29734205
type: Comment
score: 1
has text: thx that worked, the issure was that the links position was not set. I had to change it to relative so that it would continue with the page flow relative with the surrounding elements. bump my question plz! +1

http://stackoverflow.com/comment/47633194
score: 0
has text: That is my goal, but I am here asking, because I lack the knowledge to do so. Do I have to disable one somehow while using the other?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29750338

http://stackoverflow.com/q/29778099
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47686727
has body: When looking into tutorials and resources for WebAudio Api there is never a mention of what files I should have in my directories to run it. I'm using WebStrom hoping to use it with javascript I am working on, and the functions mentioned in any of the tutorials always are unresolved as there are no files for them to reference. Where can I find the files for WebAudio Api?
accepted answer: http://stackoverflow.com/a/29778324
has comment: http://stackoverflow.com/comment/47687304
upvote count: 1
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29778324
has comment: http://stackoverflow.com/comment/47703309
favorite count: 0
has title: Installing WebAudio API
score: 0
downvote count: 1
tagged with: web-audio-api
type: Question

http://stackoverflow.com/a/29766490
type: Answer
has body: Simply replace with Create Image
upvote count: 5
has comment: http://stackoverflow.com/comment/47664979
score: 5
accepted answer of: http://stackoverflow.com/q/29766407
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29766407

http://stackoverflow.com/comment/47549185
type: QuestionComment
has text: Phono.js and Signalr
comment on: http://stackoverflow.com/q/29706738
score: 0
type: Comment

http://stackoverflow.com/q/29731796
favorite count: 0
has body: I have been studying some of the videos for angularjs. While trying to apply filter to a list of bookmark category my main content simply doesn't loads. I have not implemented view as of now. And I would like my code to be without views for a moment. The filter line is problematic as when I remove the curly braces around. The bookmark lists does shows up but the filtering still not works ! Please let me know what is the correction which needs to be done ? Here is my code for INDEX.HTML &lt;!doctype html&gt; &lt;html ng-app="Eggly"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;meta name="viewport" content="width=device-width"&gt; &lt;title&gt;Eggly&lt;/title&gt; &lt;link rel="stylesheet" href="assets/css/normalize.css"&gt; &lt;link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"&gt; &lt;link rel="stylesheet" href="assets/css/eggly.css"&gt; &lt;link rel="stylesheet" href="assets/css/animations.css"&gt; &lt;/head&gt; &lt;body ng-controller='MainCtrl'&gt; &lt;div class="container-fluid"&gt; &lt;div class="row"&gt; &lt;div class="col-sm-3 col-md-2 sidebar"&gt; &lt;a href="#"&gt;&lt;img class="logo" src="assets/img/eggly-logo.png"&gt;&lt;/a&gt; &lt;ul class="nav nav-sidebar"&gt; &lt;li ng-repeat="category in categories"&gt; &lt;a href="#" ng-click="setCurrentCategory(category)"&gt;{{category.name}}&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main"&gt; &lt;div ng-repeat="bookmark in bookmarks | filter:{category:currentCategory.name}"&gt; &lt;button type="button" class="close"&gt;&amp;times;&lt;/button&gt; &lt;button type="button" class="btn btn-link"&gt;&lt;span class="glyphicon glyphicon-pencil"&gt;&lt;/span&gt;&lt;/button&gt; &lt;a href="{{bookmark.url}}" target="_blank"&gt;{{bookmark.title}}&lt;/a&gt; &lt;/div&gt; &lt;hr/&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"&gt;&lt;/…
tagged with: angularjs
has answer: http://stackoverflow.com/a/29732725
accepted answer: http://stackoverflow.com/a/29732725
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47596916
score: 0
upvote count: 1
downvote count: 1
type: Question
has title: Filters not working - Angularjs
tagged with: javascript
has comment: http://stackoverflow.com/comment/47597398
tagged with: angularjs-filter
answer count: 1

http://stackoverflow.com/a/29791038
answers question: http://stackoverflow.com/q/29790933
score: 6
has body: Answer to the updated question: Your update to the question completely changes it. The new code will indeed recurse forever: var counter = 0; function a() { snippet.log(counter); if (++counter &lt; 10) { // To avoid recursing forever a(); } } var a2 = new a(); &lt;!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 --&gt; &lt;script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"&gt;&lt;/script&gt; Answer to the original question: Recursion is not happening? Can anyone point out why? function a() { console.log("xx"); console.log(this); Object.getPrototypeOf(this).constructor(); //Isn't this a recursive call? } var a2 = new a(); It is a recursive call, but the recursion stops after just one recursive call because this line: Object.getPrototypeOf(this).constructor(); ...calls a with this set to the global object (because you're using loose mode*), not set to the instance. So on the next call, Object.getPrototypeOf(this) returns Object.prototype, and calls Object(). If you changed it to Object.getPrototypeOf(this).constructor.call(this); then it would recurse forever (so I've added a counter to the following so it doesn't do that), because we're calling constructor and setting this to be the same as the current this, so the next call will use a again, and again, and again... var counter = 0; function a() { snippet.log(counter); if (++counter &lt; 10) { Object.getPrototypeOf(this).constructor.call(this); } } var a2 = new a(); &lt;!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 --&gt; &lt;script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"&gt;&lt;/script&gt; * "because you're using loose mode" - I know this because if you were using strict mode, this would be undefined, and Object.getPrototypeOf(undefined) would throw an error. Side note: I don't think it's the point of your question (at all), but: You can't really rely on the constructor propert…
downvote count: 0
upvote count: 6
type: Answer

http://stackoverflow.com/q/29699871
has answer: http://stackoverflow.com/a/29700442
type: Question
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/47536537
score: 0
linked to: http://stackoverflow.com/q/14679113
has comment: http://stackoverflow.com/comment/47537745
tagged with: regex
has comment: http://stackoverflow.com/comment/47536201
has comment: http://stackoverflow.com/comment/47535771
has body: I need to extract parameter name from the url path. parameters are inside {} or follow the first ?(questionmark) or follow &amp; mark in the url. the url path need to be extracted is in such format : /tt/{pa}/{pb}/?p1=9888&amp;p2=9&amp;p3=98 thus the parameters are pa, pb,p1,p1,p3
has answer: http://stackoverflow.com/a/29700528
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47536137
has title: how to extract parameter(specified pattern string) from string in javascript

http://stackoverflow.com/q/29811008
has answer: http://stackoverflow.com/a/29811369
has comment: http://stackoverflow.com/comment/47751123
has comment: http://stackoverflow.com/comment/47755213
has comment: http://stackoverflow.com/comment/47749981
has body: I am a JavaScript and jQuery newby and have some issues with page scroll being directed from different page. The work is being done in WordPress PHP. I am currently using page-scroll where the href=#id and I changed it to href=/#id where the slash allows for the directing properly. The issue is if I am on the current page of home. the forward slash now jumps rather than page-scrolls. My thinking is leave the href=#id without the slash and have it check if the current url != to home, then append a forward slash to href. Help is genuinely appreciated! This allows for page scroll from current page and doesn't direct from Pricing & Services page How It Works Adding the "/" allows for directing from Pricing& Services page however it jumps if I am on the homepage. I want it to jump if I am not on the homepage. I would like for it to smooth scroll on current page. About Us Page I am directing from. Pricing & Services This is the javascript code I am using which requires the Jquery Easing plugin $(function() { $('a.page-scroll').bind('click', function(event) { var $anchor = $(this); $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top-50 }, 1500, 'easeInOutExpo'); event.preventDefault(); }); });
has title: How do I check if the current url or path is equal to a certain link and if not, append a forward slash to the href in the nav bar?
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29811097
score: 0
answer count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29813886

http://stackoverflow.com/comment/47713531
score: 0
has text: @RokoC.Buljan probably you are right. Hard to create a demo on fiddle, but I will give it a try. I hoped that someone had done something similar and can spot the problem in my X equation.
comment on: http://stackoverflow.com/q/29792199
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29759165
has body: To do this you need to set up some kind of a relationship between the polygons and the anchors. IMHO the design I've chosen to show in this answer is far from good, however it displays very well how the relationship works. I have created an object with key - value pairs consisting of key being the ID of the polygon and the value being the ID of the anchor that is supposed to get highlighted. Loop through all elements in the object and add event handlers ( define additional add and remove to save insignificant amounts of ram ). $(document).ready(function(){ var relations = { mmAoa100: "pl100aoa", mmHudson10: "pl1hudson", ... } function add(){ var elem = this.relationKey ? $("#" + relations[this.relationKey]) : $(this); elem.addClass("hover"); } function remove() { var elem = this.relationKey ? $("#" + relations[this.relationKey]) : $(this); elem.removeClass("hover"); } $.each(relations, function(k, v){ $("#" + k).hover(add, remove)[0].relationKey = k; $("#" + v).hover(add, remove); }); }); Updated FIDDLE *Note I have only set up two relations.
answers question: http://stackoverflow.com/q/29758746
score: 0
type: Answer

http://stackoverflow.com/q/29796496
has comment: http://stackoverflow.com/comment/47721358
has body: I have created a datatable with first column as checkbox for each row and I was doing an Ajax call while on successing I was trying to check the checkbox but it was checking only for the first page not for other pages. Below is my code, please help me in that. $.ajax({ type: 'GET', url: '/PriceList/GetCheckedAccount/', data: { get_param: data1 }, dataType: 'json', success: function (response) { //alert("success"); for (var i = 0, len = response.aaData.length; i &lt; len; i++) { var id = response.aaData[i][1]; var chk = $(".chkBox" + id); chk.attr("checked", true); } } });
has comment: http://stackoverflow.com/comment/47722299
has comment: http://stackoverflow.com/comment/47721935
has comment: http://stackoverflow.com/comment/47724148
has comment: http://stackoverflow.com/comment/47725339
has answer: http://stackoverflow.com/a/42344859
type: Question
has comment: http://stackoverflow.com/comment/47723110
has answer: http://stackoverflow.com/a/29798211
answer count: 2
has comment: http://stackoverflow.com/comment/47722123
has comment: http://stackoverflow.com/comment/47725603
has title: How do I get a checkbox value in datatable while using Paging
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47722064
tagged with: ajax
has comment: http://stackoverflow.com/comment/47723845
has comment: http://stackoverflow.com/comment/47723999
score: 0
has comment: http://stackoverflow.com/comment/47722780
has comment: http://stackoverflow.com/comment/47722845
tagged with: checkbox
has comment: http://stackoverflow.com/comment/47723190
has comment: http://stackoverflow.com/comment/47723234
tagged with: datatable
has comment: http://stackoverflow.com/comment/47722440
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47721571

http://stackoverflow.com/q/29773970
type: Question
score: 2
has title: Socket.io is not working with my node/express application
has comment: http://stackoverflow.com/comment/47681481
has answer: http://stackoverflow.com/a/29785381
has comment: http://stackoverflow.com/comment/47680796
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: express
favorite count: 0
has comment: http://stackoverflow.com/comment/47678696
has body: I am using openshift with express and no matter what configuration I change socket.io to it breaks my application. What am I missing? I have commented out the sections that use socket.io and the app runs fine. When I uncomment socket.io everything goes wrong. I have tried changing the position of the code to accept the standard io.listen(app), but it still breaks. I have also tried numerous examples from the internet. Is this possible? //self.io.listen(self.app); if not what should I have socket.io listen to in the context of my app? I cannot call io.listen(server).. var express = require('express'); //etc // configuration mongoose.connect(configDB.url); // connect to our database require('./config/passport')(passport); var App = function(){ // Scope var self = this; // Setup self.dbServer = new mongodb.Server(process.env.OPENSHIFT_MONGODB_DB_HOST,parseInt(process.env.O PENSHIFT_MONGODB_DB_PORT)); self.db = new mongodb.Db(process.env.OPENSHIFT_APP_NAME, self.dbServer, {auto_reconnect: true}); self.dbUser = process.env.OPENSHIFT_MONGODB_DB_USERNAME; self.dbPass = process.env.OPENSHIFT_MONGODB_DB_PASSWORD; self.ipaddr = process.env.OPENSHIFT_NODEJS_IP; self.port = parseInt(process.env.OPENSHIFT_NODEJS_PORT) || 8080; if (typeof self.ipaddr === "undefined") { console.warn('No OPENSHIFT_NODEJS_IP environment variable'); }; // Web app urls self.app = express(); //self.io = require('socket.io'); //self.clients = []; /*self.io.sockets.on('connection', function (socket) { self.clients.push(socket); socket.emit('welcome', { message: 'Welcome!' }); // When socket disconnects, remove it from the list: socket.on('disconnect', function() { var index = self.clients.indexOf(socket); if (index != -1) { self.clients.splice(index, 1); } }); });*/ // set up our express application self.app.use(morgan('dev')); // log every request to the console self.app.use(cookieParser()); // read cookies (needed for auth) self.app.use(bodyParser.json()); // get information from html forms self.app.us…
tagged with: node.js
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47681695
tagged with: socket.io
tagged with: openshift

http://stackoverflow.com/comment/47641352
type: AnswerComment
comment on: http://stackoverflow.com/a/29734960
score: 0
type: Comment
has text: @AndreasH It shouId work! I suggest you to remove unnecessary lines from the config file, such as `<access launch-external="yes" origin="tel:*" />`. and check the log to capture any possible error. BTW, it doesn't work on simulators so you need to test it on the actual device.

http://stackoverflow.com/comment/47625169
type: Comment
comment on: http://stackoverflow.com/a/29742953
has text: Thanks for the information st.eve, but can you give simple example to know how to use them? Thank You for your reply...
score: 0
type: AnswerComment

http://stackoverflow.com/q/29765991
score: 1
possible better answer: http://stackoverflow.com/a/29766080
tagged with: mysql
has answer: http://stackoverflow.com/a/29766285
tagged with: javascript
favorite count: 0
has title: Search with * for redefine part of string
has answer: http://stackoverflow.com/a/29766087
has comment: http://stackoverflow.com/comment/47663802
answer count: 4
has comment: http://stackoverflow.com/comment/47663355
accepted answer: http://stackoverflow.com/a/29766285
upvote count: 3
downvote count: 2
tagged with: php
has answer: http://stackoverflow.com/a/29766080
has body: My question: I have a php search form in which I need the user to be able to redefine the search for only a part of the string. Example (so far the user enter): // Search Option name: 20081111-1 //which means that the date of the item is 2008-11-11 Now, I would like the user to make a search which it will only include all the items in 2008 (desired user search): // Search Option name: 2008* How can I make this option in my search? Then I can search in my database for this part of the string only. Thanks!
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29766122

http://stackoverflow.com/a/29776645
downvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29776616
type: Answer
answers question: http://stackoverflow.com/q/29776616
score: 1
upvote count: 1
has body: In the third row, you have closed the tbody. str = str + " B-Average "; change this to: str = str + " B-Average ";

http://stackoverflow.com/comment/47593320
type: QuestionComment
has text: save returned data somewhere, may be define a global object, AppData, have a property, data and everytym you call this ajax, just check that wthr AppData.data is having some value or not. If not, then call, else use that.
comment on: http://stackoverflow.com/q/29729804
score: 0
type: Comment

http://stackoverflow.com/q/29798185
has comment: http://stackoverflow.com/comment/47727942
answer count: 0
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/47728493
type: Question
linked to: http://stackoverflow.com/q/1713771
tagged with: firefox
has title: modifying the amount of bars of a visualizer depending of the zoom level
linked to: http://stackoverflow.com/q/995914
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47726085
has comment: http://stackoverflow.com/comment/47725986
score: 0
tagged with: web-audio-api
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47726223
has body: I have a visualizer on my website and I want to make it so that the amount of bars being displayed changes with the zoom level (the more zoomed out you are, the more bars there will be) is there a way to do detect the zoom level to do that? edit: here's the code that creates the visualizer: var canvas, ctx, source, context, analyser, fbc_array, bars, bar_x, bar_width, bar_height; function initVisualizer() { context = new AudioContext(); analyser = context.createAnalyser(); biquad = context.createBiquadFilter(); gainNode = context.createGain(); canvas = document.getElementById("visualizer"); ctx = canvas.getContext('2d'); ctx.fillStyle = "#3f3f3f"; analyser.smoothingTimeConstant = 0.8; biquad.frequency.value = 15000; gainNode.gain.value = 1; source = context.createMediaElementSource(Musique); source.connect(biquad); biquad.connect(gainNode); gainNode.connect(analyser); analyser.connect(context.destination); $("#frequencyNumber").html(biquad.frequency.value); $("#visualizerSensibilityNumber").html(analyser.smoothingTimeConstant); $("#gainNumber").html(gainNode.gain.value.toPrecision(3)); framelooper() } function framelooper() { window.requestAnimationFrame(framelooper); fbcArray = new Uint8Array(analyser.frequencyBinCount); analyser.getByteFrequencyData(fbcArray); ctx.clearRect(0, 0, canvas.width, canvas.height); bars = 50; for (i=0; i &lt; bars; i++) { bar_x = i * 6; bar_width = 5; bar_height = -(fbcArray[i] / 1.75); //6 //1.75 if (visualizerStyle == 1){ //Simple ctx.fillRect(bar_x, canvas.height, bar_width, bar_height); $("#visualizerStyleType").html("Simple"); } else if (visualizerStyle == 2) { //Reflection ctx.fillRect(bar_x, canvas.height/2, bar_width, bar_height/2); ctx.fillRect(bar_x, canvas.height/2, bar_width, -bar_height/2); $("#visualizerStyleType").html("Reflection"); } else { //Two-faced ctx.fillRect(0, bar_x, -bar_height, bar_width); ctx.fillRect(canvas.width, bar_x, bar_height, bar_width); $("#visualizerStyleType").html("Face to Face"); } } } I need to …

http://stackoverflow.com/a/29763862
score: 0
answers question: http://stackoverflow.com/q/29761194
type: Answer
has body: While you can get a hold of the DOM node of the select and find out the current value, I find it simpler to use component state for this. Something like this: var React = require('react/addons'); var App = React.createClass({ mixins: [React.addons.LinkedStateMixin], getInitialState: function () { return { option: 'a' }; }, handleClick: function () { alert(this.state.option); }, render: function () { return ( A B Get Selected Value ); } }); The LinkedStateMixin mixin makes sure that any changes to the select box will automatically sync that value to the components state. But also the other way around, you can update the state and LinkedStateMixin will make sure that the select box gets the new value.

dc.js
tag name: dc.js
tags question: http://stackoverflow.com/q/29708487
type: Tag

http://stackoverflow.com/comment/47727796
has text: @delgermurun: I do it but does not work for me; "couldn't connect to [roduction-db-d1.meteor.io:27017] couldn't connect to server roduction-db-d1.meteor.io:27017 " ; have you an example with mongodump??
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29780573
type: Comment

http://stackoverflow.com/comment/47722584
type: Comment
has text: Can you please just show me how? I browsed the web for 2 days, already tried all snippets, adjusted everything... "just trigger" sounds easier as it is
comment on: http://stackoverflow.com/a/29796536
type: AnswerComment
score: 0

http://stackoverflow.com/q/29744340
duplicate of: http://stackoverflow.com/q/13840429
has comment: http://stackoverflow.com/comment/47621305
tagged with: arrays
answer count: 1
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47621300
has title: Access JavaScript array object in PHP
type: UnansweredQuestion
tagged with: php
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29744411
has comment: http://stackoverflow.com/comment/47622275
linked to: http://stackoverflow.com/q/13840429
has body: I have a JSON data about 150 users, i have convert that into java script array, now what i want it to pass this array to PHP, So that i can perform further operations on this array. var JSONString = '[{'user_id' : "1", "user_name" : "abc", "email":"abc@gmail.com"}, {"user_id":"2", "user_name":"abc", "email":"abc2@gmail.com"}]' var JSONObject = JSON.parse(JSONString); for (var key in JSONObject) { if (JSONObject.hasOwnProperty(key)) { console.log(JSONObject[key]["user_id"] + ", " + JSONObject[key]["user_name"]); } } now what i need it to pass this array to PHP array variable , that will loop through and perform further operation. i have seen some solution that display it on html with JavaScript, but i don't need that. i need this array object in php array variable.
type: Question

http://stackoverflow.com/q/29754064
has comment: http://stackoverflow.com/comment/47640395
possible better answer: http://stackoverflow.com/a/29754414
type: Question
has comment: http://stackoverflow.com/comment/47640304
has answer: http://stackoverflow.com/a/29754472
tagged with: image
has comment: http://stackoverflow.com/comment/47640895
has answer: http://stackoverflow.com/a/29754450
downvote count: 4
answer count: 3
has comment: http://stackoverflow.com/comment/47641358
has comment: http://stackoverflow.com/comment/47641330
upvote count: 0
has body: The following is code that I found online from someone and used it in my own code: var image=new Array("/Users/ghanimbakhit/Desktop/HTML Project/images/rock.jpg", "/Users/ghanimbakhit/Desktop/HTML Project/images/rock2.jpg", "/Users/ghanimbakhit/Desktop/HTML Project/images/rock3.jpg"); var timeout={}; function stopIt(){ clearTimeout(timeout); } function changeimage(dvX){ var dvi=document.getElementById(dvX); if(!dvi.count || dvi.count == image.length ) dvi.count=0; dvi.src=image[dvi.count]; dvi.alt=image[dvi.count]; dvi.count=dvi.count+1; timeout=setTimeout('changeimage("'+dvX+'")',3500); } The following is the HTML code: &lt;body onload="changeimage('changer')"&gt; &lt;div style="position:absolute;top: 600px" &gt;&lt;img width="350" src="t1 alt="Rock Climbing" id="changer"/&gt;&lt;/div&gt; &lt;/body&gt; This code is used to automatically change between images every few seconds. I have changed the images to "rock", "rock2", and "rock3". I have 2 more images that I want to add. How can I do that without overriding the above code? I'm new to JavaScript. If you need anymore information, please notify me. I have to submit this in 3 hours. Thank you! UPDATE: I need the same function elsewhere for 2 different images separately aligned and placed in the HTML code. Meaning I want THIS function to work for other images in the webpage.
tagged with: javascript
tagged with: jquery
score: -4
has title: How to have 2 same functions in Javascript for 3 different images?
favorite count: 0
has comment: http://stackoverflow.com/comment/47641070
has comment: http://stackoverflow.com/comment/47640528
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/29754450
has answer: http://stackoverflow.com/a/29754414
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47644991

http://stackoverflow.com/q/29701803
score: 4
has title: How to scroll window without overflow
has comment: http://stackoverflow.com/comment/47539431
downvote count: 3
upvote count: 7
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
has answer: http://stackoverflow.com/a/29703264
favorite count: 0
has comment: http://stackoverflow.com/comment/47539620
type: UnansweredQuestion
has body: I need to scroll in a window but my window height is too small to scroll. Is it possible to scroll when the height of container is too small to see the scrollbar. Here is my code to scroll: setTimeout(function(){ $(window).scrollTop($(window).scrollTop()+1); $(window).scrollTop($(window).scrollTop()-1); }, 800); I need to scroll window or body even if height of it is less than 100px.
has answer: http://stackoverflow.com/a/29701924
has answer: http://stackoverflow.com/a/29702287
has answer: http://stackoverflow.com/a/29701832
type: Question
has comment: http://stackoverflow.com/comment/47539577
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29737874
linked to: http://stackoverflow.com/q/111102
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
type: UnansweredQuestion
has title: Javascript skipping to last function, ignoring others
has body: So I agreed to help a friend out with a little project of his. Making a simple game where people choose a tag line and then it loads another. I have the layout done, and some functionality, but it's all pretty broken. The issue started when I tried adding a third stage. Pretty sure I am hitting some kind of memory leak because everything started going haywire right away. My current iteration is trying to separate the functions, but admittedly, with only a basic js class under my belt I think I just don't know enough to make this work. I have a js fiddle here. You can see on load it jumps right to the 3rd stage and even that doesn't work correctly. I believe its coded to make the correct answer "Rock and Roll" flash green, but it still flashes red. function resetFrame1 (){ $('#leftSide, #rightSide, #leftImage, #rightImage, #leftText, #rightText').fadeToggle(750).delay(1).css("background-color", "transparent"); callback(); } function resetFrame2 (){ $('#leftSide, #rightSide, #leftImage, #rightImage, #leftText, #rightText').fadeToggle(750).delay(1).css("background-color", "transparent"); callback(); } function end(){ //right now undefined since I can't get this to work at all. } function stageOne(){ var score = 0; $('#leftText').text("Green Living. . . . . Easy!!!") $('#leftImage').html("&lt;img src=&gt;"); $('#rightText').text("Burn Your Tires!"); $('#rightImage').html("&lt;img src=&gt;"); $('html').keyup(function(e){ if (e.which==97 || e.which==65){ score++; $('#leftSide').css( "background-color", "green"); $('#leftSide').fadeToggle(1000).fadeToggle(2000).fadeToggle(1000).fadeToggle(2000, function(){ resetFrame1(); }); } else if (e.which==76 || e.which==108){ $('#rightSide').css( "background-color", "red"); $('#rightSide').fadeToggle(1000).fadeToggle(2000).fadeToggle(1000).fadeToggle(2000, function(){ resetFrame1(); }); } }); } function stageTwo(){ $('#leftText').text("Keep your lights on. It prevents home invasion.") $('#leftImage').html("&lt;img src=&gt;"); $('#rig…
has answer: http://stackoverflow.com/a/29737918
type: Question

http://stackoverflow.com/comment/47703022
has text: @Brett—factorial is the *Hello world* of recursive functions. You don't write it because it's useful, but because you can. ;-)
score: 5
comment on: http://stackoverflow.com/q/29786535
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29728037
has comment: http://stackoverflow.com/comment/47601232
tagged with: visualization
has body: I'm trying to create a chart which basically has a number of horizontal lines on it. The data for the lines is taken from the function that generates random arrays of objects like this: { "process": 2, "time": 5 } And also there is a setInterval function that redraws the chart every 3s. How can I make it change not that abruptly, but with easing and transitions? Here is my code below: html: Operating System Processes Model Enter the number of processes: utils.js: // Renders grid in the system of axes function renderGrid() { // Vertical lines for(var i = 5; i <= 50; i+=5) { vis.append('svg:path') .attr('d', lineGen( [ { "process": "0", "time": + i }, { "process": "50", "time": + i }, ] )) .attr('stroke', '#777') .attr('stroke-dasharray', "5,5") .attr('stroke-width', 1) .attr('fill', 'none'); // Horizontal lines vis.append('svg:path') .attr('d', lineGen( [ { "process": i, "time": "0" }, { "process": i, "time": "50" }, ] )) .attr('stroke', '#777') .attr('stroke-dasharray', "5,5") .attr('stroke-width', 1) .attr('fill', 'none'); }; } // Generate single line var lineGen = d3.svg.line() .x(function(d) { return xScale(d.time); }) .y(function(d) { return yScale(d.process); }) .interpolate("basis"); // Generate random color function getRandomColor() { var letters = '0123456789ABCDEF'.split(''); var color = '#'; for (var i = 0; i < 6; i++ ) { color += letters[Math.floor(Math.random() * 16)]; } return color; } // Generate random data array function getDataArray(count) { var array = []; for(var i = 0; i < count; ++i) { var proc = Math.round(Math.random() * (50 - 1)) + 1; var time1 = Math.round(Math.random() * (50 - 1)) + 1; var time2 = Math.round(Math.random() * (50 - 1)) + 1; var data = [ { "process": proc, "time": Math.max(time1, time2) }, { "process": proc, "time": Math.min(time1, time2) }, ]; array.push(data); } return array; } // Generate random data function renderProcesses() { vis.selectAll('.line-process').remove(); // var processCount = Math.round(Math.random() * (50 - …
has comment: http://stackoverflow.com/comment/47600064
has comment: http://stackoverflow.com/comment/47600358
answer count: 0
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47641051
has comment: http://stackoverflow.com/comment/47688458
has comment: http://stackoverflow.com/comment/47600867
has title: Create transitions on data change d3.js
has comment: http://stackoverflow.com/comment/47672146
tagged with: transition
type: Question
score: 0
has comment: http://stackoverflow.com/comment/47628727
tagged with: javascript

http://stackoverflow.com/comment/47594107
comment on: http://stackoverflow.com/a/29729934
score: 0
type: AnswerComment
type: Comment
has text: Hi Omri I tried to post a new question but it says that I have to wait 90 mins and Im afraid i wont be able to catch you again 90mins from now as I needed to finish this until tonight I'd like to detail it here in this question, what I wanted to accomplish is.. (question updated)

http://stackoverflow.com/comment/47706114
type: Comment
comment on: http://stackoverflow.com/a/29782213
score: 0
type: AnswerComment
has text: @Shelly It *will* work, regardless of whether you use `onClick` or `onclick` or `oNcLiCk` or `ONCLICK` http://jsfiddle.net/6fm0j8uq/5/

http://stackoverflow.com/a/29696622
has comment: http://stackoverflow.com/comment/47529735
has comment: http://stackoverflow.com/comment/47529982
has comment: http://stackoverflow.com/comment/47529223
has comment: http://stackoverflow.com/comment/47529759
has comment: http://stackoverflow.com/comment/47529909
type: Answer
has comment: http://stackoverflow.com/comment/47529300
has comment: http://stackoverflow.com/comment/47529238
has comment: http://stackoverflow.com/comment/47529942
has comment: http://stackoverflow.com/comment/47530329
has comment: http://stackoverflow.com/comment/47530219
has comment: http://stackoverflow.com/comment/47529477
accepted answer of: http://stackoverflow.com/q/29696479
has comment: http://stackoverflow.com/comment/47529802
has comment: http://stackoverflow.com/comment/47530422
score: 4
upvote count: 4
has body: All seems to Work angular.module('app', []) .controller('ctrl', ["$scope", function($scope) { $scope.limiter = 4; $scope.users = [{ id: 1, name: 'n1' }, { id: 2, name: 'n2' }, { id: 3, name: 'n3' }, { id: 4, name: 'n4' }, { id: 5, name: 'n5' }, { id: 6, name: 'n6' }]; } ]); Id - {{item.id}} Name - {{item.name}}
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47529376
downvote count: 0
answers question: http://stackoverflow.com/q/29696479

http://stackoverflow.com/comment/47876132
type: Comment
comment on: http://stackoverflow.com/a/29807928
score: 0
type: AnswerComment
has text: I put it here - https://jsfiddle.net/the_t_test_1/q5d2fdpq/ - but I don't think I put the JS in correctly as the hover function doesn't work? As for background:fixed , there are no absolute requirements at this stage... that's just where I have gotten to :/ (edited with new fiddle link)

http://stackoverflow.com/q/29736601
upvote count: 1
has comment: http://stackoverflow.com/comment/47606893
has body: I have two div of same class name and each div contains 5 input fields, 4 of them input fields and fifth one is for showing the sum. Can someone help me in writing a JavaScript which triggers the onblur(), but get the amounts from the input fields of that div only and show the sum in its Total. The Problem is all the input fields have same class name and even both div have same names so how will i differentiate between them. I cant give them ids because i am generating it from a generic loop, the loop gets the data from the database and executes itself for the number of results from database.
has answer: http://stackoverflow.com/a/29737080
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47607080
tagged with: javascript
has comment: http://stackoverflow.com/comment/47606596
has comment: http://stackoverflow.com/comment/47606796
has comment: http://stackoverflow.com/comment/47606448
has comment: http://stackoverflow.com/comment/47606685
has comment: http://stackoverflow.com/comment/47606649
has comment: http://stackoverflow.com/comment/47606698
linked to: http://stackoverflow.com/q/8337900
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/29737080
has title: Get the values of all text boxes having same parent div and show sum
favorite count: 0
has comment: http://stackoverflow.com/comment/47607162
has comment: http://stackoverflow.com/comment/47606469
score: 1
has comment: http://stackoverflow.com/comment/47606870

http://stackoverflow.com/q/29764902
has comment: http://stackoverflow.com/comment/47661539
type: Question
has comment: http://stackoverflow.com/comment/47661898
has comment: http://stackoverflow.com/comment/47661771
downvote count: 0
tagged with: javascript
answer count: 1
favorite count: 0
has title: Passing inter node dependancy in nodejs module
has body: What is the best way of passing dependencies to the nodejs modules? I am using gulp browserify and I have the following setup of my code. index.js var a = require('./a.js'); var b = require('./b.js'); b.test(a); a.js module.exports = { foo: function() { console.log('Foo called!'); } } b.js module.exports = { bar: function() { console.log('Bar called!'); }, test: function(a) { a.foo(); } }
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47661194
upvote count: 1
tagged with: node.js
has answer: http://stackoverflow.com/a/29765657
has comment: http://stackoverflow.com/comment/47661613
score: 1

http://stackoverflow.com/a/29815882
accepted answer of: http://stackoverflow.com/q/29808779
downvote count: 0
answers question: http://stackoverflow.com/q/29808779
has body: It's fine to update the DOM outside of Reacts control, and it's a common way to integrate plugins that doesn't use React into a React component. But you really shouldn't use both React and some other template system to render the same DOM node. What you should do is just return an empty &lt;div&gt; in your render method, and get a hold of that DOM node in componentDidMount to render something into that node with your other template system. Something like: var MyComponent = React.createClass({ componentDidMount() { var node = React.findDOMNode(this); otherTemplateSystem.render(node, {some: data}); }, render() { return &lt;div&gt;&lt;/div&gt;; } });
type: AcceptedAnswer
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/comment/47567301
type: AnswerComment
score: 0
type: Comment
has text: Yeah but that would mean i have to create XY amount of divs, and the name of the state is placed in a variable when you hover over the state. I'm just trying to find a way to show variable data in a rectangle that is active when mouse is hovering over specific state.
comment on: http://stackoverflow.com/a/29716264

http://stackoverflow.com/a/29755899
type: Answer
score: 1
upvote count: 1
has body: You can control the positioning of a DOM element through a window event listener like this: window.addEventListener("scroll", myFunc.bind(this, document.getElementById("scroller")), false); function myFunc(div) { var scroll = document.body.scrollTop; div.style.top = (scroll / 10)+"px"; }; So for every ten pixels the user scrolls, the scroller element will move one pixel. http://jsfiddle.net/76vd9h3g/ Cross browser implementation of scrollTop here
downvote count: 0
answers question: http://stackoverflow.com/q/29755271

http://stackoverflow.com/comment/47675869
comment on: http://stackoverflow.com/q/29772688
score: 0
type: Comment
type: QuestionComment
has text: added angular js script?

http://stackoverflow.com/a/29739656
has comment: http://stackoverflow.com/comment/47613438
score: 0
type: Answer
has body: Debug the code: var jsonData = $.ajax({ url: "script/pgResumeData.php", dataType:"json", async: false, success:function(data) { console.log(data) // see the console to see the result } }).responseText;
answers question: http://stackoverflow.com/q/29739604

http://stackoverflow.com/q/29739555
tagged with: jquery
has body: I want to make a research system by typing, so this will work like easter eggs. For example : I type "albert" on the website, and the Jquery script will scroll to the div with the id #albert. First, do you think this is even possible? I already try using keyup listener, but all the function is retrieving is numbers, maybe ASCII. I tried something like : $(document).keyup(function(e) { input += e.which; clearTimeout(timer); timer = setTimeout(function() { input = ""; }, 500); goto(); }); function goto() { alert(input); // display only numbers $('html, body').animate({ scrollTop: ($("#" + input).offset().top) },500); }
accepted answer: http://stackoverflow.com/a/29739615
answer count: 1
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29739615
type: AnsweredQuestion
score: 1
type: Question
upvote count: 2
has title: easter egg like research Jquery
tagged with: javascript

http://stackoverflow.com/comment/47742624
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29806924
has text: I'm not familiar with `chart.js` and its functions, but there should be a way to render the chart when the tab is shown, using bootstrap's `shown.bs.tab` function: http://getbootstrap.com/javascript/#tabs

http://stackoverflow.com/comment/47760148
comment on: http://stackoverflow.com/a/29806920
has text: God, why I haven't thought about this? So simple, yet works perefectly, thank you!
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47639052
type: Comment
comment on: http://stackoverflow.com/a/29752717
type: AnswerComment
has text: The server isn't allowing you to send such a request because of something called the same origin policy. On the web with some requests (such as AJAX requests) you aren't allowed to perform these requests if they are to another domain. Since localhost != you.herokuapp.com, you are not allowed to do the request. If you have access to the server code you can try enabling cross origin requests (google search "enable CORS in PHP/rails/nodejs/etc).
score: 0

http://stackoverflow.com/comment/47560866
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29712651
has text: Have you tried playing the audio recorded by Samsung in desktop browser? You did say the “files” play but it’s not really clear to me what files you are referring to there. Also off topic: “Can we just get a universal standard already”: AAC is already a pretty well-defined standard with good quality.
score: 0

http://stackoverflow.com/comment/52011718
comment on: http://stackoverflow.com/a/32056378
score: 1
type: AnswerComment
has text: If you are not sure, this should be a comment, not an answer. If you are going to tell him he needs more logic, then provide it. You need to provide answers with more explanation. See [How to answer page](http://stackoverflow.com/help/how-to-answer) for help in improving your answer.
type: Comment

http://stackoverflow.com/comment/47766743
type: Comment
score: 1
has text: In that case you should serve jQuery and jQuery-ui as static files and include them in your HTML with ` ` tags. I'm not too familiar with Express but I'm sure it has a static file server too.
comment on: http://stackoverflow.com/q/29819918
type: QuestionComment

http://stackoverflow.com/q/29831331
tagged with: error-handling
upvote count: 1
type: Question
has title: Javascript structured error handling
score: 1
has comment: http://stackoverflow.com/comment/47791179
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29833687
tagged with: javascript
has comment: http://stackoverflow.com/comment/47789383
has body: I am developing my first Javascript app and I am trying to go object oriented. There is a basic closure that returns my primary object and every function I invoke rests in that object. Some pseudo code would look like this: primary = (function(){ var object = { doSomething = function(){}; }, return {intance:function(return object)} }); //invocation primary.instance().doSomething(); What I am trying to achieve is to attach an error handler function to my object, so that whenever there is an internal error, it is cought, and I don't have to wrap every function call in a try catch block. I tried object.onerrorbut the error went on to window object. Maybe I am getting the concept wrong. I tried searching on Github for some simpler framework that includes structured error handling, but no luck. I am pretty familiar with this in PHP, but I haven't done this so far in Javascript. Can somebody show me an example how it is done right? EDIT: I know that structured error handling goes further, I am just trying to get a root handler, so that no errors / exceptions can pass on to the window object
has comment: http://stackoverflow.com/comment/47791922
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/29736380
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29735999
has comment: http://stackoverflow.com/comment/47607212
has body: Si when user clicks on submit this will générate a java script fonction that will do thé work by creating a table with maximum size Being thé size of thé table if thé user checks everything and then takes every selected item ans copies it into thé array without forgetting thé incrementation in thé loop i hope that this will help you :)

http://stackoverflow.com/q/29721284
has body: I want leaflet to just use the tiles zoomed to level 20 and disregard the lower zoom level tiles. Is there any way to make Leaflet use chosen zoom level no matter how much the map is actually zoomed? I thought that zIndex option of TileLayer would do it but it doesn't seem to do anything (I'm not sure what it's supposed to do). To say it another way: I want to be able to zoom still and force Leaflet to use 4 tiles to form one tile of a lower zoom level. Is the better solution is to just combine the tiles beforehand and then feed those combined tiles to leaflet?
upvote count: 3
tagged with: zooming
has comment: http://stackoverflow.com/comment/53315834
favorite count: 0
answer count: 0
type: UnansweredQuestion
tagged with: maps
has title: Force leaflet to use a fixed tile zoom level
score: 3
tagged with: tile
tagged with: leaflet
downvote count: 0
type: Question
tagged with: javascript

http://stackoverflow.com/a/29719557
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/47573649
has body: Using the text property $('#container').append( $('<p />', { 'class' : 'myClass', 'data-colour' : 'green', text : 'Some text' }) ); Any method available in jQuery for a collection can be used in the object passed when creating an element $('<p />', { html : 'something', css : { color : 'red', fontSize : '15px' }, on : { click : function() { alert('clicked'); }, mouseenter : function() { } } })
score: 3
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47573707
answers question: http://stackoverflow.com/q/29719537
accepted answer of: http://stackoverflow.com/q/29719537

http://stackoverflow.com/a/29806419
accepted answer of: http://stackoverflow.com/q/29806159
has body: You can use the following: item 1 - \w+ (variable number of letters) item 2 - \w+ (variable number of letters) item 3 - \w+(?:\s\w+)? (variable number of letters) OR (variable number of letters separated by one whitespace character) item 4 - \d{8} (eight digits) item 5 - (?:\d{3}\s){2}\d{4} (telephone number with 3 digits followed by 3 digits followed by 4 digits with two whitespace characters as shown) EDIT: You can use ^\w+?,\s\w+?,\s\w+(?:\s\w+)?,\s\d{8},\s(?:\d{3}\s){2}\d{4}$ to directly validate the string. Ex: function validateStr(str) { return (/^\[\s'\w+?',\s'\w+?',\s'\w+(?:\s\w+)?',\s'\d{8}',\s'(?:\d{3}\s){2}\d{4}'\s\]$/).test(str); }
has comment: http://stackoverflow.com/comment/47743573
upvote count: 3
answers question: http://stackoverflow.com/q/29806159
has comment: http://stackoverflow.com/comment/47743028
has comment: http://stackoverflow.com/comment/47742859
score: 3
has comment: http://stackoverflow.com/comment/47742824
has comment: http://stackoverflow.com/comment/47743707
has comment: http://stackoverflow.com/comment/47740757
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47745461
has comment: http://stackoverflow.com/comment/47741561
type: Answer

http://stackoverflow.com/comment/47565194
type: QuestionComment
has text: Great, let me know when you figured out a way.
score: 0
comment on: http://stackoverflow.com/q/29714898
type: Comment

http://stackoverflow.com/comment/47714730
type: QuestionComment
comment on: http://stackoverflow.com/q/29793026
has text: what is getting in response like what is in console after ajax req success with console.log(data);
score: 0
type: Comment

http://stackoverflow.com/comment/47673758
type: QuestionComment
comment on: http://stackoverflow.com/q/29768963
has text: Are you using jsp/servlet where the js file is imported?
score: 0
type: Comment

http://stackoverflow.com/q/29806465
tagged with: javascript
has comment: http://stackoverflow.com/comment/47740877
score: 0
answer count: 1
has body: I have an array of ints in my model which is meant to represent the indices of a list of options the user will pick from using a select list. The idea is there's a list you can expand and you keep picking things from the select list. I have code along these lines: --- Delete Add I have two problems which seem to be related: the ng-model does not seem to actually bind properly; if I inspect the scope I can see that newly-pushed members of arrayOfInt are still set to null even after I select something from the select menu representing them. When I attempt to push another item into the array, Angular complains that duplicate options are not allowed. What is the proper way to do what I'm trying to do? JSFiddle sample
has comment: http://stackoverflow.com/comment/47740949
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29806897
accepted answer: http://stackoverflow.com/a/29806897
has title: Maintaining an array of ints representing option indices in Angularjs
type: Question
tagged with: arrays

http://stackoverflow.com/q/29829116
accepted answer: http://stackoverflow.com/a/29829660
has title: Issues with popup timer resetting
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29829660
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47785000
possible better answer: http://stackoverflow.com/a/29829436
has comment: http://stackoverflow.com/comment/47785121
has body: This is my first time working with JavaScript, so I'm sure this is a simple question, but I can't figure it out. Basically, I am creating a game and I need to add a function so that if the player hasn't moved for 20 seconds, they receive a reminder. I have it working to the point that the reminder will pop-up 20 seconds after the player has last clicked, but it seems to keep popping up, regardless of whether they have moved within the 20 seconds or not. Here is my code: function UpdateMoveCount() { var timer = setInterval(setReminderTimer, 1000); var moveReminder = 0; function setReminderTimer() { if(moveReminder == 20) { document.getElementById("move").style.visibility = "visible"; clearInterval(timer); } else { moveReminder++; } } } UpdateMoveCount() is called each time the player clicks. Anyone have any ideas?
tagged with: javascript
has answer: http://stackoverflow.com/a/29829436
score: 0
has comment: http://stackoverflow.com/comment/47784799
has comment: http://stackoverflow.com/comment/47785002

rhino
tags question: http://stackoverflow.com/q/29754640
type: Tag
tags question: http://stackoverflow.com/q/29824582
tag name: rhino

http://stackoverflow.com/q/29755052
type: Question
has comment: http://stackoverflow.com/comment/47642471
score: 1
has title: CSS and Javascript files arent load in my HTML file at root folder - Openshift
has comment: http://stackoverflow.com/comment/47643945
accepted answer: http://stackoverflow.com/a/29755214
upvote count: 1
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47643374
favorite count: 0
has answer: http://stackoverflow.com/a/29755214
has comment: http://stackoverflow.com/comment/47642793
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47642366
tagged with: css
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47675673
downvote count: 0
has comment: http://stackoverflow.com/comment/47642866
has body: I'm using OpenShift free to make my term paper. My issue is that, in my root folder, I have the files: rankAplus.html, todo.js and dashboard.css. When I call todo.js and dashboard.css in my file rankAplus HTML, I get this error (not found 404 - browser error). When I look inside of my element dashboard at browser, the file type was changed, from text/css to text/html. The same thing occurs with my JavaScript file. The files are the same folder. What I need to do? Does someone know how to solve this? I'm using Node JS to create server at openshift. And im using references like AngularJS and Bootstrap. My folders structure at server openshift: ../repo/ . . . rankAplus.html . . . todo.js . . . dashboard.css . Server.js Routing for rankAplus on callback: function showRank(req,res) { res.sendfile('rankAplus.html'); } app.get('/showRank',showRank); On rankAplus.html header, i call to todo.js and dashboard.css this way &lt;script type="text/javascript" src="todo.js"/&gt; &lt;link href="dashboard.css" type="text/css" rel="stylesheet"&gt; I've been tried: &lt;script type="text/javascript" src="../todo.js"/&gt; &lt;link href="../dashboard.css" type="text/css" rel="stylesheet"&gt; and... &lt;script type="text/javascript" src="/todo.js"/&gt; &lt;link href="/dashboard.css" type="text/css" rel="stylesheet"&gt; but, nothing works. Anyone?
tagged with: openshift

http://stackoverflow.com/q/29704120
has body: I have a gridpanel and a binded store, all configured with objects. Store has "load" event. Is there anyway to get components (in that case gridpanel "fooo") inside "load" event that are connected to the store? Ext.create("Ext.grid.Panel", { renderTo: Ext.getBody(), viewModel: new Ext.app.ViewModel({ name: "globalVM", stores: { fooo: { autoLoad: true, proxy: { type: "ajax", url: "/data.json", reader: { type: "json", rootProperty: "results" } }, listeners: { scope: this, load: function(ejStore, records, successful, eOpts) { var grid; // obtain connected gridpanel "fooo" component??? grid.getView(); } } } } }), items:[{ xtype: "gridpanel", columns: [{ dataIndex: "title", text: "Title" }], name: "fooo", bind : { store: "{fooo}" } }] });
score: 0
tagged with: extjs
has comment: http://stackoverflow.com/comment/47544357
type: UnansweredQuestion
tagged with: extjs5
answer count: 0
has comment: http://stackoverflow.com/comment/47915539
has title: Find components binded to store in ExtJS 5.1.x
type: Question
tagged with: javascript

http://stackoverflow.com/a/47781245
has comment: http://stackoverflow.com/comment/135441497
has comment: http://stackoverflow.com/comment/127658889
has comment: http://stackoverflow.com/comment/121270520
score: 166
has comment: http://stackoverflow.com/comment/90755322
has comment: http://stackoverflow.com/comment/94323554
upvote count: 168
has comment: http://stackoverflow.com/comment/140024398
type: Answer
has comment: http://stackoverflow.com/comment/98127634
has body: For a robust solution, look at timekeeper: import timekeeper from 'timekeeper'; beforeAll(() =&gt; { // Lock Time timekeeper.freeze(new Date('2014-01-01')); }); afterAll(() =&gt; { // Unlock Time timekeeper.reset(); }); For older versions of Jest: For quick and dirty solution use jest.spyOn for locking time: let dateNowSpy; beforeAll(() =&gt; { // Lock Time dateNowSpy = jest.spyOn(Date, 'now').mockImplementation(() =&gt; 1487076708000); }); afterAll(() =&gt; { // Unlock Time dateNowSpy.mockRestore(); });
has comment: http://stackoverflow.com/comment/96346602
has comment: http://stackoverflow.com/comment/84605525
downvote count: 2
answers question: http://stackoverflow.com/q/29719631

http://stackoverflow.com/a/29801668
type: Answer
answers question: http://stackoverflow.com/q/29773790
score: 0
has body: One of my colleague found the solution (thanks to him). Actually this piece of code editable: { mode: "popup", window: { animation: false, open: openCustomWindow, } } is designed to configure the default popup... The right way to use a custom popup is the following : editable :true, edit: openCustomWindow, With this approach it's also better to use function editorWindowClosed(e) { myGrid.cancelChanges(); } Instead of function editorWindowClosed(e) { myGrid.cancelRow(); } Working jsfiddle link

http://stackoverflow.com/comment/47757452
score: 0
comment on: http://stackoverflow.com/q/29814264
type: Comment
type: QuestionComment
has text: have you injected ['ngWebSocket'] in your module.

http://stackoverflow.com/a/29744775
has body: You don't need any cookie... You can use variables to keep the div open/close. Every time your onchange event is called you can test the status of your div. In the event you can choose to close the div or open
answers question: http://stackoverflow.com/q/29744514
has comment: http://stackoverflow.com/comment/47625346
has comment: http://stackoverflow.com/comment/47624972
has comment: http://stackoverflow.com/comment/47622240
score: 0
type: Answer

http://stackoverflow.com/comment/47633876
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29748722
has text: this might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isPrototypeOf
type: QuestionComment

http://stackoverflow.com/q/29716664
score: 1
has answer: http://stackoverflow.com/a/29721316
has answer: http://stackoverflow.com/a/29826811
accepted answer: http://stackoverflow.com/a/29826811
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/29721316
tagged with: javascript
has comment: http://stackoverflow.com/comment/47577269
has comment: http://stackoverflow.com/comment/47567972
upvote count: 1
has body: Can someone please explain what the correct data structure would be in a noSQL environment like parse.com to do the equivalent of a LEFT JOIN in SQL. I come from a relational world so I am very much open to the idea that my tables need to be entirely redesigned. I want to store "Jobs" and "Users" where Users can post Jobs and Apply to Jobs. So I created three tables: "Job", "User", and "Application". Applications has three columns: "pointer to Job", "pointer to User", and "Application status". Problem is: I can't in single query get all the jobs posted by a user with the number of applications for each. I can't in a single query get all available job for a user and also know whether that user applied I am using parse.com for this project. EDIT for bounty I have several solutions with either multiple queries or using arrays in the Job table. Each has limitations but I am looking to understand if there is a better data structure or query to get all jobs with the applications for those jobs.
favorite count: 0
tagged with: parse-platform
downvote count: 0
has title: Parse.com LEFT JOIN alternative
has comment: http://stackoverflow.com/comment/47567941
tagged with: nosql
type: AnsweredQuestion

http://stackoverflow.com/a/29806919
answers question: http://stackoverflow.com/q/29806066
has body: Per discussion and your identified issue, you don't necessarily need to remove 'format', but in your Plunker, 'format': '{0}%' is not valid. If you change to the following, you can keep format and have the results you wish See valid Kendo Number Formatting for more information "valueAxis": { "labels": { "format": "p0", /*or "p" to include decimals*/ "rotation": -30 }, "line": { "visible": false }, "axisCrossingValue": 0 } } Plunker
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29806066
type: Answer

http://stackoverflow.com/comment/47617915
score: 2
has text: yes the user can change the behavior of you js or disable js
comment on: http://stackoverflow.com/q/29742463
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29772013
score: 10
tagged with: javascript
has answer: http://stackoverflow.com/a/31433502
upvote count: 10
favorite count: 0
has answer: http://stackoverflow.com/a/29963681
linked to: http://stackoverflow.com/q/44535465
tagged with: http-live-streaming
has body: We have a video streaming platform where users can broadcast a live video stream and synchronise it with a set of presentation slides. To display the broadcast on iOS we are using HTTP Live Streaming. In order to show the slide at the correct time in the stream on iOS we were listening for the qt_timedmetadataupdated event provided by Apple's Quicktime Javascript API. This method is described here: http://www.wowza.com/forums/content.php?355-How-to-debug-timed-data-events-%28ID3-tags%29-from-Apple-HLS-streams-in-iOS-devices However, in iOS8 this method no longer works so we are trying to find an alternative solution. Does anyone have an idea as to how we could do this? The only bit of progress I've managed to make is checking for an "in-band metadata text track" as described here: https://github.com/videojs/videojs-contrib-hls#in-band-metadata I've set up an example test page below using flowplayer and the flashls plugin: http://jsbin.com/vohicoxegi/1/edit?html,js,output In the code I've created an interval that checks every 500ms whether a text track exists whose kind property is metadata. I've noticed that when a bit of timed metadata is injected into the stream then one of these text tracks is created. But the problem is that there is no way for me to access the data that is in the timed metadata which I need to synchronise the (previously mentioned) slides correctly. Please note that I'm only concerned with live streaming. Playing an existing media file is not a problem.
has title: HTTP Live Streaming: how to listen for timed metadata embedded as ID3 tags using Javascript in iOS8?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/76063308
downvote count: 0
accepted answer: http://stackoverflow.com/a/31433502
type: Question
possible better answer: http://stackoverflow.com/a/29963681
answer count: 2
tagged with: ios8

http://stackoverflow.com/a/29708032
has body: It iterates, the first argument is the array or object, the second is the callback, and the third is the arguments passed in to the callback. In a loop you'd do the same thing with (assuming array) options.reservationOptions.forEach(function(item) { this._addToSelect.apply(item, [select]); }.bind(this)); Here's a short version of what jQuery does $.each = function (obj, callback, args) { var value, i = 0, length = obj.length, isArray = isArraylike(obj); if (args) { if (isArray) { for (; i &lt; length; i++) { value = callback.apply(obj[i], args); if (value === false) { break; } } } else { for (i in obj) { value = callback.apply(obj[i], args); if (value === false) { break; } } } } }
has comment: http://stackoverflow.com/comment/47551724
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47552209
type: Answer
downvote count: 1
has comment: http://stackoverflow.com/comment/47551765
upvote count: 3
has comment: http://stackoverflow.com/comment/47551918
answers question: http://stackoverflow.com/q/29707939
accepted answer of: http://stackoverflow.com/q/29707939
score: 2
has comment: http://stackoverflow.com/comment/47551789
has comment: http://stackoverflow.com/comment/47551876

http://stackoverflow.com/comment/47522447
has text: What is your question?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29692948
score: 0

http://stackoverflow.com/q/29795040
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/29795041
accepted answer: http://stackoverflow.com/a/29795041
tagged with: scroll
type: Question
has body: The ace editor centers the view (scrolls horizontally) on the cursor even when the cursor is not outside the screen. This happens after resize the ace editor container. How to prevent ace editor to center on the cursor when it is not necessary?
downvote count: 0
tagged with: javascript
tagged with: resize
has title: Prevent ace editor to center scroll on the cursor?
answer count: 1
favorite count: 0
tagged with: ace-editor
upvote count: 2

http://stackoverflow.com/comment/47811224
has text: I'm sorry I don't know what you mean? As far as why, I know about as much as you. If this is important I can start searching why this is, but I don't think it's really relevant?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29841940
type: Comment

http://stackoverflow.com/q/29721422
has body: I have a dropdown menu which contains the checkboxes that can be multi selected using SumoSelect.Here is the Markup for dropdown menu.. Volvo Saab Mercedes Audi BMW and here is the jquery function to get the dropdown click event ... $(document).ready(function () { $('.select').SumoSelect({}); var v = $("#uq").val(); }); I am following this link to get the multiselect checkbox option in dropdown menu but i am not getting how to get the value. Please help me ..Thanks... Update $("#submit").click(function (evnt) { evnt.preventDefault(); alert(v); console.log(v); }); Update 2 $(document).ready(function () { $('.select').on('change', function (e) { console.log($(this).val()) // value }).SumoSelect({}); $("#submit").click(function (evt) { evt.preventDefault(); var v = $("#uq").val(); alert(v)
type: Question
tagged with: sumoselect.js
score: 1
has answer: http://stackoverflow.com/a/29721527
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/29721553
has comment: http://stackoverflow.com/comment/47577463
has answer: http://stackoverflow.com/a/29721553
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/29721527
type: AnsweredQuestion
has title: How to get the value from the dropdown menu
upvote count: 1

http://stackoverflow.com/comment/47657311
type: Comment
has text: if I doesnt decalre again will it retain the stored value
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29762079

http://stackoverflow.com/comment/47671170
comment on: http://stackoverflow.com/q/29769591
has text: Look http://jsfiddle.net/molo4nik11/gko2b3er/7/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29762174
has title: If statement in javascript not working as intended
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29762241
has comment: http://stackoverflow.com/comment/47656187
has comment: http://stackoverflow.com/comment/47656141
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29762207
has body: This if statement is meant to change text to one of the colors with a button for each color. However, every button only changes the text to red as is. I'm not sure what i am doing incorrectly. Javascript: function colorFunction() { if (document.getElementById("red")) { document.getElementById('test').style.color = "red"; }else if(document.getElementById("blue")) { document.getElementById('test').style.color = "blue"; }else if (document.getElementById("black")) { document.getElementById('test').style.color = "black"; } } Html: Red Text Blue Text Black Text
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47656210
has comment: http://stackoverflow.com/comment/47656132
type: Question
tagged with: javascript

http://stackoverflow.com/comment/47682498
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29756710
has text: @YOU ok, so with ui-router for instance it should work right ?
type: QuestionComment

http://stackoverflow.com/comment/47519092
has text: You could try `tabs.on['core-select'].listen(...)` (see http://stackoverflow.com/questions/13897091) but I suspect you run into the same issue as mentioned here http://stackoverflow.com/questions/29629492. If you run your code querying Polymer elements from `main()` you need to ensure that Polymer is already properly initialized.
comment on: http://stackoverflow.com/q/29691166
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29940955
has body: I found information about Guided Access for iOS. It looks pretty cool for my purpose to "limits your device to a single app and lets you control which app features are available." But I have not the tools (may be plugins or smth else) for PhoneGap how can I manage this setting. Will be awesome to get read-only property whether the setting is On or Off. P.S There is phonegap plugin which allowed to check if application under Guided Access or not - mobile-accessibility Links: About Guided Access Mobile accessibility phonegap plugin
type: Answer
accepted answer of: http://stackoverflow.com/q/29797374
answers question: http://stackoverflow.com/q/29797374
score: 0
type: AcceptedAnswer

http://stackoverflow.com/a/29733050
has body: You can't have associative arrays in Javascript. You can create an array of objects, like: var arr=[ {Ibanez: 'JoeSatriani'}, {Ibanez: 'SteveVai'}, {Fender: 'YngwieMalmsteen'}, {Fender: 'EricJohnson'}, {Gibson: 'EricJohnson'}, {Takamine: 'SteveVai'} ]; Then you'll need a for...in loop to go over every object in the array, create a new array of values and check that for duplicates, which is also not very straightforward - basically you'll want to sort the array and make sure no value is the same as the one after it. var arrayOfValues = []; arr.forEach(function(obj){ for(var prop in obj) arrayOfValues.push(obj[prop]); }); arrayOfValues.sort(); // by default it will sort them alphabetically arrayOfValues.forEach(function(element,index,array){ if(array[index+1] &amp;&amp; element==array[index+1]) alert("Duplicate value found!"); });
type: Answer
downvote count: 1
has comment: http://stackoverflow.com/comment/47599493
score: 1
answers question: http://stackoverflow.com/q/29732916
has comment: http://stackoverflow.com/comment/47599356
accepted answer of: http://stackoverflow.com/q/29732916
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47599391
upvote count: 2

http://stackoverflow.com/q/29805198
tagged with: css
possible better answer: http://stackoverflow.com/a/29805518
duplicate of: http://stackoverflow.com/q/114543
score: 0
has answer: http://stackoverflow.com/a/29805518
has answer: http://stackoverflow.com/a/29805390
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47738224
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/29805390
tagged with: slideshow
tagged with: javascript
has body: I am very beginner at coding and most the answers I have come across have just gone straight over my head. The only code I have to make my slideshow work (which it is working) is: &lt;script type="text/javascript"&gt; &lt;!--&gt; var image1=new Image() image1.src="congo.jpg" var image2=new Image() image2.src="snow.jpg" var image3=new Image() image3.src="mekong.jpg" //--&gt; &lt;/script&gt; and in the body section: &lt;img src="congo.jpg" name="slide" width="400" height="300"&gt; &lt;script type="text/javascript"&gt; &lt;!-- var step=1 function slideit(){ document.images.slide.src=eval("image"+step+".src") if(step&lt;3) step++ else step=1 setTimeout("slideit()",2500) } slideit() //--&gt; &lt;/script&gt; I have no clue how to center this or put in a margin. I tried placing it within a table so I could manipulate its location, which didn't work (assuming it's just not that easy), and tried messing around with a tag to center but I was just pulling at strings! What is the proper way to add margin/center? Thank you.
has title: Center Javascript Slideshow?
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/114543

http://stackoverflow.com/comment/47781439
type: Comment
type: QuestionComment
score: 0
has text: In DevTools, the POST requests are sometimes getting canceled, and at other times completing successfully, which I've seen as a symptom of mistakes in async code in the past.
comment on: http://stackoverflow.com/q/29827169

http://stackoverflow.com/q/29691909
has answer: http://stackoverflow.com/a/29692254
has title: d3 count data (votes) and store it for use
has comment: http://stackoverflow.com/comment/47521192
downvote count: 1
type: Question
upvote count: 0
tagged with: javascript
score: -1
has body: I have voting data from 2000 people. Each line contains a sequence of votes, each for one of two options (or neither). I'm trying to condense this data into the total number of votes per subject. I have a CSV file that looks like this: A C F B C E A D E The first column is a vote between A and B, the second column between C and D.
answer count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/47551449
type: QuestionComment
comment on: http://stackoverflow.com/q/29707603
has text: that's would indeed could do the trick. But how can I do that (not with a random delay value ...) ?
score: 0
type: Comment

http://stackoverflow.com/comment/47603419
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29734856
type: Comment
has text: i need to go from the local page to the server page then return to the local page with 2 GET variables @MohammadAlabed

http://stackoverflow.com/a/29830629
has comment: http://stackoverflow.com/comment/47788329
type: Answer
downvote count: 0
score: 1
has body: Your range function has an issue in its for-loop condition. Here's what I got to work that also handles descending ranges: function range(start, end, step){ if(step === undefined){ step = 1; } var c = (Math.max(start, end) - Math.min(end, start)) / Math.abs(step); var arr = []; for(var i = start; c-- &gt;= 0; i += step){ arr.push(i); } return arr; } It adds a counter c for the amount of steps to take, decrements it until it's less than 0 and doesn't worry with i or end. Here's a fiddle: http://jsfiddle.net/syssqob4/2/
has comment: http://stackoverflow.com/comment/47787724
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29830520
answers question: http://stackoverflow.com/q/29830520

http://stackoverflow.com/q/29790292
has comment: http://stackoverflow.com/comment/47710290
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29790328
upvote count: 2
has comment: http://stackoverflow.com/comment/47709512
has body: I did some test in Chrome. Quite simple, I change the inherited property value. I assume the set would happen on prototype object, but the prototype value does not change. Actually a new property is created on child object. Is this expected? &gt; function Shape() {}; &gt; var base = new function() { this.mValue = 10; }; &gt; Shape.prototype = base; &gt; var s = new Shape(); &gt; s.mValue = 20; &gt; base; &lt; Object {mValue: 10}
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47710367
accepted answer: http://stackoverflow.com/a/29790328
type: Question
tagged with: javascript
has title: Set the property value inherited from prototype, why the prototype value does not change?
score: 2

http://stackoverflow.com/q/29805909
has body: Newbie here. The problem is that I currently have written a method which checks uploaded file size and extension in order to validate it. However, checking extensions is not a solution as that kind of validation may cause a lot of problems. What I want to do is to check the actual file type and validate it without using extension method. I have tried to use jQuery file validator but to no avail... This is a snippet from my current code: &lt;input type='file' id='imageLoader' name='imageLoader' accept="image/*" data-type='image' /&gt; Script: App.Dispatcher.on("uploadpic", function() { $(":file").change(function() { if (this.files &amp;&amp; this.files[0] &amp;&amp; this.files[0].name.match(/\.(jpg|jpeg|png|gif)$/) ) { if(this.files[0].size&gt;1048576) { alert('File size is larger than 1MB!'); } else { var reader = new FileReader(); reader.onload = imageIsLoaded; reader.readAsDataURL(this.files[0]); } } else alert('This is not an image file!'); }); function imageIsLoaded(e) { result = e.target.result; $('#image').attr('src', result); }; }); It is called once the upload input changes and after validation it uploads and displays the image. For now, I only care about validation and any help or ideas would be greatly appreciated!
answer count: 10
has answer: http://stackoverflow.com/a/29806920
has answer: http://stackoverflow.com/a/29806597
type: AnsweredQuestion
tagged with: validation
upvote count: 45
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29806920
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/71094948
has answer: http://stackoverflow.com/a/29806390
has answer: http://stackoverflow.com/a/50742967
score: 44
linked to: http://stackoverflow.com/q/32222786
has answer: http://stackoverflow.com/a/55439164
linked to: http://stackoverflow.com/q/9809015
has answer: http://stackoverflow.com/a/37103282
has answer: http://stackoverflow.com/a/73183022
downvote count: 1
possible better answer: http://stackoverflow.com/a/37103282
has answer: http://stackoverflow.com/a/47158632
has answer: http://stackoverflow.com/a/72346160
has title: jQuery how to check if uploaded file is an image without checking extensions?

http://stackoverflow.com/q/29716213
has answer: http://stackoverflow.com/a/42184365
has body: I am trying to scrape a website that uses javascript. I am using the following code: import os import sys import re import requests import mechanize import cookielib from bs4 import BeautifulSoup from PyQt4.QtGui import * from PyQt4.QtCore import * from PyQt4.QtWebKit import * from lxml import html import pandas as pd import time class Render(QWebPage): def __init__(self, url): self.app = QApplication(sys.argv) QWebPage.__init__(self) self.loadFinished.connect(self._loadFinished) self.mainFrame().load(QUrl(url)) self.app.exec_() def _loadFinished(self, result): self.frame = self.mainFrame() self.app.quit() def read_page(url): r = Render(url) result = r.frame.toHtml() text = str(result.toAscii()) html_source = html.fromstring(text) return text, html_source for url in urls: text, html_source = read_page(url) After reading successfully the first url, on the second url it displays the following message and python.exe crashes. content-type missing in HTTP POST, defaulting to application/x-www-form-urlencoded. Use QNetworkRequest::setHeader() to fix this problem. QObject::connect: Cannot connect (null)::configurationAdded(QNetworkConfiguration) to QNetworkConfigurationManager::configurationAdded(QNetworkConfiguration) QObject::connect: Cannot connect (null)::configurationRemoved(QNetworkConfiguration) to QNetworkConfigurationManager::configurationRemoved(QNetworkConfiguration) QObject::connect: Cannot connect (null)::configurationChanged(QNetworkConfiguration) to QNetworkConfigurationManager::configurationChanged(QNetworkConfiguration) QObject::connect: Cannot connect (null)::onlineStateChanged(bool) to QNetworkConfigurationManager::onlineStateChanged(bool) QObject::connect: Cannot connect (null)::configurationUpdateComplete() to QNetworkConfigurationManager::updateCompleted()
tagged with: qtwebkit
downvote count: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: python
has title: QtWebkit crashes Python on Windows
upvote count: 3
type: Question
score: 3
tagged with: javascript
linked to: http://stackoverflow.com/q/12863412

http://stackoverflow.com/comment/47525312
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29694361
type: QuestionComment
has text: Are you certain that the attribute value is definitely being updated? As Franky said, please supply your code.

http://stackoverflow.com/q/29798378
type: Question
has body: Here is what the website looks like: The bottom right text 'COMING SOON' should not go in to the white space on the left. At any moment I can adjust the angle of the white divide so that it does not collide with the text. Here is one example of the viewport being at its limit with the viewport having a height of X and a width of Y: Here is a second example of the viewport being at its limit with the viewport having a height of X2 and a width of Y2: Here is the CSS for the white divide: .white-slanted { z-index: -1; position: absolute; width: 80vw; height: 100vh; border-top: 100vh solid white; border-right: 60vw solid transparent; } I'm guessing that I can take the two pairs of viewport dimensions, graph it, and one side of the line will be OK and the other side of the line will be broken. I can dynamically change the CSS properties of the white divide with Javascript...I just don't know the math on how to make the next step. Does anyone have any ideas? :D
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29931527
score: 0
has title: Using slope and javascript for a responsive web design
tagged with: css
type: UnansweredQuestion
tagged with: math

http://stackoverflow.com/comment/47738809
has text: That made so much sense. I think that crossed my mind but I didn't end up trying it before now. Worked like a charm! Thank you tons!!!
type: Comment
comment on: http://stackoverflow.com/a/29805390
score: 0
type: AnswerComment

http://stackoverflow.com/a/29777814
answers question: http://stackoverflow.com/q/29777675
type: Answer
accepted answer of: http://stackoverflow.com/q/29777675
upvote count: 1
has body: If this server is remote to the user, they will not be able to download a file with a path from your C: drive in their browser. You will need to place the file somewhere in your web root and then use its URL for downloading: window.location.assign('http://www.example.com/myFile.txt');
type: AcceptedAnswer
downvote count: 0
score: 1

http://stackoverflow.com/a/29821838
answers question: http://stackoverflow.com/q/29689368
score: 0
has body: Simple answer is to specify a fixed height for these. .mh_x { height: 320px; }
type: Answer

http://stackoverflow.com/a/29745153
has comment: http://stackoverflow.com/comment/47623277
type: Answer
upvote count: 4
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29745075
answers question: http://stackoverflow.com/q/29745075
score: 4
has comment: http://stackoverflow.com/comment/47624696
has body: Name your handling function, then call it within document ready and within window resize events. $(document).ready(function() { $.fn.hasScrollBar = function() { return this.get(0).scrollHeight &gt; this.height(); } if($("#rightsection").hasScrollBar()){ $('#rightsection').css({ "position":"static", "margin":"-75px 0 -55px 150px" }); } function render() { var w = $(window).width(); /*Making the screen smaller*/ if(w &lt; 960){ $('#rightsection').css({ "margin":"0" }); } /*Making the screen bigger*/ if(w &gt; 960){ $('#rightsection').css({ "margin":"-75px 0 -55px 150px" }); } } // call on document load render(); $(window).resize(function(){ // call on window resize render(); }); });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47624465

http://stackoverflow.com/q/29693357
score: 2
tagged with: mysql
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47523401
answer count: 2
has title: how to fetch data when an item entered a select box?
has answer: http://stackoverflow.com/a/29694209
has answer: http://stackoverflow.com/a/29737818
downvote count: 0
has comment: http://stackoverflow.com/comment/47523335
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47523201
upvote count: 2
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/19131800
has body: I'm referring to this fiddle https://jsfiddle.net/a1gsgh11/16/. How can I also fetch data from database for each category as soon as it that enters the left box and display the list below each category like following? Say I select primary , university from the checkbox.Under this two category there are items stored in db. How to show them below each category without triggering any event using ajax? exm: primary List 1 List 2 List 3 University List 1 List 2 something I tried, script: &lt;script&gt; function showUser(str) { if (str == "") { document.getElementById("txtHint").innerHTML = ""; return; } else { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { document.getElementById("txtHint").innerHTML = xmlhttp.responseText; } } xmlhttp.open("GET","getuser.php?q="+str,true); xmlhttp.send(); } } &lt;/script&gt; php &lt;?php $q = intval($_GET['q']); $con = mysqli_connect('localhost','root','','wordblend_db'); if (!$con) { die('Could not connect: ' . mysqli_error($con)); } mysqli_select_db($con,"wordblend_db"); $sql="SELECT * FROM tbl_subjects WHERE level_id = '".$q."'"; $result = mysqli_query($con,$sql); echo "&lt;table&gt; &lt;tr&gt; &lt;th&gt;Subject Name&lt;/th&gt; &lt;/tr&gt;"; while($row = mysqli_fetch_array($result)) { echo "&lt;tr&gt;"; echo "&lt;td&gt;" . $row['subject_name'] . "&lt;/td&gt;"; echo "&lt;/tr&gt;"; } echo "&lt;/table&gt;"; mysqli_close($con); ?&gt; HTML: trigger click event on each category: &lt;select multiple size="10" id="from" name="users" onClick="showUser(this.value)"&gt; &lt;/select&gt; And display like this,but not under each category: &lt;div class="inner_box_wrapper"&gt; &lt;select multiple id="to" size="10" name="topics[]"&gt;&lt;/select&gt; &lt;/div&gt; complete html &lt;main&gt; &lt;div id="ma…
tagged with: php
has comment: http://stackoverflow.com/comment/47524689

http://stackoverflow.com/comment/47678145
score: 0
type: Comment
type: QuestionComment
has text: Most menu plugins work with nested UL/LIs, so that is not a problem.
comment on: http://stackoverflow.com/q/29773166

sidebar
type: Tag
tag name: sidebar
tags question: http://stackoverflow.com/q/29775702
tags question: http://stackoverflow.com/q/29807207

http://stackoverflow.com/comment/116273545
type: Comment
comment on: http://stackoverflow.com/a/29778536
score: 0
has text: what is the opposite of 'not'. like if I only want to remove MultiFiles within all hidden fields. and MultiFiles is also available as 'not hidden' input field.
type: AnswerComment

http://stackoverflow.com/q/29817246
downvote count: 3
possible better answer: http://stackoverflow.com/a/29817330
answer count: 4
has answer: http://stackoverflow.com/a/29817330
has answer: http://stackoverflow.com/a/29817340
has body: I don't know how to explain this, but maybe in this case picture tells story instead of me: Shortly if you cannot see it. I'm trying to place logo inside multiple areas (header, body, content) like a global image. Is that possible with CSS, JavaScript, HTML, PHP? And if it is, any guides or tips?
type: AnsweredQuestion
upvote count: 0
accepted answer: http://stackoverflow.com/a/29817679
tagged with: javascript
score: -3
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has title: Placing logo inside multiple areas; header, body, content
tagged with: php
has answer: http://stackoverflow.com/a/29817679
has answer: http://stackoverflow.com/a/29817735

http://stackoverflow.com/comment/47778271
score: 0
comment on: http://stackoverflow.com/a/29824061
type: AnswerComment
has text: for some reason the body is not getting the width property, any idea why?
type: Comment

http://stackoverflow.com/q/29717040
has title: Gulp cwd to project root
accepted answer: http://stackoverflow.com/a/29733323
type: AnsweredQuestion
has body: My current code: gulp.task('_sass', function() { var files = [ './vendor/bower_components/bootstrap-sass/assets/stylesheets/_bootstrap.scss', './resources/assets/sass/main.scss', './vendor/bower_components/bootstrap-rating/bootstrap-rating.css', './vendor/bower_components/select2/select2.css' ]; return gulp.src(files) //return gulp.src(files) .pipe(concat('all.css')) .pipe(sass()) .on('error', notify.onError(function (error) { return "Error: " + error.message; })) .pipe(gulp.dest('./public/css/')) .pipe(reload({stream: true})); }); As you can see, I have a files array where I store all the paths to the .scss files I want to concat into all.css. But I get this error: Error: file to import not found or unreadable: base/normalize Current dir: /Users/**/Code/Laravel/vendor/bower_components/bootstrap-sass/assets/stylesheets/ which is obvious, because gulp uses the first path of the array as it's base directory. So I tried settings the base or the cwd to './', so I could specify my Laravel root directory. But that doesn't work. How can I solve this problem, so I can use all these .scss files without copying files to other directories?
upvote count: 1
tagged with: laravel
type: Question
score: 1
has answer: http://stackoverflow.com/a/29733323
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: gulp
favorite count: 0

http://stackoverflow.com/comment/47653065
score: 0
comment on: http://stackoverflow.com/q/29760408
type: Comment
type: QuestionComment
has text: While I'm open to suggestions to my initial proble, I'd really like to know why the lazy group matching in my regexp isn't working. @Mike'Pomax'Kamermans

http://stackoverflow.com/comment/47565402
has text: @user1765862 Need to add ajax to fire the post request. Will update the code in few minutes. Currently traveling
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29715014

http://stackoverflow.com/comment/124322466
has text: Note that the built-in `prepublish` script has been deprecated in favour of `prepare`. See here for an overview of the change: https://iamakulov.com/notes/npm-4-prepublish/
score: 0
type: Comment
comment on: http://stackoverflow.com/a/33976278
type: AnswerComment

http://stackoverflow.com/comment/47776102
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29824767
has text: angular version: 1.3.15, plugins: jquery.easing, query.animate-enhanced, jquery.superslides, angular-ui-router, angular-animate 1.2.0-rc.2
score: 0

http://stackoverflow.com/a/29784384
has comment: http://stackoverflow.com/comment/47698750
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29784284
has body: You can't access child scopes directly from parents. See the comment by Vittorio suggesting&lt;ng-repeat="child in parent.children"/&gt; also Binding to Primitives

http://stackoverflow.com/comment/47776851
score: 0
comment on: http://stackoverflow.com/q/29825232
type: Comment
type: QuestionComment
has text: Could we see the html that you are trying to hide?

http://stackoverflow.com/q/29776996
score: 63
has comment: http://stackoverflow.com/comment/47684325
has title: Applying a function to each object in a JavaScript array
favorite count: 0
has answer: http://stackoverflow.com/a/29777085
accepted answer: http://stackoverflow.com/a/29777085
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47684277
has body: [ {name:'hi',data:'1,2,3,4,5'} , {name:'hello',data:'5,4,3,2,1'} ] What I need is to apply a split on data of each object in array so that the result would be: [ {name:'hi',data:[1,2,3,4,5]} , {name:'hello',data:[5,4,3,2,1]} ] I know I can loop through the array using for each and produce a new array, but is there a better, faster method? var arr = [{ name: 'hi', data: '1,2,3,4,5' }, { name: 'hello', data: '5,4,3,2,1' }]; var new_arr = []; for (i in arr) { var temp = {}; temp.name = arr[i].name; temp.data = arr[i].data.split(','); new_arr.push(temp); }
possible better answer: http://stackoverflow.com/a/29777065
has answer: http://stackoverflow.com/a/29777065
has comment: http://stackoverflow.com/comment/47684369
answer count: 2
has comment: http://stackoverflow.com/comment/47689519
upvote count: 63
tagged with: arrays
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47552870
comment on: http://stackoverflow.com/q/29708508
score: 0
type: Comment
type: QuestionComment
has text: You're not actually posting data. You are just putting the values into variable. Check out this http://api.jquery.com/jquery.ajax/. Also this seems like you should just form submit the data. Why do you want to do this with Jquery?

http://stackoverflow.com/a/29752429
has comment: http://stackoverflow.com/comment/47637486
has body: The easiest would probably be var sPageURL = window.location.href.split('/').pop();
type: AcceptedAnswer
upvote count: 6
answers question: http://stackoverflow.com/q/29752394
has comment: http://stackoverflow.com/comment/47638154
accepted answer of: http://stackoverflow.com/q/29752394
type: Answer
score: 6
downvote count: 0

http://stackoverflow.com/comment/47515346
type: Comment
has text: This won't work because the javascript is running before the page is read. Try `window.onload=function(){*place the javascript here*}`
comment on: http://stackoverflow.com/a/29689133
type: AnswerComment
score: 0

http://stackoverflow.com/q/29753151
has comment: http://stackoverflow.com/comment/47638532
has comment: http://stackoverflow.com/comment/47640338
tagged with: javascript
tagged with: jquery
has body: I have a print preview library setup to show our users what the completed product will look like. The issue is that we don't actually want the images to print as we will be printing onto paper that is already branded. I've added the print media query to the print.css and changed it so that all our images are being picked up and added to the class hideImg which exists in that print.css file. I'm either looking for a reason why the print media query isn't working or how to alter the library / my jquery. I've tried adding them into different divs and changing what content is active on the preview but no luck. The classes ARE being picked up and the console returns no errors. CSS : @media print { /* -- Hide screen specific elements -- */ .hideImg{ display:none !important; visibility:hidden !important; } } jQuery var images = document.getElementsByTagName("img"); var i; for(i = 0; i < images.length; i++) { images[i].className += "hideImg"; } HTML Hi, my name is... Library jQuery // Bind closure $('a', print_controls).bind('click', function(e) { e.preventDefault(); //adding the printframe contentwindow rather than body prints out just what we want if ($(this).hasClass('print')) { print_frame[0].contentWindow.print(); } else { $.printPreview.distroyPrintPreview(); } });
has comment: http://stackoverflow.com/comment/47638820
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29753294
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47648718
has title: Print media query not hiding class after preview
score: 0
has comment: http://stackoverflow.com/comment/47638626
type: Question

http://stackoverflow.com/comment/47571859
type: Comment
comment on: http://stackoverflow.com/a/29718671
score: 0
type: AnswerComment
has text: I see, which other ports would you recommend? Is there any restriction on the port # i can use?

http://stackoverflow.com/q/29776385
linked to: http://stackoverflow.com/q/5311334
type: Question
has comment: http://stackoverflow.com/comment/47683357
possible better answer: http://stackoverflow.com/a/29776470
has comment: http://stackoverflow.com/comment/47685115
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/47683597
has comment: http://stackoverflow.com/comment/47683323
downvote count: 0
favorite count: 0
has body: Here I created Custom Error class in Node.js. I created this ErrorClass to send Custom error response of api call. I want to catch this CustomError class in Bluebird Catch promises. Object.defineProperty(Error.prototype, 'message', { configurable: true, enumerable: true }); Object.defineProperty(Error.prototype, 'stack', { configurable: true, enumerable: true }); Object.defineProperty(Error.prototype, 'toJSON', { value: function () { var alt = {}; Object.getOwnPropertyNames(this).forEach(function (key) { alt[key] = this[key]; }, this); return alt; }, configurable: true }); Object.defineProperty(Error.prototype, 'errCode', { configurable: true, enumerable: true }); function CustomError(errcode, err, message) { Error.captureStackTrace(this, this.constructor); this.name = 'CustomError'; this.message = message; this.errcode = errcode; this.err = err; } CustomError.prototype = Object.create(Error.prototype); I wanna convert this into node-module but I am not getting how to do that.
accepted answer: http://stackoverflow.com/a/29776703
tagged with: custom-error-handling
has title: Custom Error Class as a Node module to send custom error response
has answer: http://stackoverflow.com/a/29776470
has comment: http://stackoverflow.com/comment/47684096
tagged with: node.js
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29776703
tagged with: bluebird
upvote count: 3
tagged with: node-modules
has comment: http://stackoverflow.com/comment/47683152

http://stackoverflow.com/a/29714978
answers question: http://stackoverflow.com/q/29714598
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You need to require the dojo/query module. Also you need to change the selector property to string as shown below. new Tooltip({ connectId: query('.list-container'), selector: '.list-container-item', getContent: function(matchedNode) { console.debug('this is a tooltip for ', matchedNode); } });
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29714598
score: 1

http://stackoverflow.com/q/29784008
has comment: http://stackoverflow.com/comment/47697884
upvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29784210
answer count: 3
accepted answer: http://stackoverflow.com/a/29784439
tagged with: http://stackoverflow.com/tag/html
tagged with: css
possible better answer: http://stackoverflow.com/a/29784210
has comment: http://stackoverflow.com/comment/47698238
has body: I have a function that adds list items that all have the same id to a ul. I want to be able to click a specific list item and change the id of only the one I clicked. so I'll call the function a few times and have it spit out: thing1 thing2 thing3 then when I click thing2 the color changes from black to red. edit: in response to request for the code I tried. function addlist(){ var ask = prompt("what is the list item", "title"); document.getElementById("thing").innerHTML += "&lt;li id='vid'&gt;&lt;a href='#'&gt;" + ask+ "&lt;/a&gt;&lt;/li&gt;"; }
has comment: http://stackoverflow.com/comment/47697847
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29784155
has comment: http://stackoverflow.com/comment/47697845
has answer: http://stackoverflow.com/a/29784439
downvote count: 3
score: -3
has title: how to select a specific list item from a ul javascript
type: Question

http://stackoverflow.com/a/29696625
has body: x1 is two-way binding variable. Can you please check where the triad-line directive is used the attribute x1 does not contain {{}}. &lt;triad-line x1="{{someScopeVariable}}"&gt; Should be &lt;triad-line x1="someScopeVariable"&gt;
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47537504
answers question: http://stackoverflow.com/q/29694929
has comment: http://stackoverflow.com/comment/47531143
has comment: http://stackoverflow.com/comment/47530126

http://stackoverflow.com/comment/47557411
score: 0
type: Comment
has text: Yeah, but if you expect this the first answer would also not solve the problem. Furthermore the question was if the javascript code runs before css has been applied.
type: AnswerComment
comment on: http://stackoverflow.com/a/29710886

http://stackoverflow.com/a/29844009
upvote count: 2
answers question: http://stackoverflow.com/q/29842524
has comment: http://stackoverflow.com/comment/47814063
has body: I made it finally: To use 'gotoDate' you need to pass there string like this: self.calendarAvailable.fullCalendar('gotoDate', '2015-04-24'); and to make it automatically: this.changeViewtoAgendaDay = function(startdate) { var goto = startdate.format('YYYY-MM-DD'); self.calendarAvailable.fullCalendar('changeView', 'agendaDay'); self.calendarAvailable.fullCalendar('gotoDate', goto); } Answer for second point is simple if made for view: if(view.name=='agendaDay'){ self.showEditDateModal(); }else{ self.changeViewtoAgendaDay(calEvent.start); } Where: this.showEditDateModal = function() { $('#reservationDateModal').modal('show'); }
downvote count: 0
has comment: http://stackoverflow.com/comment/47814197
type: Answer
score: 2

http://stackoverflow.com/q/29844519
has answer: http://stackoverflow.com/a/29844566
accepted answer: http://stackoverflow.com/a/29844566
linked to: http://stackoverflow.com/q/12632463
possible better answer: http://stackoverflow.com/a/29844609
downvote count: 0
tagged with: local-storage
type: Question
type: AnsweredQuestion
score: 3
tagged with: javascript
answer count: 2
has body: I am trying to display the values that have been stored in an array within local storage. I have been able to store the values in local storage and add other values on the click of a button but I cant retrieve the values back out and display them on a page. This is my code that adds values to local storage. $("#player1Link").click(function() { if (localStorage.getItem("player1Favourite") !== null) { var a = JSON.parse(localStorage.getItem('player1Favourite')); if (a.indexOf(chosenPlayerId) === -1) { a.push(chosenPlayerId); localStorage.setItem('player1Favourite', JSON.stringify(a)); alert("Pushed in"); } else { alert("Already in favourites"); } } else { var a = []; a.push(chosenPlayerId); localStorage.setItem('player1Favourite', JSON.stringify(a)); } }) I want to be able to click a button to retrieve the values and display them on the page but I can figure out the code to go in this function. $("#playerRetrieve").click(function() {}); If anyone could help it would be much appreciated.
tagged with: arrays
tagged with: jquery
favorite count: 0
upvote count: 3
has title: Displaying Array Values From Local Storage
has answer: http://stackoverflow.com/a/29844609

http://stackoverflow.com/comment/47592807
comment on: http://stackoverflow.com/q/29729067
score: 0
type: Comment
type: QuestionComment
has text: well maybe you meant to `console.log(c)` not `b` ?

http://stackoverflow.com/comment/47824135
type: Comment
type: QuestionComment
has text: You should have posted this as an answer, I would have chosen it!
comment on: http://stackoverflow.com/q/29786546
score: 0

http://stackoverflow.com/comment/47751405
has text: @SpencerWieczorek Nope, not at all. Look at the snippet again (I've added an example). You can try this yourself, no changes to the type are needed.
type: Comment
comment on: http://stackoverflow.com/a/29811632
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47675249
comment on: http://stackoverflow.com/a/29749102
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/75814/discussion-between-r4nc1d-and-user3733831).
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47667760
comment on: http://stackoverflow.com/q/29767853
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/75787/discussion-between-mavroscy-and-chris-obrien).
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/29734523
score: 0
answer count: 2
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47602448
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29735000
has comment: http://stackoverflow.com/comment/47602700
has comment: http://stackoverflow.com/comment/47602380
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29734983
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/47602685
type: Question
tagged with: angularjs-ng-model
has comment: http://stackoverflow.com/comment/47602609
has comment: http://stackoverflow.com/comment/47602645
tagged with: javascript
has comment: http://stackoverflow.com/comment/47603046
has title: Search specific JSON data using angularjs tied to ng-model enteredData
has body: I am using Angular trying to search JSON data for a specific Name entered by user. I am passing entered data into clickButton function, using angular.forEach for iteration and pushing the key/value into results. Example: Type Sam in a form, click search and it finds all Sam JSON data. Fiddle a link! angular.module('myApp').controller('myController', ['$scope', '$http', function($scope, $http) { $scope.stuff = { "People": { "Sam":[ {"Name":"Sam", "Address":"Street","Phone":"111", "status":"Available"}], "Tom": [ {"Name":"Tom", "Address":"Road", "Phone":"222", "status":"Busy"} ]}; }; $scope.results = []; $scope.clickButton = function(enteredValue) { $scope.items = $scope.stuff.People; $scope.text='You searched for:'; angular.forEach($scope.items, function(value, key) { if (key === enteredValue) { $scope.results.push ({name: key, address: value[0].Address, phone: value[0].Phone }); } }); };

http://stackoverflow.com/comment/47540039
score: 0
type: AnswerComment
has text: You can do it only by using ExternalInterface.
comment on: http://stackoverflow.com/a/29698284
type: Comment

http://stackoverflow.com/comment/47610985
type: QuestionComment
comment on: http://stackoverflow.com/q/29738894
has text: Even if all instructions inside the function main are defered, with that loop, main will be properly called with each values of k.
score: 0
type: Comment

http://stackoverflow.com/comment/112147280
score: 0
has text: Hi, do you know how to use setTimeout instead of animate? https://stackoverflow.com/questions/63422038/highlight-a-specific-div-with-settimeout-from-a-hash-in-the-url-jquery-javascrip
type: Comment
comment on: http://stackoverflow.com/a/29857225
type: AnswerComment

http://stackoverflow.com/q/29757150
has title: Split with regular expression or custom string parsing?
type: Question
tagged with: javascript
has body: I'm looking for the most efficient way, using JavaScript, to split a string into an array of sub-strings with the following condition. The string should be split at each new occurrence of an uppercase letter from A to G. In example: String 1. 'A-7C^6' String 2. 'Db7 B#4' String 3. 'Eh6 GoF7' Becomes: Array 1. {'A-7','C^6'} Array 2. {'Db7','B#4'} Array 3. {'Eh6','Go','F7'} I'm wondering if there is a regular expression split that would accomplish this or if i will have to write a custom string parser. Any input will be greatly appreciated. Thank's in advance!
answer count: 1
has answer: http://stackoverflow.com/a/29757239
tagged with: parsing
accepted answer: http://stackoverflow.com/a/29757239
tagged with: regex
type: AnsweredQuestion
score: 0

http://stackoverflow.com/comment/47623740
type: AnswerComment
score: 0
type: Comment
has text: Yea adding 'this.removeAttribute('style'); works, it is becouse i use a standard asp.net gridview template. i added to the css background-color: #E2DED6 !Important, to make it overwrite the existed inline style and now it works like i wanted, thanks!
comment on: http://stackoverflow.com/a/29743080

http://stackoverflow.com/q/29816364
has comment: http://stackoverflow.com/comment/110051378
has answer: http://stackoverflow.com/a/29834629
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
type: Question
has body: This is a part of the JavaScript code I use: infobox.setLocation(e.target.getLocation()); infobox.setHtmlContent(myHtmlContent); infobox.setOptions({ showPointer: false, showCloseButton: true, offset: new Microsoft.Maps.Point(0, 25), visible: true }); Is it possible that the 'showCloseButton' option doesn't work when using setHtmlContent? Or am I missing something? update: By adding this code manually I'm able to close the infobox, but I'm not sure if this is the correct way to close the infobox: 'x' and the Javascript function: function closeInfobox() { infobox.setOptions({ visible: false }); }
tagged with: http://stackoverflow.com/tag/html
has title: Bing Maps infobox with htmlcontent doesn't show close button
upvote count: 1
answer count: 1
type: UnansweredQuestion
tagged with: bing-maps

http://stackoverflow.com/comment/47654175
comment on: http://stackoverflow.com/q/29761048
score: 6
has text: There's nothing wrong with `hasClass`, but it seems like you really should be using **`toggleClass`**
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47726836
type: AnswerComment
has text: True. This doesn't work cleanly for AMD though, at least if listed in the original `define` call. Using an alias is exactly like `empty:`, except i have to create the `empty` module myself.
type: Comment
comment on: http://stackoverflow.com/a/29796537
score: 0

http://stackoverflow.com/comment/47555059
comment on: http://stackoverflow.com/q/29706100
score: 0
type: Comment
type: QuestionComment
has text: Thanks for your question. I'm using media queries to take care of mobiles. I understand the outer edges of the desktop view are a no-go, I provided that last image in the reply to illustrate the answer a point of principle regarding tribe's question about usage of absolute positioning above; it is not the website just an illustration. To clarify, I am using backgrounds covering the body via css, I am attempting to use CSS to align text to visual points on that image. For example in the photo linked above imagine an asterisk that stays in the window on the 2nd floor when you resize the browser

http://stackoverflow.com/comment/47524965
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29694245
has text: Note: you need to take into caching of the script file too. Either block the entire page, or you need to ensure the script request is not cached.

http://stackoverflow.com/q/29789767
score: 1
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/53680012
has comment: http://stackoverflow.com/comment/53710797
has comment: http://stackoverflow.com/comment/86595512
linked to: http://stackoverflow.com/q/6169659
upvote count: 1
answer count: 1
has body: At the moment I cannot design the typeahead template I have with Google chrome Dev tools because when ever i open it as it's stated in Twitter Docs #Input Control Loses Focus# deactivate typeahead close dropdown menu remove hint clear suggestions from dropdown menu I do not need this behaviour. I want the dropdown to disappear only when the user click something else on the body, Any help really appreciated
has answer: http://stackoverflow.com/a/29799971
tagged with: javascript
tagged with: twitter-typeahead
tagged with: twitter
type: UnansweredQuestion
tagged with: bootstrap-typeahead
has title: Keep Twitter Typeahead suggestion dropdown open
tagged with: typeahead.js
downvote count: 0

http://stackoverflow.com/q/29784549
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47699346
answer count: 5
type: UnansweredQuestion
tagged with: node.js
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29799298
downvote count: 0
tagged with: upload
has answer: http://stackoverflow.com/a/29784634
tagged with: javascript
has answer: http://stackoverflow.com/a/29790914
tagged with: express
has body: So i'm trying to wrap my head around developing full applications with the MEAN stack (mongodb, express, angular, node.js). I understand that using express and node i can create a rest api with endpoints to grab data for my app. I also understand that angular is for FRONT END only. So my question is this... when you have something like an upload form and you want to upload an image to the server, would you want to create an api endpoint called something like "/api/upload/" and have all your logic for uploading the image inside that endpoint, or would you want all that upload logic somewhere else and then simply provide the file name to the "/api/upload/" endpoint with a post request?
has title: What is the proper place for upload logic in a MEAN stack application
has answer: http://stackoverflow.com/a/29784640
favorite count: 0
has answer: http://stackoverflow.com/a/29789391

http://stackoverflow.com/comment/47763403
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29817661
score: 0
has text: This will not affect the content in `$message`

http://stackoverflow.com/comment/47616511
type: QuestionComment
comment on: http://stackoverflow.com/q/29741161
has text: @haim770 here data is object array. object has myProperty
score: 0
type: Comment

http://stackoverflow.com/comment/47644805
type: Comment
type: QuestionComment
has text: @Kitler when I first created the about controller I had it named about.js though I got this error `Uncaught Error: Expected to find: 'controller:about' within 'blogger/controllers/about' but got 'undefined'. Did you forget to `export default` within 'blogger/controllers/about'?`
score: 0
comment on: http://stackoverflow.com/q/29755799

http://stackoverflow.com/a/29771080
score: 13
downvote count: 4
has comment: http://stackoverflow.com/comment/110899675
answers question: http://stackoverflow.com/q/29770969
has comment: http://stackoverflow.com/comment/112411364
accepted answer of: http://stackoverflow.com/q/29770969
type: AcceptedAnswer
upvote count: 17
has body: Change the slidesToScroll to a -1 (it will change the slide direction) $(function(){ $('.slider').slick({ speed: 10000, autoplay: true, autoplaySpeed: 100, cssEase: 'linear', slidesToShow: 1, slidesToScroll: -1, variableWidth: true }); });
type: Answer

http://stackoverflow.com/q/29781709
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/47693667
answer count: 0
type: UnansweredQuestion
tagged with: php
has body: I am trying to make a JS/Jquery function where a user can type in a specific quantity of a product. When the user has input a number in the "Quantity" input, that number multiplies the product price and displays it in the "Sub-Total" input. Say I have some product which is priced at $4, my problem is that when a user enters a quantity number, say 12 which would give a subtotal of $48, but then changes it to 3, it will add 3 * $4 to the $48 giving $60 in the "Sub-total" input, instead of $12 I want it to get rid of the $48.00 and only display the new sub-total, which is $12.00. Any ideas on what I can change in my function to make this functionality possible? My JavaScript code: function selectQuantity(qty) { var qtyValue = qty.value; var qtyId = qty.id; var arr = qtyId.split('_'); var productId = 'product_' + arr[1] + '_' + arr[2]; var productValue = $("#" + productId).val(); var prodprice = document.getElementById("prodprice"); var selectedValue = prodprice.options[prodprice.selectedIndex].value; if (selectedValue == "client") { $.ajax({ //create an ajax request to load_page.php type: "GET", url: "ajax_all.php?from=pos_product1&name=" + productValue, dataType: "html", //expect html to be returned success: function(response) { var price = response * qtyValue; var sub_total = $("#sub-total").val(); $("#sub-total").val((+sub_total + +price).toFixed(2)); gstmultiply($("#sub-total").val()); } }); } else { $.ajax({ //create an ajax request to load_page.php type: "GET", url: "ajax_all.php?from=pos_product&name=" + productValue, dataType: "html", //expect html to be returned success: function(response) { var price = response * qtyValue; var sub_total = $("#sub-total").val(); $("#sub-total").val((+sub_total + +price).toFixed(2)); gstmultiply($("#sub-total").val()); } }); } } And here is the specific component of my form: <?php $query = mysqli_query($dbc,"SELECT DISTINCT category FROM inventory"); echo ' Please Select '; while($row = mysqli_fetch_array($query)) { ?><option i…
has comment: http://stackoverflow.com/comment/47694027
tagged with: forms
type: Question
has title: Input Value Adds on to Previous Value When Changed
has comment: http://stackoverflow.com/comment/47693638
has comment: http://stackoverflow.com/comment/47693506
tagged with: javascript

http://stackoverflow.com/q/29727999
answer count: 3
score: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29728108
has comment: http://stackoverflow.com/comment/47589926
tagged with: object
has title: Creating objects and adding properties and methods in JavaScript
has comment: http://stackoverflow.com/comment/47590025
has answer: http://stackoverflow.com/a/29728052
has body: I have just started to study objects in javaScript and have run into some troubles. I will explain step by step what I have tried to do and will ask my questions when there is a step I don´t fully grasp. I created an object called person. Then I wanted to add a property named "firstName" with the value "Isaac". To do this, I created a constructing function. var person = new print1("Isaac") function print1(firstName) { this.firstName = firstName; } So far no problems. However, I want to make the function return "My name is " + person.firstName + "." but I cannot make it when I put it inside there. function print1(firstName) { this.firstName = firstName; return "My name is " + this.firstName + "." } My idea is that I should be able to just call person.print1() and "My name is Isaac." would appear. Why does it not work? Or can´t I even do like this? I have tried similar thing with the function below but Can´t make it work with that either. When I run it I get an error message saying "person.print2() is not a function. function print2(firstName, lastName, nationality) { this.firstName = firstName; this.lastName = lastName; this.nationality = nationality; return "My name is " + this.firstName + " " + this.lastName + " from " + this.nationality + "."; } console.log(person.print2()); person = new print2("Isaac", "Newton", "England"); Thanks for your help!
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29728170

http://stackoverflow.com/comment/47688526
type: Comment
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/29767171
has text: @stickfigure if you are interested, I also wrote an article about server-side access with the new Identity API today, since there were several questions coming in for it and the docs aren't really that extensive about it yet: http://codingwithgerwin.blogspot.co.at/2015/04/google-sign-in-20-server-side.html

http://stackoverflow.com/comment/47805992
type: QuestionComment
has text: Add one `div` in your home page and wrap it in a condition and condition would be something like if user is coming from the registration page(for that you can use [$_SERVER['HTTP_REFERER']](http://www.electrictoolbox.com/php-http-referer-variable/) then show that `div` and after some timeout you can hide that `div` with jQuery or with other JS library.
comment on: http://stackoverflow.com/q/29828973
score: 0
type: Comment

http://stackoverflow.com/q/29757416
tagged with: jquery
has comment: http://stackoverflow.com/comment/47647588
has comment: http://stackoverflow.com/comment/47647129
answer count: 1
has answer: http://stackoverflow.com/a/29757832
favorite count: 0
has body: I have the following script that works fine where it activates the button and select option based on some restrictions. &lt;script&gt; var update_selectopt=function(){ $("tr").each(function(){ if($("input[type='checkbox']", this).is(":checked")){ $('#select',this).removeAttr('disabled'); } else{ $('#select',this).attr('disabled','disabled'); } }); }; function updateSubmitButtonState(){ var enableableLineCount= 0; $("tr").each(function(){ if( isEnableableLine( this ) ) enableableLineCount++; }); if( enableableLineCount &gt; 0 ) $('[type="submit"]').removeAttr("disabled"); else $('[type="submit"]').attr("disabled","disabled"); function isEnableableLine( tr ){ if( $("input[type='checkbox']", tr).is(":checked") &amp;&amp; $("select option[value='no_action']:selected", tr ).length == 0 ) return true; else return false; } } $(update_selectopt); $("input[type='checkbox']").on("click",update_selectopt); $("input[type='checkbox']").on("click",updateSubmitButtonState ); $("select").on("change",updateSubmitButtonState ); &lt;/script&gt; But when I add the code for checking the value in array and popping an alert box if not, it is not working,also breaking the code - making the button inactive all time, select options are all active all the time. Also, I am little confused where to put the code to keep the button inactive all the time until all the conditions are not true. Complete script &lt;script&gt; var state_list_swap=["AVAILABLE","IMPAIRED"] var state_list_shut=["ERROR"] var state_list_scan=["SUSPENDED"] var update_selectopt=function(){ $("tr").each(function(){ if($("input[type='checkbox']", this).is(":checked")){ $('#select',this).removeAttr('disabled'); } else{ $('#select',this).attr('disabled','disabled'); } }); }; function updateSubmitButtonState(){ var enableableLineCount= 0; $("tr").each(function(){ if( isEnableableLine( this ) ) enableableLineCount++; }); if( enableableLineCount &gt; 0 ) $('[type="submit"]').removeAttr("disabled"); else $('[type="submit"]').attr("d…
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29757832
score: -1
has title: check if value exists in array not working
type: Question
has comment: http://stackoverflow.com/comment/47647216
upvote count: 0
tagged with: javascript

http://stackoverflow.com/q/29716260
has answer: http://stackoverflow.com/a/29716421
has body: I have the below statement that checks to see if any of the Divs with id #Drop are empty, if one is empty it shows an alert. however currently when any div has content inside it the statement no longer works. I guess what I'm trying to say is that i want it so an alert shows up if ANY div is empty. There are 4 Divs in total and if any one of them is empty the alert message should appear, it doesn't matter if for example 3 of the 4 have content the alert should trigger whenever there is an empty div. HTML: JS: $("#run").click(function(){ if ($("[id^='Drop']").html() === ""){ alert("empty")// ... } });
upvote count: 5
has title: if any Div is empty do something
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29716472
downvote count: 0
has answer: http://stackoverflow.com/a/29716347
type: Question
score: 5
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29716472
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29716355
accepted answer: http://stackoverflow.com/a/29716355
tagged with: css
answer count: 4
favorite count: 0

http://stackoverflow.com/q/29695551
score: 2
tagged with: handlebars.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47527253
has body: Hi saw that there was another post with the same title "https://stackoverflow.com/questions/27645823/referenceerror-handlebars-is-not-defined" as this but the problem does not look to be the same. I'm trying to build a single page app but I keep getting the "Uncaught ReferenceError: handlebars is not defined" error in the console. The network tab on the console looks to show that the handlebars.min.js is being loaded.
type: Question
has answer: http://stackoverflow.com/a/29695579
accepted answer: http://stackoverflow.com/a/29695579
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/27645823
upvote count: 3
downvote count: 1
has title: Uncaught ReferenceError: handlebars is not defined
favorite count: 0

http://stackoverflow.com/a/29825807
has body: The session_start() function must be the very first thing in your document. Before any HTML tags. You need to move it to index.php: <?php session_start(); ?> prototype <?php require('access.php'); ?>
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29825605
answers question: http://stackoverflow.com/q/29825605
has comment: http://stackoverflow.com/comment/47778893
upvote count: 2
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/29832123
accepted answer of: http://stackoverflow.com/q/29832013
has body: It's wrong new Vehicle({car1: {registrationNumber = "XLI887", color = "Blue" }}) and should be replaced with new Vehicle({registrationNumber: "XLI887", color: "Blue" }) or event with this {registrationNumber: "XLI887", color: "Blue" } so Collection may accept either array of Models or just array of objects with data, which will be passed to the model constructor used in collection. You can also use Collection#findWhere to return just a first found model instead of array of models like in where Also I found you forgot to add coma after default section default: { registrationNumber: "XXX-XXX", color: "beige" }, // here should be a coma
answers question: http://stackoverflow.com/q/29832013
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47790839
type: Answer
has comment: http://stackoverflow.com/comment/47791011

http://stackoverflow.com/q/29842348
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/29842383
tagged with: javascript
has comment: http://stackoverflow.com/comment/47810856
has comment: http://stackoverflow.com/comment/47810892
has answer: http://stackoverflow.com/a/29842412
has answer: http://stackoverflow.com/a/29842395
favorite count: 0
has comment: http://stackoverflow.com/comment/47811069
has title: How can I split a two part padded string into two variables with Javascript?
type: UnansweredQuestion
has body: I have a string, userName, that looks something like this: var userName = "CityOfLiverpool-----joesmith"; var userName = "Hull----------------janesmith"; The first part of userName is the Account: "CityOfLiverpool" The second part of userName is the User: "joesmith" The Account is always a maximum of 20 characters and is padded to the right with hyphens. How can I extract the Account and the User?
answer count: 4
score: 2
downvote count: 2
has answer: http://stackoverflow.com/a/29842708

http://stackoverflow.com/comment/47732319
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29802104
has text: Have you tired anything?

http://stackoverflow.com/q/29754029
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47657772
upvote count: 2
has answer: http://stackoverflow.com/a/29754778
has comment: http://stackoverflow.com/comment/47640707
type: Question
tagged with: onclick
has title: JavaScript - Animated gif to remain static until clicked?
accepted answer: http://stackoverflow.com/a/29754778
answer count: 2
score: 2
has body: I have the .gif set to loop only once and I used this tiny code to activate it on click: &lt;img src="bird.gif" onclick='this.src=this.src'/&gt; The problem, is, the gif currently plays when the page loads, which I don't want. I need the image to remain static until clicked. I could just swap a static image out with the animated one, using this: &lt;img src="bird2.gif" onclick="changeImage(this)" /&gt; &lt;script&gt; function changeImage(element) { element.src = element.bln ? "bird2.gif" : "bird.gif"; element.bln = !element.bln; } &lt;/script&gt; But then you'd have to click it twice before it will play again (like an on/off switch), which is kinda clunky and less desirable. Does anyone have any solutions? Need it to be static on load, and then it will play every time it is clicked. Thanks edit: These answers seem like the solution, but they're not working for me. The images are remaining static. I don't know what everyone else sees on their screens but I'm running in Chrome and it's just still after clicking or mousing over.
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: static
has comment: http://stackoverflow.com/comment/47804125
possible better answer: http://stackoverflow.com/a/29755049
tagged with: animated-gif
linked to: http://stackoverflow.com/q/5818003
has answer: http://stackoverflow.com/a/29755049

http://stackoverflow.com/q/29763144
answer count: 1
has body: I am trying to use Tinymice 4.1.9 to validate a textarea but my code is being handle by raw ajax since i do not know much about jquery. The problem is that when I add Tinymce 4.1.9 to my textarea, on validation, I get an empty string unless i validate twice. This is what my raw ajax that handles the validation looks like My Tinymce 4.1.9 Code The Html Form Here, unless i submit the form twice the textarea input from identification_2 does not receive anything. How to use Tinymce 4.1.9 with Raw ajax, not Jquery, and retrieve information from the identification_2 field ?
type: UnansweredQuestion
has title: How to use Tinymce 4.1.9 with Raw ajax, not Jquery
type: Question
tagged with: javascript
tagged with: ajax
tagged with: tinymce
score: 0
has answer: http://stackoverflow.com/a/30349451

http://stackoverflow.com/comment/47799948
type: Comment
type: QuestionComment
has text: You call it `SomeMethod` on the server, but `CreateDraft` in the client. This *will* cause an issue.
comment on: http://stackoverflow.com/q/29835507
score: 3

http://stackoverflow.com/comment/47693214
comment on: http://stackoverflow.com/a/29781019
score: 0
type: AnswerComment
has text: @James I show how to do this, in demo two the code for coloring a letter, demo three to draw that colored letter. In your letter-draw function, just calculate the area for the letter, use that area to fill a new color using the comp mode, then "blit" the letter to the canvas. You need to use the original canvas as source, for this reason you can an off-screen canvas (not added to the DOM). You need to load the original image using onload. All steps are shown above.
type: Comment

http://stackoverflow.com/comment/47531001
score: 0
comment on: http://stackoverflow.com/q/29697482
type: Comment
type: QuestionComment
has text: o really it's showing 88? Can you show me the result in fiddler?

http://stackoverflow.com/a/29786711
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29786575
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29786575
score: 1
has body: There shouldn't be any need to use closePath() (assuming it works the same way as with html5-canvas). All this will do is to tell canvas to connect first point with last point. moveTo() will create the necessary sub-path. Also, the calculations must be adjusted to use an inner and outer radius relative to center: onPaint: { var ctx = getContext("2d"); var x,y,rotx,roty, cx, cy, innerRadius, outerRadius, angle; ctx.reset(); ctx.beginPath(); cx = this.width/2; cy = this.height/2; innerRadius = 10; outerRadius = 100; for (var i=0;i&lt;10;i++){ angle = Math.PI*2*i/10; x = cx + innerRadius * Math.cos(angle); y = cy + innerRadius * Math.sin(angle); ctx.moveTo( x , y ) x = cx + outerRadius * Math.cos(angle); y = cy + outerRadius * Math.sin(angle); ctx.lineTo( x , y ) } ctx.lineWidth = 1; ctx.lineCap = "round"; ctx.stroke(); }
downvote count: 0

http://stackoverflow.com/comment/48155319
type: AnswerComment
comment on: http://stackoverflow.com/a/29842626
has text: @orsina it depends, what the problem is. Anyway you can just open a new question, it's the easiest way to help.
score: 0
type: Comment

gwt
tags question: http://stackoverflow.com/q/29753964
tag name: gwt
tags question: http://stackoverflow.com/q/29743214
type: Tag
tags question: http://stackoverflow.com/q/29747992
tags question: http://stackoverflow.com/q/29770911

http://stackoverflow.com/a/29764200
answers question: http://stackoverflow.com/q/29764143
has comment: http://stackoverflow.com/comment/47668000
has body: Simply reversing the string wont give the solution. Get each word. Reverse It Again rejoin var str = "This is fun, hopefully."; alert(str.split("").reverse().join("").split(" ").reverse().join(" "));
upvote count: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47660548
has comment: http://stackoverflow.com/comment/47660198
type: Answer
accepted answer of: http://stackoverflow.com/q/29764143
downvote count: 2
score: 2

http://stackoverflow.com/q/29783153
has title: Get content of some file in Firefox SDK main.js
tagged with: firefox-addon-sdk
has body: So I'm developing a Firefox addon that adds a bit of HTML to the DOM of any webpage. The idea here is that I'm using a file called template.html as a template, that is located in the data folder inside the addon folder. Next, I would like to use the contents of that template.html file inside a variable, so that I can append it to the DOM. myAddon/data/template.html: &lt;div&gt;{{test}}&lt;/div&gt; myAddon/lib/main.js: var template = ... // This is where I want to fetch the contents of template.html. pageMod.PageMod({ include: "*", // Apply script at any page contentScriptFile: [data.url("jquery-1.11.2.min.js"), data.url("main.js")], // Include jQuery and myAddon/data/main.js onAttach: function(worker){ // when these files are attached, send the content of the html-file to the script. worker.port.emit("sendTemplate", template); } }); myAddon/data/main.js self.port.on("sendTemplate", function(template){ // var template should be &lt;div&gt;{{test}}&lt;/div&gt; } I've found "Panel" in the SDK, but I do not want to show the HTML-file as a panel. Secondly, I've tried to just send the resource URL of template.html and then to $.get(templateURL) in myAddon/data/main.js, but that did not work because Firefox does not allow a resource://-file to be $.get()'d. How can I make sure that the content of an HTML-file that is saved into the addon's data folder is fetched as a string and put into a variable?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29787514
score: 4
type: Question
upvote count: 4
tagged with: firefox
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/29787514
tagged with: firefox-addon

infinite-scroll
tags question: http://stackoverflow.com/q/29741112
tag name: infinite-scroll
type: Tag
tags question: http://stackoverflow.com/q/29745388

http://stackoverflow.com/a/29732854
score: 11
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29732756
type: Answer
downvote count: 1
accepted answer of: http://stackoverflow.com/q/29732756
has comment: http://stackoverflow.com/comment/47598910
has body: Accordingly your issue the regular expression is quite simple. /\.(jpe?g|png|gif|bmp)$/i Do you really sure that nothing else will be used? For example, JPEG format allows both .jpg and .jpeg extensions. That's why I put e? pattern in the regular expression. Example of validation could be as follows: var filename = "/site/images/test.png"; if ( /\.(jpe?g|png|gif|bmp)$/i.test(filename) ) { . . . .
upvote count: 12

http://stackoverflow.com/q/29793026
has comment: http://stackoverflow.com/comment/47714730
has comment: http://stackoverflow.com/comment/47714776
has comment: http://stackoverflow.com/comment/47715425
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/3700326
linked to: http://stackoverflow.com/q/5796718
answer count: 4
has answer: http://stackoverflow.com/a/29793242
has title: Character doesn't read properly on ajax respond
type: Question
has answer: http://stackoverflow.com/a/29793276
tagged with: javascript
has answer: http://stackoverflow.com/a/29793165
tagged with: jquery
has body: I was searched any solutions but still not help. That problem is about read character. How to read characters which come from ajax respond? this is the output from ajax, as JSON object: ["label" : "Item1", "value" : "TOP &amp;amp; HEAD"] ideal output should be like this: ["label" : "Item1", "value" : "TOP &amp; HEAD"] this is the success function : success: function(data){ // what code should be added so it can be read the character properly? console.log(data); response(data); } Need advice for it please..
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/47716023
has answer: http://stackoverflow.com/a/29793114

http://stackoverflow.com/comment/47546174
score: 0
has text: It may be anything but odd. :)
comment on: http://stackoverflow.com/q/29705295
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47601509
type: QuestionComment
type: Comment
has text: do you want to remove `none` class from `li` ?
comment on: http://stackoverflow.com/q/29734036
score: 0

http://stackoverflow.com/a/29744411
has comment: http://stackoverflow.com/comment/47624893
has body: Instead of parsing JSON string in JavaScript, pass it directly to PHP and use PHP function json_decode($json, true) it will give you data in array format.
has comment: http://stackoverflow.com/comment/47622317
has comment: http://stackoverflow.com/comment/47623558
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29744340
has comment: http://stackoverflow.com/comment/47622372

http://stackoverflow.com/q/29721851
upvote count: 4
answer count: 2
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47578420
has comment: http://stackoverflow.com/comment/47578575
has answer: http://stackoverflow.com/a/29722291
tagged with: node.js
has comment: http://stackoverflow.com/comment/47578649
has title: how to pause and unpause node object stream while processing its output
type: AnsweredQuestion
score: 4
accepted answer: http://stackoverflow.com/a/29722291
has answer: http://stackoverflow.com/a/29723246
tagged with: stream
tagged with: coffeescript
type: Question
has comment: http://stackoverflow.com/comment/47578965
possible better answer: http://stackoverflow.com/a/29723246
has body: I'm currently processing a file stream line by line by running it through a transform stream that emits 'line' events. I would like to be able to, upon finding that the current line matches some criteria, pause the input file stream, start processing a new stream, and when that is finished, resume processing the original stream line by line. I've condensed it down to a minimal example below: test.coffee: fs = require 'fs' TestTransform = require './test-transform' inStream = new TestTransform fs.createReadStream("./test.coffee").pipe(inStream) inStream.on 'line', (line) -&gt; process.stdout.write "--&gt;" if line.match /line\.match/g process.stdout.write line console.error "PAUSE" inStream.pause() fs.createReadStream("./test.coffee").pipe(process.stdout).on 'end', -&gt; console.error "UNPAUSE" inStream.resume() else process.stdout.write line test-transform.coffee: Transform = require('stream').Transform module.exports = class TestTransform extends Transform constructor: -&gt; Transform.call @, readableObjectMode: true @buffer = "" pushLines: -&gt; newlineIndex = @buffer.indexOf "\n" while newlineIndex isnt -1 @push @buffer.substr(0, newlineIndex + 1) @emit 'line', @buffer.substr(0, newlineIndex + 1) @buffer = @buffer.substr(newlineIndex + 1) newlineIndex = @buffer.indexOf "\n" _transform: (chunk, enc, cb) -&gt; @buffer = @buffer + chunk.toString() @pushLines() cb?() _flush: (cb) -&gt; @pushLines() @buffer += "\n" # ending newline @push @buffer @emit 'line', @buffer # push last line @buffer = "" cb?() (Don't worry about the Transform stream too much, it's just an example.) Anyway, the output of coffee test.coffee looks like: --&gt;fs = require 'fs' --&gt; --&gt;TestTransform = require './test-transform' --&gt; --&gt;inStream = new TestTransform --&gt; --&gt;fs.createReadStream("./test.coffee").pipe(inStream) --&gt; --&gt;inStream.on 'line', (line) -&gt; --&gt; process.stdout.write "--&gt;" --&gt; if line.match /line\.match/g PAUSE --&gt; process.stdout.write line --&…
tagged with: javascript

http://stackoverflow.com/q/29739838
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
downvote count: 1
has title: Capturing/Saving the current state of d3.js Sunburst Chart
type: Question
linked to: http://stackoverflow.com/q/29846745
tagged with: javascript
has body: I am a newbie to d3.js . I am working in d3.js zoomable sunburst chart http://bl.ocks.org/mbostock/4348373. When the user zoom into a particular arc and I need to capture this state of the sunburst diagram . When the user comes back to the sunburst diagram or load the graph again he should see the state where he left. Note : I dont want to serialise the svg elements to show the state of the sunburst. If i serialise it then the chart will be static and user cant click on the sunburst and traverse to other arcs. Proposed Solution : one solution came to my mind is simulate mouse clicks on the sunburst nodes till the last node user looks into. I am not able to devise an algorithm for this . Please guide me whether any other solution is possible ..
score: 0
upvote count: 1
answer count: 1
tagged with: sunburst-diagram
favorite count: 0
has answer: http://stackoverflow.com/a/29817728
accepted answer: http://stackoverflow.com/a/29817728
linked to: http://stackoverflow.com/q/29824385

http://stackoverflow.com/q/29695414
has answer: http://stackoverflow.com/a/29695491
has answer: http://stackoverflow.com/a/29695648
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29695491
answer count: 2
favorite count: 0
upvote count: 9
tagged with: angularjs
has body: AngularJS application: The ng-model directives bind the input fields to the controller properties.In my application the inputs with spaces are ignored, for example : " A",the resulting output is "A". Is there a way to include those white spaces as well ? Fiddled here Thanks
has title: why white space are getting ignored in AngularJS application
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/29695648
linked to: http://stackoverflow.com/q/9046113
type: Question
score: 9

http://stackoverflow.com/q/29729588
tagged with: javascript
has comment: http://stackoverflow.com/comment/47593010
tagged with: jquery-events
answer count: 1
downvote count: 0
has body: I have some elements that I want to hide once document body is clicked. This code came from an answer given in Stack Overflow: $(document).mouseup(function (e){ var container = $(".time-stamp, .full-name, .comment-box-wrapper .search-result"); if (!container.is(e.target) // if the target of the click isn't the container... && container.has(e.target).length === 0) // nor a descendant of the container { container.hide(); } }); It works fine but my page displays 10 different articles at a time and each article has textbox (comment-box) which are wrapped in comment-box-wrapper and attached to each articles where users can submit their comments. These comment boxes are set to hidden by default until a user clicks on Comment button. The problem is if a user has entered some text in the comment box and clicks elsewhere, the comment-box gets set to hidden and the content is lost completely. How can I cancel .hide() if comment-box already has some content in it?
accepted answer: http://stackoverflow.com/a/29729783
tagged with: jquery
favorite count: 0
has title: Hide an element on mouseup except when it has a content
has comment: http://stackoverflow.com/comment/47592846
has comment: http://stackoverflow.com/comment/47592669
has comment: http://stackoverflow.com/comment/47592967
has answer: http://stackoverflow.com/a/29729783
linked to: http://stackoverflow.com/q/1299424
score: 1
has comment: http://stackoverflow.com/comment/47592779
upvote count: 1
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47592965

http://stackoverflow.com/comment/47770753
type: Comment
type: QuestionComment
has text: near duplicate (subset, actually) of the poorly named http://stackoverflow.com/questions/29376702/tail-function-in-javascript
comment on: http://stackoverflow.com/q/29822008
score: 0

http://stackoverflow.com/q/29764080
has answer: http://stackoverflow.com/a/29764761
upvote count: 0
score: -2
tagged with: javascript
favorite count: 0
has body: My question pretty basic, it's written up there. How to make a div slide in from outside of the window onload? For example, it may appear from the right side of the window. And I actually need basic javascript code, not jQuery. Thank you
has answer: http://stackoverflow.com/a/29764922
has title: how to make a div slide in from outside of the window, on load (javascript)?
type: UnansweredQuestion
downvote count: 2
type: Question
answer count: 2

http://stackoverflow.com/comment/47748595
score: 0
has text: @Barmar Thank you. I am making the correction now. I had misread the data from the server.
type: Comment
comment on: http://stackoverflow.com/q/29810169
type: QuestionComment

http://stackoverflow.com/comment/47617716
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29742209
has text: From an api, but its not the requirement to send unique from the api. @sgt

http://stackoverflow.com/comment/47572758
type: AnswerComment
score: 0
type: Comment
has text: i'd give you 2^'s if i could. :)
comment on: http://stackoverflow.com/a/29719141

http://stackoverflow.com/comment/47687841
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29778725
has text: There is no reason not to use `.bind` if you can.

http://stackoverflow.com/q/29828412
linked to: http://stackoverflow.com/q/29699109
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/37474093
upvote count: 1
downvote count: 1
duplicate of: http://stackoverflow.com/q/29699109
has comment: http://stackoverflow.com/comment/47783402
has answer: http://stackoverflow.com/a/32291786
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47784385
has body: I was trying node's generator functions and getting issue when used with event listener callback. Please check the code I am using function* fileLineByLine(file){ var fs = require('fs'), readline = require('readline'); var rd = readline.createInterface({ input: fs.createReadStream(file), output: process.stdout, terminal: false }); yield rd.on('line') } console.log(fileLineByLine('test.csv').next()) Anybody have an idea?
tagged with: javascript
has comment: http://stackoverflow.com/comment/99786177
favorite count: 0
score: 0
has comment: http://stackoverflow.com/comment/47785175
has title: Node.js generator function on event listener callbacks
tagged with: node.js
tagged with: generator

http://stackoverflow.com/a/29723562
has comment: http://stackoverflow.com/comment/47581412
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29723473
has body: The correct string to use is hue-rotate, not hueRotate. The following should work: quickID("bgImage").style.webkitFilter = "hue-rotate(" + newHue + "deg)";
accepted answer of: http://stackoverflow.com/q/29723473
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47581364

http://stackoverflow.com/q/29712651
tagged with: audio-streaming
tagged with: javascript
has comment: http://stackoverflow.com/comment/47561759
upvote count: 1
answer count: 1
has body: Background: I am developing an Android mobile application where users record audio in the app then upload it to a server, where it can be streamed back to the community. Up until now we have used .WAV format which outputs a pretty large file size for uploading and streaming over mobile networks. I'm working on converting to .AAC format but I've learned about a few different problems that happen in different manufacturers. Issues: All Android phones (API-15+) tested so far are able to record audio in AAC okay. However, Samsung devices will not directly play back AAC audio files using the MediaPlayer. Instead they need to be encoded in AAC but of the OutputFormat .MP4 AAC audio files in .MP4 containers record perfectly and playback on all devices tested. Files upload fine to the server. Then here is the main problem. When streaming the file to the audio player, the sound player fails to decode audio recorded on Samsung devices only. AAC files recorded on Motorola and Nexus phones are perfectly interchangeable with the previous WAV files. I am able to play the sound files directly on my desktop, and if I open the file directly in a web browser they will all play. This problem happens when I stream and decode the audio using AudioContext. I believe the problem is related to missing header data from the Samsung audio codec, but I've invested a lot of time in this problem and haven't been able to find a solution that works yet. This problem seems straight forward but it's taken me a lot of work to figure out exactly what the problem is. Any help is MUCH appreciated. Two approaches that I see are: 1. Fix the encoding problem at the source in the Android application 2. Correct for the error in the browser. I've seen posts about using a function attempt to re-sync the stream but I do not fully understand how to implement this. I think the best solution is #1. I downloaded two example files in the browser and looked at the raw data for comparison. (Snapshot of raw data https:…
favorite count: 0
tagged with: html5-audio
type: UnansweredQuestion
tagged with: android
has comment: http://stackoverflow.com/comment/47579878
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47573703
has comment: http://stackoverflow.com/comment/47560866
has answer: http://stackoverflow.com/a/44139003
type: Question
has title: Audio encoding issues in certain Android devices for online streaming playback
tagged with: android-mediarecorder

http://stackoverflow.com/q/29786524
has body: I'd like to know if it's possible to disable the skip login option that appears when you get the login popup for a payment. It's the option that says: For faster checkout, skip login for future purchases using this computer. I've been fighting with JavaScript for a while now, and gotten most of what I need done, including automatically closing the window after a timeout. It would be nice if PayPal included a way to inject approved code into your login page if you're using an app, so that way you can do custom things with it. Maybe something such as check for inactivity and auto close.
tagged with: paypal
type: Question
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29929013
has title: Disable the skip login option on PayPal API
type: UnansweredQuestion

http://stackoverflow.com/comment/47799572
has text: Can you explain about this regular expressions and how it works? /dur=(.*?)(\s|$)/ - what does it mean? If dur=90 or -200 will it be work? And if I will need 16 strings of data-* and will it work with that?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29828771

http://stackoverflow.com/comment/47755276
score: 0
has text: I have added the html file, thank you for your help
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29813755

http://stackoverflow.com/comment/47635586
score: 0
has text: Yes that's what I used to figure out the above...
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29751608

http://stackoverflow.com/comment/47794199
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29832744
has text: Does this example work for you? https://google-developers.appspot.com/maps/documentation/javascript/examples/full/layer-data-simple
score: 0

http://stackoverflow.com/q/29823616
has comment: http://stackoverflow.com/comment/47773681
type: Question
has answer: http://stackoverflow.com/a/29823707
favorite count: 0
has answer: http://stackoverflow.com/a/29823673
answer count: 2
possible better answer: http://stackoverflow.com/a/29823673
accepted answer: http://stackoverflow.com/a/29823707
downvote count: 3
has title: javascript simple for loop
tagged with: for-loop
type: AnsweredQuestion
upvote count: 0
tagged with: javascript
score: -3
has body: var friends = ["Miha", "Artur", "Karen", "zollex"]; var len = friends.length; var friend = 0; var msg = ''; var i; for (i = 0; i &lt;len; i++){ friend = (i + 1); msg+= "Friend number " + friend + ":"; msg+=friends[i] + "&lt;br /&gt;"; document.write(msg); } I have the following code written above. And it outpust following result: Friend number 1:Miha Friend number 1:Miha Friend number 2:Artur Friend number 1:Miha Friend number 2:Artur Friend number 3:Karen Friend number 1:Miha Friend number 2:Artur Friend number 3:Karen Friend number 4:zollex While there should have been only 4 friends.Im really curious why the document.write repeats same name multiple times.

http://stackoverflow.com/q/29777617
tagged with: modal-dialog
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47685844
has comment: http://stackoverflow.com/comment/47685697
score: 0
has comment: http://stackoverflow.com/comment/48659950
has answer: http://stackoverflow.com/a/29777939
has title: Multiple modals in one page
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47686059
has comment: http://stackoverflow.com/comment/47685771
has answer: http://stackoverflow.com/a/68423152
type: Question
answer count: 2
has body: I'm trying to get multiple modals (popup thingies) in one page. One button will let you see what subject you have, and when you click on it an modal will open and show you at what time and what the homework was. The other button will let you add new data, and a modal will open that let you add new data. The new data modal is made first. But now I have the problem that when I click the subject button the modal of the new data button will appear, and I have no idea why. This is the code: &lt;script type="text/javascript"&gt; $(document).ready(function(){ $(".btn").click(function(){ $("#myModal1").modal('show'); }); }); &lt;/script&gt; modal one! &lt;a href="#myModal1" class="btn btn-lg btn-primary"&gt;Nieuwe taak toevoegen&lt;/a&gt; &lt;div id="myModal1" class="modal fade"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt; &lt;h4 class="modal-title"&gt;Nieuwe taak toevoegen&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;table&gt; &lt;tr&gt; &lt;form id="form1" action="&lt;?php $_SERVER['PHP_SELF'];?&gt;" method="POST"&gt; &lt;td&gt;Naam voor afspraak:&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="afspraak"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;/br&gt;Omschrijving: &lt;/td&gt; &lt;td&gt;&lt;textarea cols="34" rows="5" name="description"&gt;&lt;/textarea&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Datum:&lt;/td&gt; &lt;td&gt; &lt;select name="day"&gt; &lt;?php //Selecteerd als eerste de dag van vandaag echo "&lt;option selected&gt;" .Date('d')."&lt;/option&gt;"; for($i = 1; $i &lt;=31; $i++) { echo '&lt;option value="'.$i.'"&gt;'.$i.'&lt;/option&gt;'; } ?&gt; &lt;/select&gt; &lt;select name="month"&gt; &lt;?php //Selecteerd als eerste de maand van vandaag echo "&lt;option selected&gt;" .Date('m')."&lt;/option&gt;"; for($i = 1; $i &lt;=1…
has comment: http://stackoverflow.com/comment/47685895

http://stackoverflow.com/a/29735010
type: Answer
score: 2
upvote count: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29731703
has body: Looks like you want this API: https://msdn.microsoft.com/en-us/library/windows/apps/windows.media.devices.torchcontrol.ASPx dev.windows.com is the place to go for the WinRT API reference, where you can find how to do things like this. They also have a pretty extensive sample library.

http://stackoverflow.com/comment/47529198
has text: @IanFraser If this solves the current problem, you should probably leave it as it is and post a new question for a new problem.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29696020
type: Comment

http://stackoverflow.com/q/29811745
downvote count: 0
has comment: http://stackoverflow.com/comment/47751376
score: 1
favorite count: 0
possible better answer: http://stackoverflow.com/a/29811768
answer count: 3
tagged with: object-literal
has answer: http://stackoverflow.com/a/29811768
has body: I am trying to use an addition assignment operator within a javascript object in order to add up the number of votes in a student election. Given the following: var votes = { "Alex": { president: "Bob", vicePresident: "Devin", secretary: "Gail", treasurer: "Kerry" }, "Bob": { president: "Mary", vicePresident: "Hermann", secretary: "Fred", treasurer: "Ivy" }, "Cindy": { president: "Cindy", vicePresident: "Hermann", secretary: "Bob", treasurer: "Bob" }, "Devin": { president: "Louise", vicePresident: "John", secretary: "Bob", treasurer: "Fred" }, "Ernest": { president: "Fred", vicePresident: "Hermann", secretary: "Fred", treasurer: "Ivy" }, "Fred": { president: "Louise", vicePresident: "Alex", secretary: "Ivy", treasurer: "Ivy" }, "Gail": { president: "Fred", vicePresident: "Alex", secretary: "Ivy", treasurer: "Bob" }, "Hermann": { president: "Ivy", vicePresident: "Kerry", secretary: "Fred", treasurer: "Ivy" }, "Ivy": { president: "Louise", vicePresident: "Hermann", secretary: "Fred", treasurer: "Gail" }, "John": { president: "Louise", vicePresident: "Hermann", secretary: "Fred", treasurer: "Kerry" }, "Kerry": { president: "Fred", vicePresident: "Mary", secretary: "Fred", treasurer: "Ivy" } }; I am trying to preform a for/in loop in order to count and create a new object with the names of candidates and the number of votes they have: var President = {}; for (var student in votes) { President[votes[student].president] += 1; }; Which, as you probably already know, gives me all NaN values. How do I get the key of the property to increase for each iteration?
has answer: http://stackoverflow.com/a/29811784
upvote count: 1
has answer: http://stackoverflow.com/a/29811791
has title: Javascript Object Addition Assignment Operator
type: AnsweredQuestion
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29811784
type: Question

http://stackoverflow.com/a/29816066
type: Answer
answers question: http://stackoverflow.com/q/29814761
downvote count: 0
has body: Working Fine Now Check $data='[{"message":"Test+sms","sender":"EXECUT","billcredit":"0.00","messageStatus":"DND","sendondate":"2015-04-22 15:22:00","provider":"aaaa"},{"message":"Test+sms","sender":"EXECUT","billcredit":"0.00","messageStatus":"DND","sendondate":"2015-04-22 15:22:00","provider":"aaa"},{"message":"Test+sms","sender":"EXECUT","billcredit":"1.00","messageStatus":"DELIVRD","sendondate":"2015-04-22 15:22:00","provider":"aaaa"},{"message":"Test+sms","sender":"EXECUT","billcredit":"1.00","messageStatus":"DND REJECTED","sendondate":"2015-04-22 15:22:00","provider":"aaaa"}]'; $objs = json_decode($data, true); foreach ($objs as $obj){ $repor= $obj['messageStatus']; echo $repor." "; } I have placed only single quotation around json array. Nothing more.
score: 1
upvote count: 1

http://stackoverflow.com/a/29698702
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/29698592
upvote count: 1
has body: Try this: $( "#indexHero" ).click(function(){ if($("#tabNo1").hasClass("active")) { $( "#testID1, #testID2" ).addClass( "hideMe" ); $( "#testID3" ).removeClass( "hideMe" ); } });

http://stackoverflow.com/comment/47561750
comment on: http://stackoverflow.com/q/29712336
type: QuestionComment
has text: I tried it earlier and it made everything stop working completely. Will try again in a minute.
score: 0
type: Comment

http://stackoverflow.com/q/29694292
type: Question
has answer: http://stackoverflow.com/a/29694325
tagged with: javascript
has body: I need to parse a string based on a regular expression and return a collection of strings. The string I need to parse resembles the following: "NM2RAJ/Fred MR(IR1234)/MISAMISS1BLACK/DROID MR 1BROWN/JACK(IECSL/HALDUW/13JUN12)" From the above string I would like to return an array that contains the following strings from the original: O/P=&gt; array temp=["NM","RAJ/Fred MR(IR1234)/MISAMISS","BLACK/DROID MR ","BROWN/JACK(IECSL/HALDUW/13JUN12)"] The data should be partitioned on numbers which are not contained in parentheses.
score: 0
tagged with: split
answer count: 1
has comment: http://stackoverflow.com/comment/47525012
accepted answer: http://stackoverflow.com/a/29694325
favorite count: 0
has title: How do I split a string with complex delimiters using regex?
tagged with: regex
type: AnsweredQuestion
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/60089497
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29902275
score: 3
has text: This would have the side-effect of exposing all of the user's information to the user, which you might not want to do.

http://stackoverflow.com/comment/107004904
type: Comment
comment on: http://stackoverflow.com/a/53272696
has text: I followed the official tutorial of https://spring.io/guides/gs/messaging-stomp-websocket/ and add .withSockJS(). Removing it helped since I only want to use the library StompJS in my case
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47632028
has text: Yes, I'm pretty sure it's the built-in constructors, `Math`, etc.
comment on: http://stackoverflow.com/q/29749894
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29702583
type: Question
has comment: http://stackoverflow.com/comment/47541322
has comment: http://stackoverflow.com/comment/47541842
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/47543629
answer count: 1
tagged with: uislider
tagged with: javascript
has comment: http://stackoverflow.com/comment/47543966
score: 0
has body: I would like the number of steps to be 12 in total, but for the equal distance interval to be determined upon the min and the max variables. Any help or a point in the right direction in achieving this would be greatly appreciated. Below is my Javascript/jQuery code: // Have the user input their medical bill amount var originalAmount = prompt('What is the amount of your medical bill?'); console.log(originalAmount); // Take off 20% of the medical bill for a discount var discountAmount = originalAmount * .20; console.log('Your discount is 20%, which is ' + discountAmount + ' in savings.'); // Declare what the new amount owed is after taking the discount off var newAmount = originalAmount - discountAmount; console.log('Your new amount owed for your bill is ' + newAmount + ' .'); // First step-payment is calculated by dividing the amount of the bill into twelve months var firstStep = Math.round(newAmount / 12 *100)/100; // Last step-payment is calculated by dividing the amount of the bill into two months var lastStep = Math.round(newAmount / 2 *100)/100; // Calculate middle steps to be divisible by 12 months var middleSteps = Math.round(newAmount / 12 *100)/100; // jQuery function for the slider $(function() { $( "#slider" ).slider({ min: firstStep, max: lastStep, step: middleSteps, slide: function( event, ui ) { $( "#amount" ).val( "$" + ui.value ); } }); $( "#amount" ).val( "$" + $( "#slider" ).slider( "value" ) ); });
has title: jQuery UI slider - Number of steps to be 12, with different numerical jumps based upon max/min variables
has comment: http://stackoverflow.com/comment/47541905
has comment: http://stackoverflow.com/comment/47543335
type: UnansweredQuestion
tagged with: jquery-ui-slider
has answer: http://stackoverflow.com/a/29705562

http://stackoverflow.com/comment/47654250
score: 0
type: AnswerComment
has text: @CrayonViolent the OP wants spaces around the pipes, although it's not clear whether multiple spaces, or newlines etc are allowed. Might be safter to go with `/ | /`.
type: Comment
comment on: http://stackoverflow.com/a/29760997

http://stackoverflow.com/comment/47784911
score: 0
type: Comment
type: QuestionComment
has text: try adding an event in the declaration @(Html.Kendo().Upload().Name('EventFiles')).Events("onComplete") and create a function for onComplete in javascript which will be called once the upload is complete
comment on: http://stackoverflow.com/q/29828856

http://stackoverflow.com/a/29837934
upvote count: 5
has body: funky needs to be a "higher-order" function which "transforms" your input function into one that runs only the first n times: function funky(fn, n) { return function() { return n-- &gt; 0 ? fn.apply(this, arguments) : "No more"; }; } Here, we've used fn.apply to allow the user to pass through this and arguments to the returned function, so you can do things like: var hey = funky(function(name){ alert("hey " + name); }, 3); hey("Bob"); // alert("hey Bob") hey("Joe"); // alert("hey Joe") hey("Sam"); // alert("hey Sam") hey("Don"); // no alert, returns "No more" Passing arguments to the derived function is useful enough, but in what situations does it matter that it would honor this? Obviously only if objects and their methods are involved. Consider: // Constructor to create new MyAlerter object, with magic number var MyAlerter = function(magic) { this.magic = magic; } // Method on MyAlerter to put up alert with magic number MyAlerter.prototype.alert = function(name) { alert("hey " + name + ", your magic number is " + this.magic); }; Now we want to make a function/method hey, based on the alert method, which restricts the number of calls to three. We already have the funky function to do that: MyAlerter.prototype.hey = funky(MyAlerter.prototype.alert, 3); Now we can do this: var alerter = new MyAlerter(42); alerter.hey("Bob"); // alert("hey Bob, your magic number is 42") alerter.hey("Joe"); // alert("hey Joe, your magic number is 42") alerter.hey("Sam"); // alert("hey Sam, your magic number is 42") alerter.hey("Don"); // no alert, returns "No more" By passing through the this with which hey is called to the underlying function alert, as accomplished by the fn.apply inside funky, alert receives the proper this and is able to access the magic number.
score: 5
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29837780
has comment: http://stackoverflow.com/comment/47802578
has comment: http://stackoverflow.com/comment/47807344
accepted answer of: http://stackoverflow.com/q/29837780
type: Answer
has comment: http://stackoverflow.com/comment/47802442

http://stackoverflow.com/comment/47652521
type: QuestionComment
comment on: http://stackoverflow.com/q/29760049
score: 0
type: Comment
has text: Is that a vertical or horizontal scroll?

http://stackoverflow.com/comment/47762255
has text: @rockerest By the way, I don't succeed to use myLib.LayoutModule, I'm probably doing something wrong, should I use require optimizer with a sort of AMD wrap ?
type: Comment
comment on: http://stackoverflow.com/a/29778270
score: 0
type: AnswerComment

http://stackoverflow.com/q/29795566
has answer: http://stackoverflow.com/a/44045781
tagged with: javascript
tagged with: jquery
score: 6
has answer: http://stackoverflow.com/a/29796320
has title: Show bootstrap glyphicon in link when hovering
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/29795949
favorite count: 0
has body: I'm trying to show a bootstrap glyphicon on the rigth side on my link when I am hovering it. I've tried using both CSS an JS but it just wont work. So i need som help :) This is what I am trying to do: When i hoover Foo, I want the pencil icon to show. And so on. The same is going to happen when i hoover 'Bar' and 'This is a link' also I also want it to be a button. This is how the html looks like: Foo Bar This is a link Thank you for your help :)
has answer: http://stackoverflow.com/a/29795949
type: Question
has comment: http://stackoverflow.com/comment/47719677
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29796320
tagged with: css
upvote count: 6
answer count: 3
has comment: http://stackoverflow.com/comment/47719440

http://stackoverflow.com/q/29800010
has comment: http://stackoverflow.com/comment/47760776
possible better answer: http://stackoverflow.com/a/77035152
favorite count: 0
has title: Can someone comprehensively explain the WebRTC stats API?
has comment: http://stackoverflow.com/comment/104829845
has answer: http://stackoverflow.com/a/77035152
has body: I'm finishing a WebRTC project for a graduate course in video communications, it's essentially a video conference chat room. Everyone that connects to the server is added to the conference. I need to use the stats API in WebRTC to show some relevant performance statistics for each RTCPeerConnection (packets lost per second, jitter, retransmission, etc). This helps to observe performance cost as more peers are added to the conversation. However the API seems to not be fully fleshed out yet. It's apparently gone through some refreshes and doesn't quite match up to some W3C specs I've seen (though perhaps it's out of date or I just don't understand nuances of reading the spec, neither would surprise me). My invocation of the API is similar to this one, but interpreting the data isn't straightforward. For instance when looping through all items in RTCStatsReport::results(), many of them have duplicate names and confusing values. I can't seem to find any information about their meaning. If anyone can assist me in understanding some of the important ones or point me to the lost city of gold (e.g. proper documentation), I'd be grateful.
upvote count: 17
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29840886
accepted answer: http://stackoverflow.com/a/29840886
score: 17
has comment: http://stackoverflow.com/comment/47781412
type: Question
answer count: 2
downvote count: 0
tagged with: webrtc
tagged with: javascript
has comment: http://stackoverflow.com/comment/47783333
linked to: http://stackoverflow.com/q/25069419

http://stackoverflow.com/q/29719631
has answer: http://stackoverflow.com/a/78432236
possible better answer: http://stackoverflow.com/a/42787232
has answer: http://stackoverflow.com/a/49118472
has answer: http://stackoverflow.com/a/65021485
has answer: http://stackoverflow.com/a/75621768
has answer: http://stackoverflow.com/a/47781245
type: Question
accepted answer: http://stackoverflow.com/a/63377110
has answer: http://stackoverflow.com/a/64601772
upvote count: 377
answer count: 32
tagged with: javascript
has answer: http://stackoverflow.com/a/59654333
has answer: http://stackoverflow.com/a/77047187
has answer: http://stackoverflow.com/a/70791897
has answer: http://stackoverflow.com/a/60718240
has answer: http://stackoverflow.com/a/62152832
has comment: http://stackoverflow.com/comment/123482360
has answer: http://stackoverflow.com/a/73834753
has answer: http://stackoverflow.com/a/76741399
has answer: http://stackoverflow.com/a/63377110
has answer: http://stackoverflow.com/a/69123372
has answer: http://stackoverflow.com/a/67438062
has title: How do I set a mock date in Jest?
has answer: http://stackoverflow.com/a/55627255
has answer: http://stackoverflow.com/a/56267318
has answer: http://stackoverflow.com/a/67683520
has answer: http://stackoverflow.com/a/50693559
tagged with: momentjs
favorite count: 0
has answer: http://stackoverflow.com/a/60274927
has answer: http://stackoverflow.com/a/74122438
has body: I'm using moment.js to do most of my date logic in a helper file for my React components but I haven't been able to figure out how to mock a date in Jest a la sinon.useFakeTimers(). The Jest docs only speak about timer functions like setTimeout, setInterval etc but don't help with setting a date and then checking that my date functions do what they're meant to do. Here is some of my JS file: var moment = require('moment'); var DateHelper = { DATE_FORMAT: 'MMMM D', API_DATE_FORMAT: 'YYYY-MM-DD', formatDate: function(date) { return date.format(this.DATE_FORMAT); }, isDateToday: function(date) { return this.formatDate(date) === this.formatDate(moment()); } }; module.exports = DateHelper; and here is what I've set up using Jest: jest.dontMock('../../../dashboard/calendar/date-helper') .dontMock('moment'); describe('DateHelper', function() { var DateHelper = require('../../../dashboard/calendar/date-helper'), moment = require('moment'), DATE_FORMAT = 'MMMM D'; describe('formatDate', function() { it('should return the date formatted as DATE_FORMAT', function() { var unformattedDate = moment('2014-05-12T00:00:00.000Z'), formattedDate = DateHelper.formatDate(unformattedDate); expect(formattedDate).toEqual('May 12'); }); }); describe('isDateToday', function() { it('should return true if the passed in date is today', function() { var today = moment(); expect(DateHelper.isDateToday(today)).toEqual(true); }); }); }); Now these tests pass because I'm using moment and my functions use moment but it seems a bit unstable and I would like to set the date to a fixed time for the tests. Any idea on how that could be accomplished?
score: 377
tagged with: jestjs
has answer: http://stackoverflow.com/a/75954379
has answer: http://stackoverflow.com/a/75084639
has answer: http://stackoverflow.com/a/78618982
has answer: http://stackoverflow.com/a/74186251
has answer: http://stackoverflow.com/a/42787232
has answer: http://stackoverflow.com/a/30835183
has answer: http://stackoverflow.com/a/57985358
has answer: http://stackoverflow.com/a/60171861
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/76539082
downvote count: 0
has answer: http://stackoverflow.com/a/68648628

http://stackoverflow.com/comment/47701850
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29786046
type: Comment
has text: "self-executing anonymous function" --- is technically incorrect term, since it does not self execute itself.

http://stackoverflow.com/comment/47684595
comment on: http://stackoverflow.com/a/29775962
type: AnswerComment
has text: Very nice plugin, for now I just want to stick with my function because on the plugin you showed me, user have to click to the button to keep staying, but I want that user can just move the mouse or press any thing => the alert goes away and they are back on. Have any idea how to make the counting down number on the code work?
score: 0
type: Comment

http://stackoverflow.com/q/29748661
has answer: http://stackoverflow.com/a/29748777
has body: In JavaScript with a regexp I must extract from a long string of text the text contained between two strings "---ST---" and "---EN---", so for example, my text string is: ---ST---blah blah blah---EN--- other text ---ST--- foo bar baz ---EN--- other other text ---ST---the cat is on the table---EN--- and I must get for every ---ST---/---EN--- couple found an object like this: [{textFound:"blah blah blah", startsAt:0, endsAt:22}, {textFound:" foo bar baz ", startsAt:42, endsAt:64}, ...] I tried the following but it doesn't work: function getSTEN(input){ var r =[]; var expression = /---ST---(.*?)---EN---/gi; var matches = input.match(expression); for(match in matches) { var result = {}; result['textFound'] = matches[match]; result['startsAt'] = input.indexOf(matches[match]); //... }; return r; }; var str = "---ST---blah blah blah---EN--- other text ---ST--- foo bar baz ---EN--- other other text ---ST---the cat is on the table---EN---"; console.log(getSTEN(str)); Can you help me?
has title: Regex to find text contained between two different strings and their position in the input string
tagged with: javascript
has answer: http://stackoverflow.com/a/29750013
has answer: http://stackoverflow.com/a/29749543
has answer: http://stackoverflow.com/a/29748956
tagged with: regex
answer count: 4
tagged with: text
type: AnsweredQuestion
tagged with: extract
possible better answer: http://stackoverflow.com/a/29748777
type: Question
linked to: http://stackoverflow.com/q/432493
accepted answer: http://stackoverflow.com/a/29750013
score: 0

http://stackoverflow.com/comment/47572258
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29718752
has text: @ThanasisGrammatopoulos I'm not really sure what you're saying. Are you saying the regex doesn't produce the same results as the original logic? If so, the test case (the HTML for the ` ` in question) would be more useful than the JS code you posted.

http://stackoverflow.com/q/29820607
has answer: http://stackoverflow.com/a/29821081
tagged with: typescript
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has body: I'm having issues with type definitions (td) versioning. Could someone explain to me why the current guidelines enforce the use of a version for type definitions for all versions but the latest one and why they don't say anything about specifying a version for type definitions they depend upon? I'll explain my perplexity: I'm facing the issue that right now, the browserify td doesn't work with the latest node td (but it works with v0.11.0). Given the current guidelines, how can someone who writes a td that references another one be sure that a new update to the referenced td doesn't brake theirs? I don't see a way right now. As an end user, right now the only solution I've got is to manually change the browserify td to reference the node version that doesn't break it. It doesn't sound like an ideal scenario to me.
score: 1
type: UnansweredQuestion
upvote count: 1
has title: Typescript type definitions versions

http://stackoverflow.com/q/29798110
has comment: http://stackoverflow.com/comment/47724500
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47725877
has comment: http://stackoverflow.com/comment/47724476
answer count: 1
has comment: http://stackoverflow.com/comment/47724406
has title: Update jQuery variable on ajax complete
upvote count: 6
accepted answer: http://stackoverflow.com/a/29799024
score: 6
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47726055
has comment: http://stackoverflow.com/comment/47724457
has comment: http://stackoverflow.com/comment/47724879
has comment: http://stackoverflow.com/comment/47724644
linked to: http://stackoverflow.com/q/9978449
type: Question
has answer: http://stackoverflow.com/a/29799024
has comment: http://stackoverflow.com/comment/47724740
downvote count: 0
has body: im still a beginner with JS. I use ajax for filtering content in wordpress. So I need to send 2 variables to PHP. But the problem is once i've navigated further one of the variables needs to change. In html the Data gets changed, but jquery which runs on (document).ready uses the initial variable. How can i make the variable refresh on ajax complete? here is my code jQuery(document).ready(function($) { $('.tax-filter').click( function(event) { if (event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; } var selecetd_taxonomy = $(this).attr('id'); var personData = $('#content').data('id'); data = { action: 'filter_posts', afp_nonce: afp_vars.afp_nonce, taxonomy: selecetd_taxonomy, person: personData, }; $.ajax({ type: 'post', dataType: 'json', url: afp_vars.afp_ajax_url, data: data, success: function( data, textStatus, XMLHttpRequest ) { $('.showContent').html( data.response ); }, error: function( MLHttpRequest, textStatus, errorThrown ) { $('.projects').html( 'Error 404' ); } }) }); }); From another function the .data('id') in html gets a new value, but I need the jQuery to get the new value aswell EDIT: I need the personData to be updated in my click function. The data-id value of #content gets updated on ajaxComplete. It is done by another click function which gets the value from PHP.
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29910713
has comment: http://stackoverflow.com/comment/48082636
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29761763
has comment: http://stackoverflow.com/comment/48016714
type: Answer
has comment: http://stackoverflow.com/comment/48098528
accepted answer of: http://stackoverflow.com/q/29761763
has body: I have updated the code now and got ur exact requirement now and i hope this will help you Select Your Option : Car Name Bike Name Laptop Name Place Name Mobile Name Enter your Color Submit Query
upvote count: 1
has comment: http://stackoverflow.com/comment/48081586
has comment: http://stackoverflow.com/comment/48016849
score: 1
has comment: http://stackoverflow.com/comment/48081615
has comment: http://stackoverflow.com/comment/48068084

http://stackoverflow.com/q/29781845
answer count: 1
tagged with: javascript
score: -1
tagged with: dom-events
tagged with: this
downvote count: 1
favorite count: 0
upvote count: 0
type: UnansweredQuestion
has title: How this object work on addEventListener method in following code?
type: Question
has answer: http://stackoverflow.com/a/29782629
has body: See fiddle I have following Html code : one two and Js code : var el = document.getElementById("outside"); var Something = function(element) { this.name = 'Something Good'; this.onclick1 = function(event) { console.log(this.name); // undefined, as this is the element }; this.onclick2 = function(event) { console.log(this.name); // 'Something Good' }; el.addEventListener('click', this.onclick1, false); el.addEventListener('click', this.onclick2.bind(this), false); } Something(); while execution of Something(), this refer to the Window object. so onclick1 and onclick2 is the method on Window object. Doubt : When el.addEventListener('click', this.onclick1, false); is executed this object in this.onclick1 refer to the el object. then why onclick1 method is called(which is a method of window object), when an event is triggred.onclick1 method should call on window object not on el object. In el.addEventListener('click', this.onclick2.bind(this), false);How this object in this.onclick2 and onclick2.bind(this) is different? This example is taken from MDN

http://stackoverflow.com/a/29826652
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29825938
has body: I think your console.log have no idea what is your object because the GET method is asynchronous, and so your adress is still undefined when you try to call your console.log.. try to handle your adress in callback of your GET. retailerService.get({id: retailerNumber}) .success(function(data) { console.log(data.adress) $scope.adress = data.adress //(example, idk how you manage your object) }) And you can make that differently with this: $scope.adress = retailerService.get({id: retailerNumber}) And in your html you can use like that: ng-model='adress.adress' //(ok here, it's really ugly :) ) Hope that helps you.
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/47779718
answers question: http://stackoverflow.com/q/29825938

http://stackoverflow.com/comment/47662996
has text: thank you for suggestion , but my problem is localhost javascript function is not getting called .
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29764790

http://stackoverflow.com/comment/47651852
type: QuestionComment
comment on: http://stackoverflow.com/q/29756835
has text: Also, I have jquery before bootstrap, I have changed sources and went from local to CDNs and vice versa for JS and CSS files. Still no change.
score: 0
type: Comment

fiddler
tags question: http://stackoverflow.com/q/29763137
tag name: fiddler
tags question: http://stackoverflow.com/q/29709286
type: Tag

http://stackoverflow.com/a/29803286
type: AcceptedAnswer
type: Answer
has body: $.ajax({ url: "@(Url.RouteUrl("Trelon"))", data: { @Model.Defeli : $(this).val()}, dataType: 'application/json; charset=utf-8' }) Removing the comma at the end helped.
accepted answer of: http://stackoverflow.com/q/29797359
answers question: http://stackoverflow.com/q/29797359
score: 0

http://stackoverflow.com/comment/47612551
has text: thnks you sir for that help
comment on: http://stackoverflow.com/a/29717701
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47650103
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29758474
score: 0
has text: @Sushil; thanks for the jsfiddle. It doesn't completly work, how can i find the checkbox next to first one. Only one checkbox can be checked at a time.

http://stackoverflow.com/a/63377110
has body: As of Jest 26 this can be achieved using "modern" fake timers without needing to install any 3rd party modules: https://jestjs.io/blog/2020/05/05/jest-26#new-fake-timers jest .useFakeTimers() .setSystemTime(new Date('2020-01-01')); If you want the fake timers to be active for all tests, you can set timers: 'modern' in your configuration: https://jestjs.io/docs/configuration#timers-string EDIT: As of Jest 27 modern fake timers is the default, so you can drop the argument to useFakeTimers.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/119784550
has comment: http://stackoverflow.com/comment/137688516
accepted answer of: http://stackoverflow.com/q/29719631
has comment: http://stackoverflow.com/comment/114814028
score: 524
type: Answer
has comment: http://stackoverflow.com/comment/120587324
has comment: http://stackoverflow.com/comment/133696190
has comment: http://stackoverflow.com/comment/114523108
has comment: http://stackoverflow.com/comment/117270222
answers question: http://stackoverflow.com/q/29719631
has comment: http://stackoverflow.com/comment/127430328
downvote count: 1
upvote count: 525

http://stackoverflow.com/comment/47721622
score: 1
has text: This still forces me to have an empty module lying around. Cleaner than `NormalModuleReplacementPlugin`, though :)
comment on: http://stackoverflow.com/a/29796386
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47734862
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29798976
has text: A little explanation would be helpful. What was wrong and how does this solve it?
score: 0

http://stackoverflow.com/comment/47689285
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29778919
has text: @MattK is right, you need some learning resources first. As such and without more context as to what you want to achieve (simply logging data, using it in a template, ...) it will be very hard to properly answer. As for your issue, you should take interest in: [Subscriptions](http://docs.meteor.com/#/full/meteor_publish), [Collections](http://docs.meteor.com/#/full/mongo_collection), [what a reactive variable is](http://docs.meteor.com/#/full/reactivevar), [`Tracker`](http://docs.meteor.com/#/full/tracker) and [`Template` helpers](http://docs.meteor.com/#/full/template_helpers). Doc grind!
score: 0

http://stackoverflow.com/q/29752376
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/47637058
score: -2
has body: I have an issue with an angular app. One works perfectly and the second one (with no difference except the variable, app and controllers names) doesn't. I have the following error Error: $injector:modulerr Module Errorand Failed to instantiate module ConfigurationApp due to:... Here is my html : Here is the ConfigurationApp.js: var ConfigurationApp = angular.module('ConfigurationApp', ['ngRoute', 'angularLocalStorage', 'ui.bootstrap']); ConfigurationApp.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/', { templateUrl: 'pages/configuration/index.html', controller: 'ConfigurationController', }); } ]); The full error is http://errors.angularjs.org/1.3.13/$injector/modulerr?p0=ui.bootstrap&p1=Error: [$injector:nomod] http://errors.angularjs.org/1.3.13/$injector/nomod?p0=ui.bootstrap at Error (native) at http://localhost:3000/bower_components/angular/angular.min.js:6:417 at http://localhost:3000/bower_components/angular/angular.min.js:21:412 at a (http://localhost:3000/bower_components/angular/angular.min.js:21:53) at x.bootstrap (http://localhost:3000/bower_components/angular/angular.min.js:21:296) at http://localhost:3000/bower_components/angular/angular.min.js:35:116 at s (http://localhost:3000/bower_components/angular/angular.min.js:7:302) at g (http://localhost:3000/bower_components/angular/angular.min.js:34:399) at http://localhost:3000/bower_components/angular/angular.min.js:35:63 at s (http://localhost:3000/bower_components/angular/angular.min.js:7:302 Do you know where is the problem ?
has comment: http://stackoverflow.com/comment/47637253
downvote count: 2
answer count: 1
has answer: http://stackoverflow.com/a/29752615
has comment: http://stackoverflow.com/comment/47636983
has comment: http://stackoverflow.com/comment/47637949
has comment: http://stackoverflow.com/comment/47637070
tagged with: javascript
has comment: http://stackoverflow.com/comment/47637286
has title: AngularJS Error: $injector:modulerr
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/47636961
accepted answer: http://stackoverflow.com/a/29752615
has comment: http://stackoverflow.com/comment/47637138
has comment: http://stackoverflow.com/comment/47637202
favorite count: 0

http://stackoverflow.com/q/29758369
downvote count: 1
has comment: http://stackoverflow.com/comment/47649114
type: Question
tagged with: if-statement
score: -1
has comment: http://stackoverflow.com/comment/47649060
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47649089
tagged with: javascript
has comment: http://stackoverflow.com/comment/47649194
favorite count: 0
has comment: http://stackoverflow.com/comment/47649081
accepted answer: http://stackoverflow.com/a/29758496
has body: I need your help. I want to show different phone # based on what page (within same site) user came from. Everthing will take place within same website. All users will come to same page - misite.com/phone.php Example: If user came from misite.com/page1.php, show phone number 1 If user came from misite.com/page2.php, show phone number 2 If user came from misite.com/page3.php, show phone number 3 Else, show default phone number (if I do not list a specific page). I guess it will ba a if / elseif statement, but i'm not a coder and don't know how to sturcture it correctly. I'm looking for example of code please. I also thing I will need to us to use $_SERVER['HTTP_REFERER']; for this. Thank you for any help!
has title: Display Different Phone # based referring page (PHP or JS)
has answer: http://stackoverflow.com/a/29758496
tagged with: referrer
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47649094
tagged with: http-referer
linked to: http://stackoverflow.com/q/6880659
tagged with: php

http://stackoverflow.com/comment/47754290
type: Comment
comment on: http://stackoverflow.com/a/29813036
has text: I'm so new to coding. I'm trying to figure out how to use this. Should I not use $.getJSON()? I get my articles from my php file which gets the data from google. Same situation for my fortunes.php file.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47515983
type: Comment
comment on: http://stackoverflow.com/a/29689442
score: 0
type: AnswerComment
has text: What is in controllers.js on line 59?

http://stackoverflow.com/q/29701423
tagged with: amd
type: Question
accepted answer: http://stackoverflow.com/a/29702642
answer count: 1
downvote count: 0
tagged with: javascript
has title: Visual Studio Chutzpah Running test on different projects with AMD modules
favorite count: 0
tagged with: visual-studio-2013
tagged with: chutzpah
has body: I have two projects under a solution, one is my main web project, say MyProject and the other serves for testing purposes, say MyProject.Tests. Solution MyProject MyProject.Tests I want to have my JavaScript headless tests running to the second one. On the first project, all the javascript files are under the Scripts directory, like so: Scripts/ Common.js Libs/ jquery/ jquery.js requirejs/ require.js At the test project, I have my chutzpah.json file on root. MyProject.Tests chutzpah.json Tests/ Specs/ spec.js The file has this configuration: { "Framework": "jasmine", "TestHarnessReferenceMode": "AMD", "TestHarnessLocationMode": "SettingsFileAdjacent", "Tests": [ { "Path": "Tests/Specs" } ], "AMDBasePath": "../MyProject/Scripts", "CodeCoverageExcludes": ["*Common.js"], "References": [ { "Path": "../MyProject/Scripts/Libs/requirejs/require.js" }, { "Path": "../MyProject/Scripts/Common.js" } ] } But when I try to run the spec file I get an error. Spec file: define(["jquery"], function ($) { //code here. Doesn't matter, the error is because of the jquery module }); The error, is this: Error: Error opening C:/Users/g.dyrrahitis/Documents/Visual Studio 2013/Projects/MySolution/MyProject.Tests/Scripts/Libs/jquery/jquery.js: The system cannot find the path specified. The thing is that chutzpah tries to find my jquery module at the test project rather the main project, where it resides. Why I'm getting this kind of behavior and how can I solve this please? I've been trying for hours to tackle this with no luck so far. Note *The names MySolution, MyProject, MyProject.Tests are used for clarity, rather than using the real names.
has answer: http://stackoverflow.com/a/29702642
tagged with: requirejs
type: AnsweredQuestion
score: 3
upvote count: 3

http://stackoverflow.com/q/29819866
tagged with: webgl
has comment: http://stackoverflow.com/comment/47931855
has title: Measure WebGL texture load in ms
type: Question
has comment: http://stackoverflow.com/comment/47953017
has answer: http://stackoverflow.com/a/29916151
has comment: http://stackoverflow.com/comment/47820970
tagged with: javascript
answer count: 1
accepted answer: http://stackoverflow.com/a/29916151
has body: How can i measure WebGL texture load in milliseconds? Right now I have an array of images that will be renderd out as a map using a game loop and im interested in capturing the time it takes for WebGL to load every texture image in milliseconds. I wonder how that can be done to measure this because JavaScript is not synchronous with WebGL.
has comment: http://stackoverflow.com/comment/47952769
has comment: http://stackoverflow.com/comment/47950359
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47953276
score: 0

http://stackoverflow.com/a/29787260
score: 4
has body: the first argument in each function is for index of element in matched selection. .each( function ) function Type: Function( Integer index, Element element ) A function to execute for each matched element. You need to use: Thus you need to either pass e as second argument and index as first argument. Or, rather use this to access current object $(".status").each(function(e){ alert($(this).data('options')); });
upvote count: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29787241
type: Answer
answers question: http://stackoverflow.com/q/29787241

http://stackoverflow.com/comment/47708117
type: Comment
score: 2
has text: could be a problem with `../Backend/StartFeasibilityAnalysis.php` relative path check if you are getting `404` or any other error in your console
type: QuestionComment
comment on: http://stackoverflow.com/q/29789506

http://stackoverflow.com/q/29696712
answer count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/29696777
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
has body: Background I am writing a tool that steps through images in a folder. For each image file, that image is displayed and the user can edit the image. There is a "Next"-button which, when clicked, will save the current image and display the next image in the folder. I already have a codebase in HTML/JavaScript that displays images and enables all the necessary editing. Problem Since my code is as an HTML page, it runs in the browser. However, because of the security measures in the browser, this makes interaction with the file system difficult. In particular, I haven't found a good way to make a "Save" button that saves the changes directly to the file; when trying ot save the file, the browser requires that I download it like a normal file being saved to the computer. Note that the page is not online - everything is run locally on the computer. In fact, I don't actually need to use the browser to run the javascript, I'm just doing it for convenience. Question Is there some neat way of allowing an HTML page to directly access your file system? Would it be possible to let the page interact with another program that runs natively on the computer? Other solutions?
downvote count: 0
has answer: http://stackoverflow.com/a/29696777
has title: Opening html page as application
tagged with: local-storage
type: Question
upvote count: 2

http://stackoverflow.com/comment/47684407
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29775991
type: QuestionComment
has text: @tpie yes. The product category can have a variable amount of attributes, so I made a directive to add them dynamically. Inside that directive it displays some static info as well as the range slider. I turned the range slider into another directive so I could add Angular binding to it. It *appears* to work well because I can see it update the scope in line 2 of the controller code above.

http://stackoverflow.com/comment/47748607
comment on: http://stackoverflow.com/a/29782775
type: AnswerComment
score: 0
has text: Thanks for the answer - I went with the other one just for the conciseness, but this one appeals for the index counting.
type: Comment

http://stackoverflow.com/comment/47773290
has text: Hmm, this is not working on all my divs. All finishing at different heights. E.g. The title with 2 lines is ellipsis a line after the title with 1 line.
type: AnswerComment
comment on: http://stackoverflow.com/a/29823216
score: 0
type: Comment

http://stackoverflow.com/comment/47642603
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29755233
has text: What do you mean by "I can't seem to get the setTimeout in the right spot'?

http://stackoverflow.com/a/29772645
upvote count: 1
type: Answer
has body: $interpolate returns a function which returns a string. It is used to resolve {{bindings}}. $compile returns a function which returns an html-element. It is used to compile raw (html) strings into html-elements and resolve angular-code inside of this string. $compile uses $interpolate to resolve any bindings inside this string. In your case you probably want to use $compile and .replaceWith().
downvote count: 0
has comment: http://stackoverflow.com/comment/47676273
has comment: http://stackoverflow.com/comment/47675804
answers question: http://stackoverflow.com/q/29772573
score: 1
accepted answer of: http://stackoverflow.com/q/29772573
type: AcceptedAnswer

http://stackoverflow.com/comment/47650156
score: 2
has text: `literal1` and `literal2` are the exact same object
comment on: http://stackoverflow.com/q/29758843
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29806169
favorite count: 0
has answer: http://stackoverflow.com/a/29806480
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29809578
score: 2
upvote count: 2
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript
tagged with: jquery
has title: Put a button in front of all rows in jQuery DataTables
has body: I am using jQuery DataTables. It is being populated with JSON data from a database. I can't figure out how to display a button or link in front of each record. I want to make it so that when the user clicks on that button then that particular record gets added in the database, so the button or link should contain an ID. Please help sort out my problem. Below is the code I'm using: var oTable = $('#jsontable').dataTable(); $.ajax({ url: 'process.php?method=fetchdata', dataType: 'json', success: function(s) { console.log(s); oTable.fnClearTable(); for (var i = 0; i < s.length; i++) { oTable.fnAddData([ s[i][3], s[i][4], s[i][0], // this contains id ]); } }, error: function(e) { console.log(e.responseText); } }); Class Number Subject ADD
answer count: 2
tagged with: datatables
downvote count: 0

http://stackoverflow.com/a/73074470
answers question: http://stackoverflow.com/q/29825455
has body: If you wanted prefill search box of data table you can do it like this. NOTE: use this $('#example').DataTable() not this $('#example').dataTable()
score: 0
type: Answer

http://stackoverflow.com/a/29811728
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/29811619
has comment: http://stackoverflow.com/comment/47751870
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47751389
has body: If data is the reference to the response then if(data.target &amp;&amp; data.target.length){ data.target = target.join('_'); } If you want X to replace the chars then var target = data.target; if(target &amp;&amp; target.length){ target = target.join('_'); target = target.replace(/\d/g, 'x') } data.target = target;

http://stackoverflow.com/comment/47559415
has text: Yeah, just `console.log(html);` and see what it spits out. Make sure to also be echoing/including/redirecting in your php file.
comment on: http://stackoverflow.com/q/29711937
type: Comment
type: QuestionComment
score: 2

submit
tags question: http://stackoverflow.com/q/29792363
tags question: http://stackoverflow.com/q/29789946
tags question: http://stackoverflow.com/q/29756417
tag name: submit
type: Tag
tags question: http://stackoverflow.com/q/29743253
tags question: http://stackoverflow.com/q/29724142
tags question: http://stackoverflow.com/q/29837230

http://stackoverflow.com/q/29807055
has answer: http://stackoverflow.com/a/61929062
answer count: 3
has answer: http://stackoverflow.com/a/34230090
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Jump to page in PDF.js with javascript
favorite count: 0
has body: I'm trying to use PDF.js' viewer to display pdf files on a page. I've gotten everything working, but I would like to be able to 'jump to' a specific page in the pdf. I know you can set the page with the url, but I would like to do this in javascript if it's possible. I have noticed that there is a PDFJS object in the global scope, and it seems that I should be able to get access to things like page setting there, but it's a rather massive object. Anyone know how to do this?
upvote count: 8
tagged with: pdf.js
tagged with: http://stackoverflow.com/tag/pdf
has answer: http://stackoverflow.com/a/54166973
score: 8
type: UnansweredQuestion
type: Question
tagged with: asp.net-mvc

http://stackoverflow.com/a/29697262
has body: Just a sample output. Modify it as per your requirement. var paintings = { 1: { id: 1, name: 'Abstract 1', gallery: 'Abstract', src:'Image64.jpg' }, 2: { id: 2, name: 'Abstract 2', gallery: 'Abstract', src:'Image65.jpg' }, 3: { id: 3, name: 'Abstract 3', gallery: 'Abstract', src:'Image66.jpg' }, 4: { id: 1, name: 'Game 1', gallery: 'Game', src:'Image66.jpg' }, 5: { id: 2, name: 'Game 2', gallery: 'Game', src:'Image66.jpg' }, }; var count = 0; for (var property in paintings) { if (paintings.hasOwnProperty(property)) { if (paintings[property]['gallery'] == 'Abstract' || paintings[property]['gallery'] == 'Game' ) { count++; } } } alert(count);
answers question: http://stackoverflow.com/q/29697130
downvote count: 0
score: 1
upvote count: 1
type: Answer

rich-media
tag name: rich-media
type: Tag
tags question: http://stackoverflow.com/q/29695139

google-maps
tags question: http://stackoverflow.com/q/29694594
tag name: google-maps
tags question: http://stackoverflow.com/q/29771959
tags question: http://stackoverflow.com/q/29833118
tags question: http://stackoverflow.com/q/29701400
tags question: http://stackoverflow.com/q/29745515
tags question: http://stackoverflow.com/q/29796001
tags question: http://stackoverflow.com/q/29755621
tags question: http://stackoverflow.com/q/29802570
tags question: http://stackoverflow.com/q/29844694
tags question: http://stackoverflow.com/q/29702922
tags question: http://stackoverflow.com/q/29787097
tags question: http://stackoverflow.com/q/29781818
tags question: http://stackoverflow.com/q/29806815
tags question: http://stackoverflow.com/q/29698080
tags question: http://stackoverflow.com/q/29810692
tags question: http://stackoverflow.com/q/29810345
tags question: http://stackoverflow.com/q/29813983
tags question: http://stackoverflow.com/q/29765290
tags question: http://stackoverflow.com/q/29806987
tags question: http://stackoverflow.com/q/29788260
tags question: http://stackoverflow.com/q/29799099
tags question: http://stackoverflow.com/q/29811665
tags question: http://stackoverflow.com/q/29705792
tags question: http://stackoverflow.com/q/29832416
tags question: http://stackoverflow.com/q/29832744
tags question: http://stackoverflow.com/q/29810202
tags question: http://stackoverflow.com/q/29804245
tags question: http://stackoverflow.com/q/29808144
tags question: http://stackoverflow.com/q/29734119
tags question: http://stackoverflow.com/q/29844400
tags question: http://stackoverflow.com/q/29744512
tags question: http://stackoverflow.com/q/29801060
tags question: http://stackoverflow.com/q/29806300
tags question: http://stackoverflow.com/q/29819746
tags question: http://stackoverflow.com/q/29758904
tags question: http://stackoverflow.com/q/29706340
tags question: http://stackoverflow.com/q/29723134
tags question: http://stackoverflow.com/q/29787932
tags question: http://stackoverflow.com/q/29705531
tags question: http://stackoverflow.com/q/29702531
tags question: http://stackoverflow.com/q/29765699
tags question: http://stackoverflow.com/q/29839556
tags question: http://stackoverflow.com/q/29697046
tags question: http://stackoverflow.com/q/29716809
tags question: http://stackoverflow.com/q/29728056
tags question: http://stackoverflow.com/q/29739964
tags question: http://stackoverflow.com/q/29785471
tags question: http://stackoverflow.com/q/29737392
tags question: http://stackoverflow.com/q/29804683
tags question: http://stackoverflow.com/q/29804356
type: Tag
tags question: http://stackoverflow.com/q/29689817
tags question: http://stackoverflow.com/q/29843886
tags question: http://stackoverflow.com/q/29813268
tags question: http://stackoverflow.com/q/29779201
tags question: http://stackoverflow.com/q/29829134
tags question: http://stackoverflow.com/q/29690634
tags question: http://stackoverflow.com/q/29829470
tags question: http://stackoverflow.com/q/29843155
tags question: http://stackoverflow.com/q/29730226
tags question: http://stackoverflow.com/q/29743897
tags question: http://stackoverflow.com/q/29775702
tags question: http://stackoverflow.com/q/29795807
tags question: http://stackoverflow.com/q/29758354

http://stackoverflow.com/a/55070481
type: Answer
answers question: http://stackoverflow.com/q/29810914
score: 7
downvote count: 1
upvote count: 8
has body: I realize this is pretty late to the party, but I think a much simpler solution could satisfy many use cases: handleEdit(event) { let value = event.target.value; } ... Edit I presume you could also use a data- attribute. Simple, semantic.

http://stackoverflow.com/comment/47694008
comment on: http://stackoverflow.com/a/29768143
type: AnswerComment
has text: While not trivial, it should still be possible to register an in-process [Asynchronous Pluggable handler](https://msdn.microsoft.com/en-us/library/ie/aa767916%28v=vs.85%29.aspx) for HTTP and/or HTTPS URL filtering and use WinInet to implement it. Is it not?
score: 0
type: Comment

http://stackoverflow.com/a/29693749
has comment: http://stackoverflow.com/comment/47524769
has comment: http://stackoverflow.com/comment/47525055
accepted answer of: http://stackoverflow.com/q/29693249
answers question: http://stackoverflow.com/q/29693249
score: 0
has comment: http://stackoverflow.com/comment/47524831
has comment: http://stackoverflow.com/comment/47524645
has body: I would put the method call in a onAfterAction hook and then set the layoutTemplate depending on the call's result: Router.route('/route', { name: 'route', onAfterAction: function() { var routerInstance = this; Meteor.call('method', function(error, result) { routerInstance.layoutTemplate = result; }); } });
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/48065299
type: Comment
type: QuestionComment
score: 0
has text: F12 - IE: https://msdn.microsoft.com/library/gg589500(v=vs.85).aspx Chrome: https://developer.chrome.com/devtools ... it also works in Firefox, probably safari etc. From here you can set break points in your JS code, assuming you can find the scripts. :) cheers.
comment on: http://stackoverflow.com/q/29699765

http://stackoverflow.com/a/29779539
score: 3
answers question: http://stackoverflow.com/q/29779492
downvote count: 0
upvote count: 3
has comment: http://stackoverflow.com/comment/47689077
has body: Make it all async: var value = function (test, callback) { if (test == 0) { callback('value is zero '); } else { return $.post('/echo/html/', { html: 'false ', delay: .5 }, function (r1) { console.log('r1', r1); callback('something from post callback'); }) .done(function (r2) { console.log('r2', r2); callback('something from done callback'); }); } }(1, function(result) { console.log(result); } );
type: Answer

http://stackoverflow.com/comment/47611457
comment on: http://stackoverflow.com/a/29738181
has text: Don't use directives in controller, and use directives in templates instead, like this: ` `
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/29882439
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: It would be great to support this directly; right now there is nothing built in to support this. However it looks like you can override xAxisMin and yAxisMin to force them to zero. Something like: chart.xAxisMin = function() { return 0; }; chart.yAxisMin = function() { return 0; }; Please let me know if this works for you. It really should be an option in the charts.
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/47924235
accepted answer of: http://stackoverflow.com/q/29708487
answers question: http://stackoverflow.com/q/29708487
has comment: http://stackoverflow.com/comment/47916856

http://stackoverflow.com/q/29723530
tagged with: onready
accepted answer: http://stackoverflow.com/a/29723985
has body: I have the following code and results is attached at the end. I understand that JQuery.ready and JQuery.Window load events are run after the DOM is created so it can manipulate the DOM but not the first function to change the background of John. My questions are: The background of John has not changed to yellow is because JavaScript is backward referencing by nature and it can't locate the element with the id name1 at the point when the script is run? If I have to run the first function to change the background of John, should this function be used after the DIV tags? Blockquote John Mary Jacob James Blockquote
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3698200
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47581462
has answer: http://stackoverflow.com/a/29723985
tagged with: javascript
score: 0
answer count: 2
has title: Manipulation of DOM by JavaScript execution order
possible better answer: http://stackoverflow.com/a/29723812
favorite count: 0
has answer: http://stackoverflow.com/a/29723812

http://stackoverflow.com/comment/47534929
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29696706
has text: it works finally thank you , in fact i had a problem in my bean ! thanks a lot

http://stackoverflow.com/a/29740103
answers question: http://stackoverflow.com/q/29739988
has body: First of all, var today = new Date(86400000); is not today, but really long time ago. Interpreter don't even bother calculating this date so it is minimum possible date: Fri Jan 02 1970 01:00:00 GMT+0100 (CET) To get today's date object just construct Date without parameters. Then you also need to create new Date object for dob string date. One more thing, you don't need parseInt as difference between two Date object will be integer value due to implicit type conversion to number during arithmetic - operation. Finally, you probably want to put / 375 under the Math.ceil too. Result will look something like this: var today = new Date(); var date = new Date(data.dob); var timeDiff = Math.abs(today - date); var age1 = Math.ceil(timeDiff / (1000 * 3600 * 24) / 365);
score: 3
downvote count: 0
upvote count: 3
type: Answer

http://stackoverflow.com/q/29779561
tagged with: css
accepted answer: http://stackoverflow.com/a/29779639
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29779639
type: Question
has body: I have this navbar inside my layoutTemplate maglens HOME {{> loginButtons}} ABOUT {{> yield}} And Ive inspected the html class of the {{> loginButtons}} but when I try to set float (even with !important), nothing happens. I can use padding/margin to get to the place I need, but that messes with the responsiveness of the website. What am I missing here?
tagged with: javascript
score: 0
answer count: 1
tagged with: meteor
has title: How to set float on Meteor login buttons

http://stackoverflow.com/comment/47811070
type: QuestionComment
has text: A sleep delay alone wont do nothing apart from annoy the user with slow performance. The person sniffing the server would simply script this and come back and check it in a few days to see what was found.
score: 1
comment on: http://stackoverflow.com/q/29842122
type: Comment

http://stackoverflow.com/comment/47638304
type: AnswerComment
type: Comment
has text: @SLaks why aren't you answering.
comment on: http://stackoverflow.com/a/29730519
score: 0

http://stackoverflow.com/comment/47721604
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29795924
has text: @Xan I've clarified the question. Is it clear enough to get an answer?

http://stackoverflow.com/comment/47755226
comment on: http://stackoverflow.com/a/29811369
score: 0
type: AnswerComment
has text: Thank you, I will try this out more in depth. I have a temporary fix using PHP with an alternative header on certain pages.
type: Comment

http://stackoverflow.com/comment/47613006
has text: tnx @shaunak, but it has to change the `name='files2'` field in input type='file' dynamically. is it possible with this one.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29739825

http://stackoverflow.com/comment/47697707
type: Comment
has text: Great answer, I really appreciate it
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29732991

http://stackoverflow.com/a/29718753
has body: Just as @Xan mentioned due to the CSP will block the script the best way to avoid this and do it work is downloading jquery.js and make it part of your extension.
upvote count: 1
answers question: http://stackoverflow.com/q/29712793
has comment: http://stackoverflow.com/comment/47573134
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/47573225
has comment: http://stackoverflow.com/comment/47572770
score: 1
has comment: http://stackoverflow.com/comment/47572739

http://stackoverflow.com/comment/47639381
type: Comment
has text: `bkey` is the key in the object. ie in `b` they are `A`,`B`, `C`
comment on: http://stackoverflow.com/a/29752912
type: AnswerComment
score: 0

http://stackoverflow.com/q/29746805
has answer: http://stackoverflow.com/a/29747025
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47626044
has comment: http://stackoverflow.com/comment/47626490
answer count: 1
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Navigation link does not highlighting the current menu, when submenu is clicked
has body: I have written jquery code for highlighting menu onclick of each respective submenu. Now here what happening is I have one same link in three of the sub-menu's, so when I click one of them, it is highlighting the last menu. Here is my code:- var str = location.href.toLowerCase(); $("#menu li a").each(function () { if (str.indexOf($(this).attr("href").toLowerCase()) &gt; -1) { $("li.activelink").removeClass("activelink"); $(this).parent().addClass("activelink"); $(this).parents("#menu ul").parent().addClass("activelink"); } }); $("li.activelink").parents().each(function () { if ($(this).is("li")) { $(this).addClass("activelink"); } }); $("li.activelink").parents("#menu ul").parent().each(function () { if ($(this).is("li")) { $(this).addClass("activelink"); } }); $("#menu li .para1 a").each(function () { if (str.indexOf($(this).attr("href").toLowerCase()) &gt; -1) { $("li.activelink").removeClass("activelink"); $(this).parent().addClass("activelink"); $(this).parents().parent().addClass("activelink"); } }); $("li.activelink").parents().each(function () { if ($(this).is("li")) { $(this).addClass("activelink"); } }); Have a look here Also see the HTML of the same in the Js fiddle Please suggest something for the same
type: Question

http://stackoverflow.com/a/29786058
has body: That's what's called a immediately invoked function expression in javascript, and it's not related to angular JS. The first set of parens gives you an enclosed lexical scope, and returns the function object defined within, and the second set of parens executes the function. So simply: define execute
has comment: http://stackoverflow.com/comment/47701912
has comment: http://stackoverflow.com/comment/47701839
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29786004
downvote count: 0
score: 1

http://stackoverflow.com/a/74262491
downvote count: 1
score: 3
has body: Based on the other answers and comments, a way without using third party packages would be: const sevenDaysFromNowResults = await db.ModelName.findAll({ where: { createdAt: { [Sequelize.Op.gte]: new Date(new Date() - (7 * 24 * 60 * 60 * 1000)) // seven days ago } } }) The seven days are calculated using Date utility in milliseconds (days * 24hrs * 60mins * 60secs * 1000ms)
answers question: http://stackoverflow.com/q/29798357
upvote count: 4
type: Answer

http://stackoverflow.com/comment/47577158
type: Comment
comment on: http://stackoverflow.com/a/29721090
has text: @Xufox - `Array.slice()` is not a standard thing. It does not exist in Chrome or IE, for example.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47741959
type: AnswerComment
has text: I see. I understood it incorrectly let m get back to you.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29806931

http://stackoverflow.com/comment/47756925
type: AnswerComment
has text: Except that as per other answers including mine, you need to be careful about escaping the value - just quoting it may well not be enough.
type: Comment
comment on: http://stackoverflow.com/a/29805106
score: 1

titanium
type: Tag
tag name: titanium
tags question: http://stackoverflow.com/q/29776498
tags question: http://stackoverflow.com/q/29742213

http://stackoverflow.com/a/29803713
score: 0
type: AcceptedAnswer
type: Answer
has body: Finally I was able to find the answer... Turns out, the requests for the templates (even if they are cached) are affected by the $http interceptors. The plunkr working is here: http://plnkr.co/edit/RoUhkiGP9RzCfUc6Pc3v?p=preview This is the interceptor that was affecting the resolving of the data. $httpProvider.interceptors.push(function($q) { return { 'response': function(response) { return response.data; }, 'responseError': function(rejection) { return $q.reject(rejection); } }; }); I still need the interceptor. So now it is like this: $httpProvider.interceptors.push(function($q) { return { 'response': function(response) { if (response.config.method == "GET" &amp;&amp; response.config.url.split(".").pop() == "html") return response; return response.data; }, 'responseError': function(rejection) { return $q.reject(rejection); } }; }); Thanks to http://www.bennadel.com/blog/2803-ng-template-requests-are-affected-by-http-interceptors-in-angularjs.htm Thanks to https://stackoverflow.com/a/25060769/1339973 for provide a solution for the problem with the $http interception when a template
accepted answer of: http://stackoverflow.com/q/29802472
answers question: http://stackoverflow.com/q/29802472

http://stackoverflow.com/q/29726228
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/29732972
has comment: http://stackoverflow.com/comment/47586594
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29726323
tagged with: form-data
favorite count: 0
linked to: http://stackoverflow.com/q/28207106
has title: Empty FormData in POST Request
has answer: http://stackoverflow.com/a/29732972
upvote count: 1
tagged with: xmlhttprequest
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/28856729
score: 1
has body: I'm making a simple application that will upload a file a server that has been dragged and dropped onto a canvas. Here's a small sample of what the drag and drop code looks like: var files = event.dataTransfer.files; var formData = new FormData(); formData.append('files', files); Using the debug tools, I know that files is correctly defined. Then, I make the request: var xhr = new XMLHttpRequest(); xhr.open('POST', '/upload', true); xhr.send(formData); But my server, running Node JS, gets an empty response body: var express = require('express'); var bodyParser = require("body-parser"); app.use(bodyParser.urlencoded({ extended: false })); app.post('/upload', function(req, res) { console.log(req.body.files); res.end(); }); I tried debugging on both the client and server side, but I can't figure it out. Although, it seems weird to me that the formData object looks like: FormData {append: function} __proto__: FormData Why isn't the appended files object showing up? Any insight as to what the problem is would be greatly appreciated!
tagged with: post
has answer: http://stackoverflow.com/a/29726323

http://stackoverflow.com/comment/47587580
type: Comment
type: QuestionComment
has text: Print `data` in your browser console before appending, and see what it gives. From the code you posted there's nothing wrong.
score: 0
comment on: http://stackoverflow.com/q/29726770

http://stackoverflow.com/comment/77047148
has text: Has anything changed in this regards lately?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29724552
type: AnswerComment

http://stackoverflow.com/comment/47645193
comment on: http://stackoverflow.com/q/29752566
score: 0
type: QuestionComment
type: Comment
has text: @levi If you have a XSS exploit where you control the full content from the first character (rare, but not unseen) you can simply self-embed in the outer embed and have your javascript in the inner embed. But either way, that was just a side note, the existence of `connect-src` shows that CSP also cares about Javascript evaluation XSS exploits.

http://stackoverflow.com/a/73343334
answers question: http://stackoverflow.com/q/29815940
upvote count: 6
has body: I implemented a jq parser, interpreter, and (basic) formatter in TypeScript: @jq-tools/jq So far, all of jq's syntax is supported (with the exception of the modules). And although a good portion of built-in filters and formats still needs to be implemented, a few are already there. Most of the functionality is properly tested (there are over a thousand test cases). Here, I attach a basic usage example: import { jq } from '@jq-tools/jq'; const transform = jq&lt;number, number&gt;`.[] | . * 2`; Array.from(transform([1, 2, 3])); // Output: [2, 4, 6] I do not really have any solid benchmarks, but so far it seemed to be faster than jq-web (at least on small data).
type: Answer
score: 6
downvote count: 0

http://stackoverflow.com/a/65278277
type: Answer
has body: Use https or http in URL .Example:
answers question: http://stackoverflow.com/q/29779403
score: 0

http://stackoverflow.com/comment/47713074
type: Comment
comment on: http://stackoverflow.com/a/29790728
has text: I just need to do it that way. I've searched for related topics on internet but i haven't found any similar.
score: 0
type: AnswerComment

http://stackoverflow.com/a/29839605
score: 0
has body: window.location.hash contains the fragment part of the URL.
type: Answer
answers question: http://stackoverflow.com/q/29815409

http://stackoverflow.com/comment/54762420
score: 2
type: AnswerComment
has text: That's because browserSync.reload function take argument. https://github.com/BrowserSync/browser-sync/issues/711#issuecomment-142460409
comment on: http://stackoverflow.com/a/30438407
type: Comment

angularfire
tags question: http://stackoverflow.com/q/29827171
tag name: angularfire
type: Tag
tags question: http://stackoverflow.com/q/29702852

http://stackoverflow.com/comment/47555814
has text: So can firebase connect with phonegap? If so, that may be the way I go.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29710009

http://stackoverflow.com/comment/47777196
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29825207
has text: @andybeli Yep, after clicking on the div option_one, I want to load the js file calculating.js in the .click(function)

http://stackoverflow.com/comment/47729992
comment on: http://stackoverflow.com/q/29787867
type: Comment
type: QuestionComment
score: 0
has text: @stanze I'm declaring the cbx variable in JS. I use it to declare the div class and put the drop down where I want in html. What jquery am I missing?

http://stackoverflow.com/comment/47752731
type: QuestionComment
has text: console log `xml` to see what your returned data is - `console.log(xml);`
comment on: http://stackoverflow.com/q/29812338
score: 0
type: Comment

http://stackoverflow.com/q/29689469
has answer: http://stackoverflow.com/a/29689487
tagged with: jquery-events
type: Question
answer count: 5
has title: How is jQuery $(this) used inside event delegation method?
has answer: http://stackoverflow.com/a/29689533
has comment: http://stackoverflow.com/comment/47516084
possible better answer: http://stackoverflow.com/a/29689508
has answer: http://stackoverflow.com/a/29689555
has answer: http://stackoverflow.com/a/29689508
score: 0
has answer: http://stackoverflow.com/a/29689510
accepted answer: http://stackoverflow.com/a/29689487
has body: I am trying to make myself this small jQuery code that tests if the user has entered something. If they haven't, alert them the errors. However, I seem to have a small problem, the keyword $(this) in this case doesn't seem to behave as it should. Please help! HTML: &lt;input type="text" id="name" name="name" /&gt; &lt;div id="error-div-1"&gt;&lt;/div&gt; &lt;input type="text" id="hobbies" name="hobbies" /&gt; &lt;div id="error-div-2"&gt;&lt;/div&gt; JavaScript: function showError(i) { var errorDivID = "#error-div-" + i; if ($(this).val() === "") { $(errorDivID).html("Please enter something!"); } else { $(errorDivID).html(""); } } $("#name").on("blur", function() { showError(1); }); $("#hobbies").on("blur", function() { showError(2); })
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47515997

http://stackoverflow.com/comment/47598781
has text: thanks I updated the jsfiddle. now people will be able to see that indeed i can't click on the button behind it while the modal is open
comment on: http://stackoverflow.com/q/29732640
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29786576
type: Answer
has comment: http://stackoverflow.com/comment/47703921
has body: Here is your code: It's wrong because the 'Country' parameter in the function postalcode is unclear This input type is text, so it's also invalid to get the this.id, instead this is the solution I recommend: 1st) Make an select option to let the user choose the country: choose your country a b 2nd) create input for user to type in postal code with pattern of their country: 2a) Create function create the pattern of the postal code: function userCountry(country) { switch (country) { case a: limitLength = 6; // you could set up your regex for input validation regExp = /\d{3,6}/; break; case b: limitLength = 8; break; // etc. }; document.getElementById("postalCode").setAttribute("maxlength",limitLength); }; // here is the input in html for user to input the postal code // validation the input, only necessary if you have regexp function validationCode() { var invalidCode = /[^\d]+/g; // wrong pattern you make your own, in this case, all characters beside digital character will be considered invalid. if (this.value.match(regExp) == null) { // check if it's wrong this.value.replace(invalidCode,""); // replace all invalid code with space, so it will remain only valid code }; }; I hope this helps, I've tried to understand your problem , this is come with what I comprehended from your question.
answers question: http://stackoverflow.com/q/29786025
score: 0

http://stackoverflow.com/a/29835788
answers question: http://stackoverflow.com/q/29835730
has body: You can use a &lt;label&gt; for your checkbox and then hide it using CSS. Something like this should work: HTML &lt;input type="checkbox" id="check" class="checkbox"&gt; &lt;label for="check"&gt;&lt;img src="..."/&gt;&lt;/label&gt; CSS input { display:none; } Anything you put inside the &lt;label&gt; tags will activate that checkbox when clicked. Here is a fiddle of it in action. If you remove the display:none; you'll notice that clicking on the label contents checks the box. http://jsfiddle.net/w61zb19y/
type: Answer
score: 2
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/47802613
has comment: http://stackoverflow.com/comment/47799109

http://stackoverflow.com/comment/47789476
comment on: http://stackoverflow.com/q/29831291
has text: @AkashShinde it should be `$modalInstance` instead of `$confirmModal ` check my answer
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/q/29829992
downvote count: 5
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47786514
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
upvote count: 2
type: UnansweredQuestion
score: -3
has title: How to linkify the URL in a text?
has answer: http://stackoverflow.com/a/29830138
has comment: http://stackoverflow.com/comment/47786570
has comment: http://stackoverflow.com/comment/47786653
has comment: http://stackoverflow.com/comment/47788067
type: Question
has comment: http://stackoverflow.com/comment/47786606
has body: I am using Html, Jquery and Javascript. I am using linkify javascript library and is working fine. But if there is no space before the URL then it does not work. How to solve this? I have below URL along with text. Please click the linkhttp://www.asdfgh.com Please see there is no space before the URL. How to linkify the URL here?Can it be done using Javascript?
has comment: http://stackoverflow.com/comment/47786441

http://stackoverflow.com/q/29793420
downvote count: 0
type: Question
score: 3
has title: JQuery function works as a single line, but not when I break it up
has comment: http://stackoverflow.com/comment/47715331
duplicate of: http://stackoverflow.com/q/21806064
accepted answer: http://stackoverflow.com/a/29793446
has comment: http://stackoverflow.com/comment/47715523
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29793446
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
has body: I am new to javascript and html and I have a question In order to test that a submit button works correctly I used this jquery script $(document).ready(function() { $("#search_form").submit(function() { alert("you pressed submit"); event.preventDefault(); return false; }); }); This works as expected, when I press the submit button it pops up a message However when I use the following code (which in theory does the same thing) $(document).ready( set_up_listeners() ); function set_up_listeners() { $("#search_form").submit(submit_pressed()); }; function submit_pressed() { alert("you pressed submit"); event.preventDefault(); return false; }; the alert pops up when the document is ready, not when I press submit What am I doing wrong? I like the second type of code cause it is easier for me to read, but I can't figure out why it does not work Thanks in advance for any help you can provide
linked to: http://stackoverflow.com/q/21806064
linked to: http://stackoverflow.com/q/26575979
linked to: http://stackoverflow.com/q/16580012
favorite count: 0
linked to: http://stackoverflow.com/q/23419929
type: AnsweredQuestion

http://stackoverflow.com/a/29814496
has comment: http://stackoverflow.com/comment/47756426
has body: Did you simply try: echo ("Duration: " .$row["Duration"]."&lt;br&gt;"); \n is only visible in the source code, while &lt;br&gt; affects the html.
has comment: http://stackoverflow.com/comment/47756449
downvote count: 0
answers question: http://stackoverflow.com/q/29814446
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/29767555
tagged with: javascript
has answer: http://stackoverflow.com/a/29767694
answer count: 2
possible better answer: http://stackoverflow.com/a/29767694
downvote count: 0
accepted answer: http://stackoverflow.com/a/29767664
favorite count: 0
has title: bower_components created at wrong directory
tagged with: angularjs
tagged with: node.js
type: AnsweredQuestion
has body: Using Windows 7, Webstorm 10.0.1, current node.js, npm, bower, etc. I created the default Webstorm AngularJS project, did not change anything and clicked "Run index.html". The page loaded but Angular was not running. From the source I saw that the files were missing &lt;script src="bower_components/angular/angular.js"&gt;&lt;/script&gt;. The directory bower_components was missing. Then I searched for it and it was created at C:\Users\&lt;username&gt;\bower_components whereas my Webstorm projects are under C:\Users\&lt;username&gt;\WebstormProjects\angularjs. What configurations need to be changed to make my AngularJS app work? Additional info: .bowerrc { "directory": "app/bower_components" } bower.json { "name": "angular-seed", "description": "A starter project for AngularJS", "version": "0.0.0", "homepage": "https://github.com/angular/angular-seed", "license": "MIT", "private": true, "dependencies": { "angular": "1.2.x", "angular-route": "1.2.x", "angular-loader": "1.2.x", "angular-mocks": "~1.2.x", "html5-boilerplate": "~4.3.0" } }
upvote count: 3
has answer: http://stackoverflow.com/a/29767664
type: Question
score: 3

http://stackoverflow.com/comment/47649474
type: Comment
has text: so I don't ask you a series of lead-on questions, can you provide sample code? For example I don't understand this part `switch ($_SESSION['page']) `
comment on: http://stackoverflow.com/a/29758496
score: 0
type: AnswerComment

http://stackoverflow.com/q/29783143
type: UnansweredQuestion
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47696901
has comment: http://stackoverflow.com/comment/47700104
has answer: http://stackoverflow.com/a/29785254
type: Question
answer count: 2
tagged with: arrays
has comment: http://stackoverflow.com/comment/47697276
tagged with: javascript
has body: var d0 = document.getElementById("d0").getElementsByTagName('h2'); var pp0 = document.getElementById("prepend0").getElementsByClassName('formDiv'); //alert(d0.length); //alert(pp0.length); var report =""; for (var i = 0; i &lt; d0.length; i++) { report += d0[i].textContent+"%0D%0A";//gets the date for day1 for (var j = 0; j &lt; pp0.length; j++) { report += pp0[j].textContent+"%0D%0A";//gets the d0 formDiv children. I want to out put this with line breaks } } OutPut: Sun Apr 19 2015 Project OneEnter Description Here.Total Time: 00:00:00 What I want to do is: Sun Apr 19 2015 Project One Enter Description Here. Total Time: 00:00:00
has comment: http://stackoverflow.com/comment/47696266
has title: How do I add line breaks to my array output?
has comment: http://stackoverflow.com/comment/47697844
favorite count: 0
has answer: http://stackoverflow.com/a/29785256

http://stackoverflow.com/comment/47773466
type: AnswerComment
comment on: http://stackoverflow.com/a/29821138
type: Comment
has text: Hey, it's working! And it's so beautiful. Not exactly the solution I wanted, but good enough for now. Thanks again -- my first StackOverflow question is answered.
score: 0

http://stackoverflow.com/q/29840874
has title: how to build a dual language webpage?
type: Question
answer count: 2
score: -2
has comment: http://stackoverflow.com/comment/47808076
tagged with: javascript
has comment: http://stackoverflow.com/comment/47807962
downvote count: 3
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/30888804
has comment: http://stackoverflow.com/comment/47808457
has comment: http://stackoverflow.com/comment/47807907
favorite count: 0
has answer: http://stackoverflow.com/a/29840999
has comment: http://stackoverflow.com/comment/47808018
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/754520
tagged with: php
has comment: http://stackoverflow.com/comment/47807933
tagged with: css
has comment: http://stackoverflow.com/comment/47808084
has body: I want to design a dual language webpage i.e in English and Kannada. I don't want to load a new webpage or reload the page as the user switches between the languages.Please let me know if there is any solution using JavaScript or PHP

http://stackoverflow.com/comment/47581795
type: QuestionComment
score: 1
has text: @Mathletics Implementing something yourself is a great way to understand how said thing works. A better question to ask: why do you need to call `getValue` twice? I'd bet that the reason you need to do that is the same reason the function isn't working.
comment on: http://stackoverflow.com/q/29723259
type: Comment

http://stackoverflow.com/q/29803332
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47735733
type: UnansweredQuestion
score: 1
upvote count: 1
linked to: http://stackoverflow.com/q/11252780
type: Question
has title: How to refresh ng-repeat on modal close?
tagged with: javascript
has answer: http://stackoverflow.com/a/29803681
has body: The setup: I have a page (angular) with a repeater in it. {{row.SubmittedByName}} Within the repeater, there is a column with a button that opens a modal to alter that row's data. The modal, in turn, has a button for the saving of the record, that closes the current modal, opens a new modal, let's the user enter a comment, saves, and then closes the modal. This all works great. Fantastic. What DOESN'T work is... when the modal closes, the ng-repeat is supposed to refresh, as the actions taken in the modal will actually remove rows from the data. If I refresh the page manually, the row vanishes - but without refreshing the page, nothing happens. The Angular Controller: 'use strict'; angular.module('leadApproval.controllers', []). //This is the main page core method - The data is loaded here, and the in-table-row buttons work from here. controller('LeadApprovalCtrl', function ($scope, $location, $modal, api, notificationService) { $scope.currentPage = 1; $scope.pageSize = 13; $scope.loaded = false; $scope.totalItems = 0; $scope.head = {}; $scope.sort = {}; $scope.selectedCls = null; $scope.changeSorting = null; $scope.setPage = null; $scope.results = null; $scope.loadQueue = (function () { api.queue.load(function (data) { if (data.error) { notificationService.error(' An error occurred.. ' + data.error); } else { $scope.results = data; $scope.loaded = true; } }); }); $scope.acceptLead = function (leadId) { var modal = $modal.open({ templateUrl: '/Content/LeadApproval/Approved.html', controller: 'ApprovedCtrl', windowClass: '', resolve: { leadId: function () { return leadId; } } }); modal.result.then(function (result) { if (result === 'save') { $scope.loadQueue(); notificationService.success('Lead successfully approved.'); } }); } $scope.searchLead = function (id) { $location.path('search/' + id); } $scope.rejectLead = function (leadId) { var modal = $modal.open({ templateUrl: '/Content/LeadApproval/NotApproved.html', controller: 'NotApprovedCtrl', windowClass: '', reso…
has comment: http://stackoverflow.com/comment/47734615
answer count: 1
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/47734565
favorite count: 0

http://stackoverflow.com/comment/47551421
has text: I'm not sure where the bug is: http://jsfiddle.net/eL0kh42r/
type: QuestionComment
comment on: http://stackoverflow.com/q/29707706
score: 0
type: Comment

http://stackoverflow.com/q/29787650
has comment: http://stackoverflow.com/comment/47704885
has answer: http://stackoverflow.com/a/29788045
has answer: http://stackoverflow.com/a/29787735
answer count: 6
upvote count: 1
has answer: http://stackoverflow.com/a/29787669
has answer: http://stackoverflow.com/a/29788923
has title: jQuery get the element of clicked class instead of every element with that class that is clicked
has body: Here's my HTML: new content new content new content How can I get the element of clicked class instead of every element with that class that is clicked? Here's my jquery: $('.new-content').click(function() { $(this).closest('.content').find('.row').show(); } This, however, selects all .row instead of the closest row of the clicked class =======================Update (Sorry, I oversimplified wrongly)=========== new content new content new content I want to select only one .new-answerof the clicked .new-content
downvote count: 0
has comment: http://stackoverflow.com/comment/47704801
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29787735
has comment: http://stackoverflow.com/comment/47704764
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29787879
has answer: http://stackoverflow.com/a/29787704
score: 1
has answer: http://stackoverflow.com/a/29787879
favorite count: 0
type: Question

http://stackoverflow.com/comment/47521195
type: AnswerComment
score: 0
type: Comment
has text: Hi,this doesnt work because the input multiselectid doesnt actually contain the value. the html is manipulated but hte multiselect.js to the a div with class `ms-drop `
comment on: http://stackoverflow.com/a/29692259

http://stackoverflow.com/q/29745076
tagged with: range
has body: I have a contenteditable element. I do not allow any element in the content editable besid an &lt;a&gt; tag and a &lt;br&gt; tag. I would like to know when a user selects a range and get the start container &amp; end container. Consider the following content in the editable element: &lt;div id="div1" contenteditable="true"&gt;bla bla &amp;nbsp;&lt;br&gt;&amp;nbsp;&lt;br&gt;bla2 bla2&lt;br&gt;awsome&lt;br&gt;foobar&amp;nbsp;&lt;/div&gt; Heres a Fiddle to help demonstrate this. When a user selects content the starts after the last character of some line (or better yet, at the beginning of a new empty line) and ends wherever - the range object returned by window.getSelection().getRangeAt(0) states that the start container is the editable element itself , and not the last child node selected. How can I know the correct start container? Steps for reproducing: Open the Fiddle and open web console. Start selecting text using your mouse from the end of the text (including the last space [&amp;nbps; char]) and release your mouse just before the last space in the first line. Look at the web console logs: it says the start container is the editable div instead of the text node last chosen (that contains only one char - an &amp;nbsp;) This also happens when you release your mouse just before the end of the empty line, not selecting its content.
has title: Get selection start container when selecting a line and the blank space before it in contentEditable
has comment: http://stackoverflow.com/comment/47638109
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47629914
score: 2
answer count: 0
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47627448
tagged with: contenteditable
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/47629886

http://stackoverflow.com/comment/47753648
type: QuestionComment
has text: @redbmk chatroom.xml is an empty file. Should there be anything inside? I'm sorry but I'm really new to web programming.
comment on: http://stackoverflow.com/q/29812338
score: 0
type: Comment

http://stackoverflow.com/comment/47797133
type: QuestionComment
has text: I guess it happens because you never update the original index, so after you remove the second element (data-id=1) the former third one (data-id=2) moves to the second position. If you click on it, it will report itself as having data-id=2, and you'll splice the current third element (data-id=3).
score: 0
comment on: http://stackoverflow.com/q/29835036
type: Comment

http://stackoverflow.com/comment/47598520
type: Comment
comment on: http://stackoverflow.com/a/29732075
score: 0
has text: Ok im going to edit my answer. Check it and tell me if it works now. Or what error you are getting now
type: AnswerComment

http://stackoverflow.com/q/29732820
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29764120
score: 0
answer count: 1
has title: Socket.io issue while using leapjs-rigged-hand
has comment: http://stackoverflow.com/comment/47650281
has body: I am working on making an interface for a Leap motion controlled robot. From the server side node.js, I am emitting an event 'action' which contains the data to be displayed on a HTML page. I am using leapjs-rigged-hand for visualization (https://github.com/leapmotion/leapjs-rigged-hand) undefined Shown above is the relevant part of the code. The problem is that socket callback works only before the first "riggedHand.meshAdded" event is fired. How do I make them work simultaneously?
accepted answer: http://stackoverflow.com/a/29764120
type: AnsweredQuestion
tagged with: socket.io
tagged with: leap-motion

http://stackoverflow.com/q/29705656
has comment: http://stackoverflow.com/comment/47549061
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47547240
has body: So I'm working on a project that involves cloning some objects and appending them to the same parent, I then animate these objects but my calculations always seemed to be off, and I realized it's because inline-block items always have trailing space, which would be fine but when I append a cloned item using jQuery to the parent div that trailing space isn't included which leaves things very inconsistent and difficult to work with. When inspecting the elements using browser tools, the elements claim to be identical, setting margins and padding make no difference, is this a bug or am I just missing something? Below is a simple demo to replicate the results https://jsfiddle.net/kd5opn7j/2/ $('ul').find('li').each(function(){ $('ul').append($(this).clone()); }); li { display: inline-block; width:50px; height:50px; background: #555; } &lt;ul&gt; &lt;li&gt;&lt;/li&gt; &lt;li&gt;&lt;/li&gt; &lt;li&gt;&lt;/li&gt; &lt;/ul&gt;
accepted answer: http://stackoverflow.com/a/29705685
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47546901
downvote count: 0
answer count: 1
favorite count: 0
has title: Can anyone explain why jQuery-appended inline-block items lose their space?
tagged with: css
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/47546953
linked to: http://stackoverflow.com/q/5256533
upvote count: 3
has answer: http://stackoverflow.com/a/29705685
type: Question
has comment: http://stackoverflow.com/comment/47546982
has comment: http://stackoverflow.com/comment/47547807

http://stackoverflow.com/a/29704109
type: Answer
has comment: http://stackoverflow.com/comment/47544069
answers question: http://stackoverflow.com/q/29703958
has body: you just have to use the jquery function .serialize() // Encode a set of form elements as a string for submission. or .serializeArray() // Encode a set of form elements as an array of names and values. as in your case: give your form an id. than var formArray = $('#formId').serializeArray(); and send this with ajax. and perhaps change your click event to a submit event like : $('#formId').submit(function(){ // code in here }); greetings timmi
score: 0

http://stackoverflow.com/comment/47791232
comment on: http://stackoverflow.com/q/29832327
type: QuestionComment
has text: `console.log($(containerXML).find('containers').length)` before you assume the append is the problem.
type: Comment
score: 0

http://stackoverflow.com/comment/47718602
type: QuestionComment
comment on: http://stackoverflow.com/q/29795203
type: Comment
score: 5
has text: http://stackoverflow.com/questions/14994391/thinking-in-angularjs-if-i-have-a-jquery-background

http://stackoverflow.com/comment/47580748
type: QuestionComment
has text: This seems like a big project. If you want to do this properly I recommend looking into php frameworks (symfony2 for example). In this example you can get the user's ip adress: http://stackoverflow.com/questions/9029757/how-do-i-get-the-user-ip-address-in-symfony2-controller and with the IP you can find their location. Once you have their location you can send back the corresponding view ( or a json if you are doing this via xmlhttprequest (ajax) ) containing the question's information.
score: 0
comment on: http://stackoverflow.com/q/29723183
type: Comment

http://stackoverflow.com/comment/47619763
score: 0
type: Comment
has text: i have just checked in web.config file it must be written like <pages maintainScrollPositionOnPostBack="true"/>, it works
comment on: http://stackoverflow.com/a/29741698
type: AnswerComment

http://stackoverflow.com/a/29689442
accepted answer of: http://stackoverflow.com/q/29689398
has comment: http://stackoverflow.com/comment/47515909
has comment: http://stackoverflow.com/comment/47515958
has comment: http://stackoverflow.com/comment/47515998
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47515897
has comment: http://stackoverflow.com/comment/47515983
has comment: http://stackoverflow.com/comment/47515924
has comment: http://stackoverflow.com/comment/47515985
has comment: http://stackoverflow.com/comment/47516028
type: Answer
answers question: http://stackoverflow.com/q/29689398
has comment: http://stackoverflow.com/comment/47515964
has body: Change ... link : function (scope, element, atrr) { ... to ... link : function (scope, element, attrs) { In the scope.$watch, you used chart.setData(angular.copy(JSON.parse(attrs.data))); attrs, but in the link function, you defined it as atrr; probably a simple typing error. UPDATE from CHAT: There is no data element on the chart tag; it should be something like: &lt;chart data="{{data from scope}}"&gt; Anything beyond this is another question; we are getting into how Morris.js works which is beyond the scope of this question and should be opened as another new question.
score: 1
upvote count: 1

http://stackoverflow.com/comment/47618314
type: Comment
comment on: http://stackoverflow.com/a/29742549
score: 0
has text: Thanks, Flavien Volken
type: AnswerComment

http://stackoverflow.com/comment/47674378
score: 0
type: Comment
type: QuestionComment
has text: I suggest you create a minimized example on http://jsfiddle.net/ that reproduces the issue. That would help in narrowing the cause of the issue.
comment on: http://stackoverflow.com/q/29752190

http://stackoverflow.com/comment/47541376
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29698836
type: QuestionComment
has text: @BobDoleForPresident IE 11

firebase-security
tags question: http://stackoverflow.com/q/29807548
tag name: firebase-security
tags question: http://stackoverflow.com/q/29734757
type: Tag
tags question: http://stackoverflow.com/q/29693106

http://stackoverflow.com/q/29694300
has title: How to achieve the same behaviour in Ajax
tagged with: php
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/29745804
has comment: http://stackoverflow.com/comment/47614667
score: 2
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47537029
linked to: http://stackoverflow.com/q/18701282
favorite count: 0
has comment: http://stackoverflow.com/comment/47618572
tagged with: ajax
linked to: http://stackoverflow.com/q/8312820
has body: $usrname = $this-&gt;session-&gt;userdata('username'); $password = $this-&gt;session-&gt;userdata('password'); $data = array('userName'=&gt;urlencode($usrname),'password'=&gt;urlencode($password)); $data_string = json_encode($data); $datanew = "loginemployee=". $data_string; $method = 'post'; $format = 'application/json'; $this-&gt;rest-&gt;format($format); $login_url = $this-&gt;login_url; //print_r($login_url); //exit; $result = $this-&gt;rest-&gt;{$method}($login_url, $datanew); Can anybody please assist me with this. This is actually a PHP script to login into a website, I need to achieve the same on my Cordova app which uses only HTML and JQuery, so please provide me info on how to do this. $(document).ready(function(){ $('form#loginForm').submit(function() { // loginForm is submitted var username = $('#username').attr('value'); // get username var password = $('#password').attr('value'); // get password alert(username); var UserData= {"userName":username , "password":password}; var jsonString=JSON.stringify(UserData); var datanew = "loginemployee=". $jsonString; if(jsonString) { alert("encoded"+jsonString); } if (username &amp;&amp; password) { // values are not empty $.ajax({ type: "POST", url: "http:// i know URL", // URL contentType: "application/json; charset=utf-8", dataType: "json", // send username and password as parameters data: datanew, // script call was *not* successful error: function (XMLHttpRequest, textStatus, errorThrown) { $('div#loginResult').text("responseText: " + XMLHttpRequest.responseText + ", textStatus: " + textStatus + ", `enter code here`errorThrown: " + errorThrown); $('div#loginResult').addClass("error"); }, // error // script call was successful // data contains the JSON values returned by the Perl script success: function (data) { alert("success"); if (data.error) { // script returned error $('div#loginResult').text("data.error: " + data.error); $('div#loginResult').addClass("error"); } // if else { // login was successful alert…
accepted answer: http://stackoverflow.com/a/29745804
upvote count: 2

http://stackoverflow.com/q/29743994
tagged with: qtip
score: 0
has body: Can I define a relative div to be used as content for qTip2? Here's a fiddle, that should show the problem: https://jsfiddle.net/0p1mgdse/ content: { text: $(this).parents(".item").find('.qtip-content-container') }, ...is not working to show the correspondent div (since it's a lot of those "items" in the real code, I can't use absolute divs as content).
possible better answer: http://stackoverflow.com/a/29745078
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29745078
tagged with: javascript
type: Question
answer count: 2
tagged with: jquery-selectors
tagged with: qtip2
tagged with: jquery
has title: qTip2: using relative Div-container as qTip content
has answer: http://stackoverflow.com/a/29744433
accepted answer: http://stackoverflow.com/a/29744433

http://stackoverflow.com/q/29688663
has comment: http://stackoverflow.com/comment/47517983
answer count: 3
downvote count: 0
linked to: http://stackoverflow.com/q/16296774
favorite count: 0
has answer: http://stackoverflow.com/a/29703115
linked to: http://stackoverflow.com/q/10126812
upvote count: 1
accepted answer: http://stackoverflow.com/a/29703115
possible better answer: http://stackoverflow.com/a/29704287
type: AnsweredQuestion
has title: Animate element in observableArray
has answer: http://stackoverflow.com/a/29704287
score: 1
has answer: http://stackoverflow.com/a/29698970
tagged with: knockout.js
type: Question
has body: I want to animate an element from an observable array. I'm not adding or removing items from the observableArray. Considering the following jsfiddle, I would like to call the animateFirstElement function and highlight the planet 'Mercury' I can easily get the item. But I don't know how to get it's corresponding HTML element: this.animateFirstElement = function() { alert(this.planets()[0].name); }; http://jsfiddle.net/8k8V5/2644/
has comment: http://stackoverflow.com/comment/47518016
tagged with: javascript

http://stackoverflow.com/a/29737918
has comment: http://stackoverflow.com/comment/47609213
has comment: http://stackoverflow.com/comment/47609022
type: Answer
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/47609145
has body: You're calling the functions one after the other inside of your document ready function. If you want them to show progressively, call stageOne(), and then have some logic to either advance to stage two (by calling the stageTwo function) or some navigation to go back and forth between the levels. Because stageThree is getting called last, that's why it is getting executed and rendered.
has comment: http://stackoverflow.com/comment/47609008
answers question: http://stackoverflow.com/q/29737874
score: 5

http://stackoverflow.com/comment/47545117
has text: Thanks so much for the quick and correct answer! I just jave off a jQuery with PHP api project so I'm a little rusty with angularJS quirks. Forgot the directive name changes when in html.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29704714
type: Comment

http://stackoverflow.com/q/29710817
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47562021
has answer: http://stackoverflow.com/a/29753807
possible better answer: http://stackoverflow.com/a/29713354
downvote count: 0
tagged with: angularjs-controller
type: AnsweredQuestion
score: 3
tagged with: javascript
tagged with: forms
has answer: http://stackoverflow.com/a/29713354
type: Question
has body: Let's take a simple form with one text input as an example. I want it to be in a partial so I can add other inputs to it and have one form for both create and update artist. The partial The create form The edit (or update) form In my client controller, I can create an artist : $scope.create = function() { var artist = new Artists({ name: this.name }); artist.$save(function(response) { //success! }, function(errorResponse) { $scope.error = errorResponse.data.message; }); } And I can update the name of an artist : $scope.update = function() { var artist = $scope.artist; artist.$update(function() { //success! }, function(errorResponse) { $scope.error = errorResponse.data.message; }); }; The issue is when I create an artist, this.name is undefined. If I change the data-ng-model in the parial to data-ng-model="name", I can create an artist correctly but the input doesn't get filled with the name in the update form. Any ideas on how to merge the two forms in one partial correctly?
answer count: 2
accepted answer: http://stackoverflow.com/a/29753807
favorite count: 0
has title: AngularJS: One 'partial form' for both create and update article
upvote count: 3

http://stackoverflow.com/comment/47777295
comment on: http://stackoverflow.com/q/29825387
score: 0
type: Comment
type: QuestionComment
has text: do you want the menu centered?

http://stackoverflow.com/comment/47656491
score: 1
comment on: http://stackoverflow.com/q/29762033
type: Comment
type: QuestionComment
has text: Can you post any code detailing this problem? It could be something incorrect on the client-side

http://stackoverflow.com/comment/47558553
has text: Thanks for the great answer! Does the "?:" apply to "(?!\n*\d{1,2}\/\d{1,2}\/\d{4})" only, or does it apply to "((?!\n*\d{1,2}\/\d{1,2}\/\d{4})[\s\S])+" ? The syntax tells me the latter, but then I don't understand how the content like "I did something" gets matched, because "?:" means to not capture the match.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29690579
type: AnswerComment

http://stackoverflow.com/comment/47733402
score: 0
comment on: http://stackoverflow.com/q/29802732
type: Comment
type: QuestionComment
has text: try location.href instead of location.pathname. Also check the console for errors. Also in some browsers you MUST run your javascript from a bookmark, not from location bar

http://stackoverflow.com/a/29780414
upvote count: 1
answers question: http://stackoverflow.com/q/29780315
score: 1
type: AcceptedAnswer
downvote count: 0
has body: There is no equivalent as far as I know. You need to POST the HTML form using JavaScript by constructing (and later sending in the request) a JSON payload with the values in the HTML form (kind of weird but hey, you are sending data!). Or just POST the form and build a JSON on the server side.
type: Answer
accepted answer of: http://stackoverflow.com/q/29780315

http://stackoverflow.com/a/29774121
has body: If you are going to save the drawing as an image you have a few possible solutions. Save the item somewhere in a folder and save the directory path + file name in your database Save images in the database as a blob. Blobs are really database intensive though. There are some intresting articeles about blob's. Like this one from microsoft. As expected from the common wisdom, objects smaller than 256K are best stored in a database while objects larger than 1M are best stored in the filesystem. So performance wice it would be a better solution to save the image into a directory. It's also possible to export a svgfile of an drawn image. (info) I don't know if this is any help to you, but this is my personal experience. And I agree with you that storing thousands of commands into a database isn't the best solution. So you might want to take a look at saving images somewhere, but then you would lose the ability to edit an image if you have that implemented. Update: If you don't want to save a blob the best solution would be to "render" the image each time an edit is made. So you could execute all commands when some one opens the drawing. And only apply the latest commands when an edit gets triggered. There are several options to achieve this. Like Jimmy Chandra said, firebase would be a good solution. They also provide a tutorial with pretty much has everything you want to achieve. (drawing an image using x and ycoordinates real time) Maybe you have to take a look into that. A bit more info about Firebase. Firebase is a powerful API to store and sync data in realtime This is exactly what you want to achieve I believe. You can try their full tutorial here. An other option you might take into consideration is nodejs. I've seen people using nodejs for chat systems to send the data to all other users. If you can send data, I'm sure you can draw an image with it. In the end it's up to you to choose which technology you want to use. So I think you can have to investigate a few s…
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/47679673
has comment: http://stackoverflow.com/comment/47679129
upvote count: 3
has comment: http://stackoverflow.com/comment/47679394
answers question: http://stackoverflow.com/q/29773256
has comment: http://stackoverflow.com/comment/47678889
type: Answer

http://stackoverflow.com/comment/47824885
has text: I see I have a syntax error here `...href = baseUrl = "&OP_NAME"`, which should be `...href = baseUrl + "&OP_NAME"`. And I have to ask, is there a reason you _have_ to do this with javascript? As others have said, it's possible to include the variable by using the default form in HTML.
comment on: http://stackoverflow.com/a/29824890
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47555344
type: QuestionComment
has text: Well I just need a direction to go...I don't know where to start, so any help wOuld give me direction
score: 0
comment on: http://stackoverflow.com/q/29709744
type: Comment

http://stackoverflow.com/comment/96091098
type: AnswerComment
comment on: http://stackoverflow.com/a/53946006
score: 0
type: Comment
has text: It's working. But can you figure it why we have to pass true boolean to this listener.

http://stackoverflow.com/comment/48105677
comment on: http://stackoverflow.com/a/29931367
score: 0
type: AnswerComment
type: Comment
has text: Any idea on how this might have fixed the problem for you? Just curious.

http://stackoverflow.com/comment/47583009
type: Comment
comment on: http://stackoverflow.com/a/29724223
has text: it didnt do it, I need to pass $routeParams.movieID, would you also add some alerts to the code, I really appreciate it
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47621100
type: Comment
type: QuestionComment
has text: If you change your mind and will use jQuery, you can use: $('#myDiv').css('background-color')
comment on: http://stackoverflow.com/q/29744129
score: 0

http://stackoverflow.com/comment/47723535
comment on: http://stackoverflow.com/q/29797466
score: 0
type: Comment
type: QuestionComment
has text: I think image meance you want physical image lying on file system but js cann't access file system, only ie with activex object can access it. so your cropped image cann't be written back to file system

http://stackoverflow.com/a/29691211
score: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29690707
type: Answer
has body: I have done some research on this topic, at this moment, there is no way get a single recorded file which contains both audio and video. The reason, it can be done in firefox is MediaRecorder API. I have not used RecordRTC, but suspect that internally, they use whammy.js for webm recording and recorderjs for wav recording. So the simplest solution for chrome is: record video as webm using first instance of RecordRTC. record audip as wav using second instance of RecordRTC. upload both to server and use ffmpeg to merge them. provide a link that gives user access to the merged file.
answers question: http://stackoverflow.com/q/29690707
upvote count: 4

ios
tags question: http://stackoverflow.com/q/29814095
tags question: http://stackoverflow.com/q/29766550
tags question: http://stackoverflow.com/q/29798236
type: Tag
tags question: http://stackoverflow.com/q/29842567
tags question: http://stackoverflow.com/q/29779201
tags question: http://stackoverflow.com/q/29741667
tags question: http://stackoverflow.com/q/29824724
tags question: http://stackoverflow.com/q/29727475
tags question: http://stackoverflow.com/q/29714233
tags question: http://stackoverflow.com/q/29833560
tags question: http://stackoverflow.com/q/29767278
tags question: http://stackoverflow.com/q/29800127
tags question: http://stackoverflow.com/q/29733198
tag name: ios
tags question: http://stackoverflow.com/q/29731092
tags question: http://stackoverflow.com/q/29840090
tags question: http://stackoverflow.com/q/29789135
tags question: http://stackoverflow.com/q/29770425
tags question: http://stackoverflow.com/q/29706340
tags question: http://stackoverflow.com/q/29693375
tags question: http://stackoverflow.com/q/29709291
tags question: http://stackoverflow.com/q/29709262
tags question: http://stackoverflow.com/q/29717380
tags question: http://stackoverflow.com/q/29770452
tags question: http://stackoverflow.com/q/29742213
tags question: http://stackoverflow.com/q/29708700
tags question: http://stackoverflow.com/q/29780393
tags question: http://stackoverflow.com/q/29802947
tags question: http://stackoverflow.com/q/29721103
tags question: http://stackoverflow.com/q/29716680

http://stackoverflow.com/a/29746202
has comment: http://stackoverflow.com/comment/93706494
has comment: http://stackoverflow.com/comment/93720754
has comment: http://stackoverflow.com/comment/138685017
score: 80
upvote count: 81
has body: Try code below // start time and end time var startTime = moment('12:16:59 am', 'HH:mm:ss a'); var endTime = moment('06:12:07 pm', 'HH:mm:ss a'); // calculate total duration var duration = moment.duration(endTime.diff(startTime)); // duration in hours var hours = parseInt(duration.asHours()); // duration in minutes var minutes = parseInt(duration.asMinutes()) % 60; alert(hours + ' hour and ' + minutes + ' minutes.'); Check fiddle here - https://jsfiddle.net/nil4you/gs69Lv5x/
answers question: http://stackoverflow.com/q/29745873
downvote count: 1
type: Answer

http://stackoverflow.com/comment/47594887
type: Comment
type: QuestionComment
has text: no, the usage of named vs unnamed function is not your problem here. And your second attempt is entirely gone wrong.
comment on: http://stackoverflow.com/q/29730672
score: 2

http://stackoverflow.com/comment/47775961
type: Comment
comment on: http://stackoverflow.com/a/29819508
has text: Would be good to mention that the next time, otherwise I expect you use the latest. :)
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47804160
score: 0
type: QuestionComment
has text: @vihan1086 Your method won't work if str is this: "2:B;1:A". Also, regex matching uses loops, you just don't see them in the javascript code, but the computer is looping over the string to find the match.
comment on: http://stackoverflow.com/q/29838803
type: Comment

http://stackoverflow.com/q/29834587
tagged with: random
has title: Random Monster Generator in simple Text Based RPG
has comment: http://stackoverflow.com/comment/47796298
accepted answer: http://stackoverflow.com/a/29834824
tagged with: text
type: AnsweredQuestion
has body: I'm trying to create a little text based rpg to put in practice what i learned of javascript. I tried two approaches, one is working and the other one isn't it, and I want to know why. In the first one, I created an object "monster" with a method that sets all the properties of each monster (hit points, attack points, etc). The problem with this it's i have to write the properties one by one, and it makes the code too long for my taste. /* Write JavaScript here */ /* Write JavaScript here */ $(document).ready(function() { var hero = { hitPoints: 13, armorClass: 10, attackBonus: 1, weaponDamage: 7, heroStats: function() { return "Hero" + " " + "Hit Points: " + this.hitPoints + " " + "Armor Class: " + this.armorClass + " " + "Attack Bonus: " + this.attackBonus + " " + "Weapon Damage: " + this.weaponDamage; }, alive: true }; var monster = { name: "", hitPoints: 0, armorClass: 0, attackBonus: 0, weaponDamage: 0, monsterStats: function() { return this.name + " " + "Hit Points: " + this.hitPoints + " " + "Armor Class: " + this.armorClass + " " + "Attack Bonus: " + this.attackBonus + " " + "Weapon Damage: " + this.weaponDamage; }, monsterSelected: false, selectMonster: function() { if (this.monsterSelected === false) { switch (Math.floor(Math.random() * 2) + 1) { case 1: this.name = "Werewolf"; this.hitPoints = 20; this.armorClass = 8; this.attackBonus = 4; this.weaponDamage = 3; this.monsterSelected = true; break; case 2: this.name = "Goblin"; this.hitPoints = 15; this.armorClass = 10; this.attackBonus = 4; this.weaponDamage = 3; this.monsterSelected = true; break; } } }, alive: true }; monster.selectMonster(); $(".hero_info").html(hero.heroStats()); $(".monster_info").html(monster.monsterStats()); $("button").click(function() { battle(monster); }); function battle(actualmonster) { if (actualmonster.alive === false) { actualmonster.monsterSelected = false; actualmonster.selectMonster(); $(".monster_info").html(actualmonster.monsterStats()); $(".battle_info").html(""); act…
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29834747
tagged with: javascript
has answer: http://stackoverflow.com/a/29834824
possible better answer: http://stackoverflow.com/a/29834747
score: 0

http://stackoverflow.com/comment/47554388
score: 1
has text: Good call on user experience. Whole second for animation is a lot
type: AnswerComment
comment on: http://stackoverflow.com/a/29709032
type: Comment

http://stackoverflow.com/a/29805118
type: Answer
has body: From the documentation for AngularJS, you'll find that .module('CBPWidget', []) is different from .module('CBPWidget') The latter is what you need to refer to a module, the former is for defining one. In all cases except where you first define it, you should be using the latter form.
score: 0
answers question: http://stackoverflow.com/q/29804931

http://stackoverflow.com/q/29745131
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: jQuery - Printing and previewing a specific div
upvote count: 1
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29745185
accepted answer: http://stackoverflow.com/a/29745185
type: Question
has body: I'm using the jQuery print preview plugin (https://github.com/etimbo/jquery-print-preview-plugin) to add some extra functionality to the print ability. The issue is instead of printing the entire page, I just need a small printable area to be displayed. I believe the only relevant code to this is. My first thought was to change all instances of 'body' to printableArea but had no luck in displaying anything. Any ideas? // The frame lives for (var i=0; i < window.frames.length; i++) { if (window.frames[i].name == "print-frame") { var print_frame_ref = window.frames[i].document; break; } } print_frame_ref.open(); print_frame_ref.write(' ' + ' ' + ' ' + document.title + ' ' + ' ' + ' '); print_frame_ref.close(); // Grab contents and apply stylesheet var $iframe_head = $('head link[media*=print], head link[media=all]').clone(), $iframe_body = $('body > *:not(#print-modal):not(script)').clone(); $iframe_head.each(function() { $(this).attr('media', 'all'); }); if (!$.browser.msie && !($.browser.version < 7) ) { $('head', print_frame_ref).append($iframe_head); $('body', print_frame_ref).append($iframe_body); } else { $('body > *:not(#print-modal):not(script)').clone().each(function() { $('body', print_frame_ref).append(this.outerHTML); }); $('head link[media*=print], head link[media=all]').each(function() { $('head', print_frame_ref).append($(this).clone().attr('media', 'all')[0].outerHTML); }); } HTML content
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29738740
upvote count: 1
has comment: http://stackoverflow.com/comment/47610716
accepted answer of: http://stackoverflow.com/q/29738673
has comment: http://stackoverflow.com/comment/47610613
score: 1
has comment: http://stackoverflow.com/comment/47610692
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29738673
has body: Not quite sure with statement "without using any html element", but you can just styling it using css(anything you want), see example below: Code: .myButton { width: 150px; height: 120px; border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; background-color: #6ED7DB; color: #fff; border: 1px solid #fff; font-weight: bold; font-size: 2em; padding: 10px; } INFO IRO4 Example
type: Answer

http://stackoverflow.com/q/29728412
score: 2
downvote count: 0
has answer: http://stackoverflow.com/a/29728551
has title: scroll to link id with fixed nav bar
favorite count: 0
has comment: http://stackoverflow.com/comment/47590929
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47592688
tagged with: css
has comment: http://stackoverflow.com/comment/47593045
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47590728
upvote count: 2
accepted answer: http://stackoverflow.com/a/29728551
has comment: http://stackoverflow.com/comment/47591121
has comment: http://stackoverflow.com/comment/47591817
has comment: http://stackoverflow.com/comment/47593539
type: Question
possible better answer: http://stackoverflow.com/a/78552728
has comment: http://stackoverflow.com/comment/47593749
has answer: http://stackoverflow.com/a/78552728
has body: in my web i have a fixed navigation bar and below it i have some another divs - the nav bar links connect to those links. the problem is when i click on some link the fixed nav bar covered the begining of the div. and what i want and tring to do is that the nav bar will be at the start of the div and so it wont covered the begining. here is the link for the result. here is my html code: בית מי אנחנו מוצרים צרו קשר עץ כנעני - כשעיצוב ואיכות נפגשים וייצור המוצר. א. המוצרים שלנו תאמו איתנו פגישה עוד היום here is my css code: body{ background-color: white; margin: 0px; padding: 0px; } #nav_bar{ background: rgba(255,255,255,0.9); height: 55px; position: fixed; width: 100%; top: 0; left: -2px; z-index: 2; } #nav_bar ul{ padding: 0px; text-align: center; direction: rtl; } #nav_bar ul li { display: inline-block; padding: 0 10px; color: gray; float: inherit; font-family: "alefregular"; font-size: 23px; } #nav_bar ul li a{ color: inherit; text-decoration: none; } #nav_bar ul li a:hover{ color:#a51212; } #nav_bar img{ height:18px; position:absolute; padding-right:20px; top:25px; z-index:-1px; } #about_us{ text-align: center; /*height: 250px;*/ height: 100%; font-family:"open_sans_hebrewregular", "alefregular",arial,"Times New Roman"; color:gray; } #about_us p{ width: 55%; margin: auto; text-align: center; direction: rtl; padding-bottom: 10px; line-height: 30px; } #our_services{ /*height: 450px;*/ text-align: center; font-family:"open_sans_hebrewregular", "alefregular",arial,"Times New Roman"; color: black; background-color: rgb(224,224,224); }
tagged with: javascript
has comment: http://stackoverflow.com/comment/47590953
has answer: http://stackoverflow.com/a/29728499
answer count: 3

http://stackoverflow.com/comment/47712865
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29731869
has text: @dr29222: thanks ... i also tried it and no success ... i'll see how to work round the issue .. workaround a - create separate plots for each line graph as shown in the image in my orgnl post ... then place each of the graphs in the same horizontal position as the div holding the combochart .. then change enable all the colors to be transparent with regards to everything on the plots but leave the y axis on each graph with its original colour .. it sounds crude but what do you think ..
score: 0

http://stackoverflow.com/comment/47572993
has text: @Pointy: Exactly that. The spec guarantees asynchrony. No weird corner cases where your callback sometimes happens before `.then(…)` returns, only because a promise is unexpectedly already fulfilled.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29719143
type: AnswerComment

http://stackoverflow.com/q/29707365
score: 0
has comment: http://stackoverflow.com/comment/47550506
has comment: http://stackoverflow.com/comment/47553465
has comment: http://stackoverflow.com/comment/47550458
has comment: http://stackoverflow.com/comment/47550930
has comment: http://stackoverflow.com/comment/47551639
has comment: http://stackoverflow.com/comment/47550427
has title: Getting an "Unsupported media type-415" on an ajax call- Jquery,ajax
has comment: http://stackoverflow.com/comment/47550966
has answer: http://stackoverflow.com/a/31545876
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47551573
has comment: http://stackoverflow.com/comment/47550481
has comment: http://stackoverflow.com/comment/47550927
type: Question
accepted answer: http://stackoverflow.com/a/31545876
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I'm calling an ajax function to update a certain record and I'm getting a 415-Unsupported Media type. Below is the js: $("#update").on("click", function(){ event.preventDefault(); return $.ajax('/update/record',{ method: 'PUT', data:{ date: date }, success: function(){ alert("record updated successfully"); } }); html: Update I don't know what I'm doing wrong here or what I need to add to get the correct form of the ajax call.Any ideas???? Thanks!
tagged with: ajax

http://stackoverflow.com/q/29788181
has answer: http://stackoverflow.com/a/30468602
accepted answer: http://stackoverflow.com/a/30468602
upvote count: 118
has answer: http://stackoverflow.com/a/40560110
has comment: http://stackoverflow.com/comment/47705758
linked to: http://stackoverflow.com/q/40395762
has answer: http://stackoverflow.com/a/36046173
has answer: http://stackoverflow.com/a/33558973
favorite count: 0
has comment: http://stackoverflow.com/comment/47705832
has answer: http://stackoverflow.com/a/33552196
has answer: http://stackoverflow.com/a/33563023
has title: Kyle Simpson's OLOO Pattern vs Prototype Design Pattern
has body: Does Kyle Simpson's "OLOO (Objects Linking to Other Objects) Pattern" differ in any way from the the Prototype design pattern? Other than coining it by something that specifically indicates "linking" (the behavior of prototypes) and clarifying that there's no to "copying" happening here (a behavior of classes), what exactly does his pattern introduce? Here's an example of Kyle's pattern from his book, "You Don't Know JS: this & Object Prototypes": var Foo = { init: function(who) { this.me = who; }, identify: function() { return "I am " + this.me; } }; var Bar = Object.create(Foo); Bar.speak = function() { alert("Hello, " + this.identify() + "."); }; var b1 = Object.create(Bar); b1.init("b1"); var b2 = Object.create(Bar); b2.init("b2"); b1.speak(); // alerts: "Hello, I am b1." b2.speak(); // alerts: "Hello, I am b2."
possible better answer: http://stackoverflow.com/a/31918303
has answer: http://stackoverflow.com/a/33561206
tagged with: design-patterns
type: AnsweredQuestion
score: 118
downvote count: 0
type: Question
answer count: 8
has answer: http://stackoverflow.com/a/31918303
tagged with: javascript

http://stackoverflow.com/comment/47599904
comment on: http://stackoverflow.com/a/29731321
has text: thanks mate. its working. but i also found the code who is doing the trouble it was in my themes scripts.js file - addEventListener("load", function() { setTimeout( hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } this crabby bit of code. thanks anyway
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47805345
type: Comment
has text: @Rookie Especially for you tested in on adroid 4.1.3, kernel 2.6.32, standard (most troublesome) android browser on Xperia Mini from 2011y, and chat demo works. And in case of that phone its extraordinary that something works on it, so you have great chance to success with sockets ;)
comment on: http://stackoverflow.com/a/29834181
score: 0
type: AnswerComment

http://stackoverflow.com/q/29770911
tagged with: listgrid
has answer: http://stackoverflow.com/a/29771975
tagged with: javascript
tagged with: smartgwt
type: Question
accepted answer: http://stackoverflow.com/a/29771975
has comment: http://stackoverflow.com/comment/47709936
has body: i am using SmartGWT, and i have a problem in grouping the lisgGeid when i have large data. but every thing works fine when i have small data I have set following properties to grid: sheetAnalysisListGrid = new ListGrid(); sheetAnalysisListGrid.setWidth("800"); sheetAnalysisListGrid.setHeight(365); sheetAnalysisListGrid.setShowAllRecords(true); sheetAnalysisListGrid.setCanEdit(false); sheetAnalysisListGrid.setGroupByField(TahaConstants.TCO_REPORT_PARAMETER_CATEGORY); sheetAnalysisListGrid.setShowGroupSummary(true); sheetAnalysisListGrid.setShowGroupSummaryInHeader(true); sheetAnalysisListGrid.setFields(sheetAnalysisFields); sheetAnalysisListGrid.setGroupNodeStyle("listGridGroupNode"); sheetAnalysisListGrid.setGroupIcon("TahaTCOOverview/group.png"); sheetAnalysisListGrid.setGroupStartOpen(GroupStartOpen.ALL); sheetAnalysisListGrid.addGroupByCompleteHandler(new GroupByCompleteHandler() { public void onGroupByComplete(GroupByCompleteEvent event) { sheetAnalysisListGrid.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH); } });
score: 0
answer count: 1
tagged with: gwt
has title: Grouping large data in the ListGrid
type: AnsweredQuestion

http://stackoverflow.com/comment/47936309
score: 0
type: AnswerComment
has text: Do I need to switch on "Use Auth0 instead of the IdP to do Single Sign On"?
type: Comment
comment on: http://stackoverflow.com/a/29899913

http://stackoverflow.com/q/29725828
has answer: http://stackoverflow.com/a/53946006
has answer: http://stackoverflow.com/a/54610340
downvote count: 0
has answer: http://stackoverflow.com/a/57292076
has answer: http://stackoverflow.com/a/62475261
has answer: http://stackoverflow.com/a/39884578
has body: I have built a component in React which is supposed to update its own style on window scroll to create a parallax effect. The component render method looks like this: function() { let style = { transform: 'translateY(0px)' }; window.addEventListener('scroll', (event) =&gt; { let scrollTop = event.srcElement.body.scrollTop, itemTranslate = Math.min(0, scrollTop/3 - 60); style.transform = 'translateY(' + itemTranslate + 'px)'); }); return ( &lt;div style={style}&gt;&lt;/div&gt; ); } This doesn't work because React doesn't know that the component has changed, and therefore the component is not rerendered. I've tried storing the value of itemTranslate in the state of the component, and calling setState in the scroll callback. However, this makes scrolling unusable as this is terribly slow. Any suggestion on how to do this?
has answer: http://stackoverflow.com/a/48121419
has answer: http://stackoverflow.com/a/64286783
type: Question
tagged with: reactjs
has title: Update style of a component onScroll in React.js
tagged with: javascript
upvote count: 225
possible better answer: http://stackoverflow.com/a/61018017
has answer: http://stackoverflow.com/a/60819956
has answer: http://stackoverflow.com/a/61018017
has answer: http://stackoverflow.com/a/57979747
has comment: http://stackoverflow.com/comment/47592514
has answer: http://stackoverflow.com/a/52045351
has answer: http://stackoverflow.com/a/68642656
has answer: http://stackoverflow.com/a/35467176
answer count: 17
favorite count: 0
has answer: http://stackoverflow.com/a/63034597
linked to: http://stackoverflow.com/q/36207398
has answer: http://stackoverflow.com/a/53270849
score: 225
has answer: http://stackoverflow.com/a/29726000
has answer: http://stackoverflow.com/a/69071765
accepted answer: http://stackoverflow.com/a/29726000
type: AnsweredQuestion

http://stackoverflow.com/q/29693127
type: Question
has title: How to remove the text "entries" on datatables
type: AnsweredQuestion
upvote count: 5
has answer: http://stackoverflow.com/a/29694639
tagged with: dom
answer count: 2
score: 5
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: Datatables contains "Show [dropdown] entries", for choosing how many rows the table should display at a time. I know how to remove "Show [dropdown] entries" all together by removing the l from this. dom: '&lt;"row"&lt;"col-sm-6"l&gt;&lt;"col-sm-6"f&gt;&gt;tp', How do I remove the part "entries" of "Show [dropdown] entries"? DOM added: &lt;div id="tableComputerPackages_length" class="dataTables_length"&gt; &lt;label&gt; Show &lt;select class="form-control input-sm" name="tableComputerPackages_length" aria-controls="tableComputerPackages"&gt; entries &lt;/label&gt; &lt;/div&gt;
accepted answer: http://stackoverflow.com/a/29694639
tagged with: http://stackoverflow.com/tag/html
tagged with: datatables
possible better answer: http://stackoverflow.com/a/45697974
has answer: http://stackoverflow.com/a/45697974

http://stackoverflow.com/q/29825934
tagged with: google-chrome
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29825986
has body: I'm trying to get the title of the contextMenu item clicked in chrome extension. I can get the menuItemId but not the title. function getClickHandler() { return function(info, tab) { console.warn(info.menuItemId) }; };
tagged with: google-chrome-extension
answer count: 1
favorite count: 0
type: UnansweredQuestion
has title: get contextMenu title in onclick listener chrome extension
score: 1
upvote count: 1

http://stackoverflow.com/comment/47549206
type: AnswerComment
comment on: http://stackoverflow.com/a/29705414
has text: You weren't getting any results because I forgot to check first if the timers array has more than 0 elements, before running the for loop. Now it should work, check the updated answer. Does that work for you?
score: 0
type: Comment

http://stackoverflow.com/q/29746826
has title: Target="_self" not reloading page
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/29746878
has comment: http://stackoverflow.com/comment/47625870
has answer: http://stackoverflow.com/a/29746878
has answer: http://stackoverflow.com/a/29746871
type: AnsweredQuestion
type: Question
answer count: 2
has body: I have my angular directive, and that is some div's with around it an but when I click on the div it doesn't reload my page. Am I doing something wrong? This is the full directive {{video.Title}} {{ video.Author}} I need to reload the page due to a bug in a plugin I'm using on the detail page, and nor the author of that plugin nor I can figure out what is happening, and the only way to get it work is to reload the page when going to a video.
has comment: http://stackoverflow.com/comment/47625993
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29746871
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/29728482
type: UnansweredQuestion
tagged with: google-pie-chart
upvote count: 1
has comment: http://stackoverflow.com/comment/47591686
score: 1
has title: Google Pie chart tooltip z-index
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I have a google pie chart where tooltips are rendered behind an adjacent image. How can I make sure the tooltips are displayed on top? I have set 0 for the images z-index, 10 for the overall chart but z-index is not working. Here in image :
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/35841039

http://stackoverflow.com/comment/47727891
comment on: http://stackoverflow.com/q/29798043
score: 0
type: Comment
type: QuestionComment
has text: For `QtScript` you have to implement your own `include()` using `QScriptEngine::newFunction()`.

http://stackoverflow.com/comment/47586126
has text: Beat me to it by 20 secs
comment on: http://stackoverflow.com/a/29726075
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/comment/47804093
type: Comment
type: QuestionComment
has text: @HamzaKubba First, my answer works fine for me. Second, looping through 2000 items may not be slow, but OP appears to feel it is inefficient and if there's another alternative. I would use RegExp from what I'm getting
comment on: http://stackoverflow.com/q/29838803
score: 0

http://stackoverflow.com/comment/47733736
type: AnswerComment
score: 0
has text: This question would obviously be a duplicate. Next time please find the dup and close. You have the rep to do so
type: Comment
comment on: http://stackoverflow.com/a/29802851

http://stackoverflow.com/comment/47633305
type: AnswerComment
comment on: http://stackoverflow.com/a/29750342
has text: Ok now I placed it at the end of my html and it works but it is still redirecting before the window pops up
score: 0
type: Comment

http://stackoverflow.com/comment/47700890
has text: I would consider using named functions instead of anonymous ones if they're going to be longer than a couple lines. That should reduce the visual function nesting.
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29785498

http://stackoverflow.com/a/29813036
has comment: http://stackoverflow.com/comment/47798592
has comment: http://stackoverflow.com/comment/47754608
accepted answer of: http://stackoverflow.com/q/29805673
has comment: http://stackoverflow.com/comment/47755567
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29805673
has comment: http://stackoverflow.com/comment/47754290
has body: There are 4 ways to get this done. Make the AJAX calls sequentially - see code example below or http://jsfiddle.net/xs0oypmd/ Build the marker window content when the user opens it, so move the articles html building code to within the marker click event listener and use the setContent function on the infoWindow. If going with this approach I'd suggest using a flag to indicate the first time the info window is opened so that the articles html is built only once. This approach does have the limitation that you still do not know if fortunes has loaded. Make the "fortunes" call from within "articles.php" - this assumes ownership over the php scripts. This approach means one AJAX call from the browser. Use a model binding framework, e.g. knockout, to update the infoWindow content when the data is updated via the json call Code Example For Option 1 $("#btnGetArticles").on("click", function(){ var fortunes = "test"; $.ajax({ url: "/echo/json/", type: 'post', dataType: 'json', data: { json: '"some fortune"' } }).done(function(data) { fortunes = data; $.ajax({ url: "/echo/json/", type: 'post', dataType: 'json', data: { json: '[{"link": "link/to/first/article", "title" : "first article"},{"link": "link/to/second/article", "title" : "second article"},{"link": "link/to/third/article", "title" : "third article"}]' } }).done(function(articles) { var articlesList = $("&lt;ul /&gt;"); $.each(articles, function(i, v) { articlesList.append($("&lt;li /&gt;").html(v.title + ' ' + fortunes.length)); }); $("#output").append(articlesList); }); }); });

http://stackoverflow.com/comment/47794497
type: Comment
type: QuestionComment
has text: Look up better, here it is `function(res){ a = res.getCoordinates(); }`
score: 0
comment on: http://stackoverflow.com/q/29826231

http://stackoverflow.com/comment/47542826
score: 2
has text: You don't return a value, so `undefined` is to be expected.
comment on: http://stackoverflow.com/q/29703576
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47786564
has text: Thanks and is anything mutable, i.e. are operations on string, arrays etc.. always create a copy?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29827825
type: Comment

http://stackoverflow.com/comment/47774875
type: AnswerComment
comment on: http://stackoverflow.com/a/29823712
type: Comment
has text: @vsync Yours is indeed much simpler, but it also 1) requires jQuery, and 2) only has 1 parameter (which is totally good, because it could be enough). Btw remember mine is based on *a piece of code I wrote before for finding the **next** and **previous** elements*. So thanks, I just saw there's one case where my code falls short: when the element is inside the `referenceNode` and has siblings, this will fail.
score: 0

http://stackoverflow.com/a/29788471
type: Answer
answers question: http://stackoverflow.com/q/29788364
score: 0
has body: place Button startButton = (Button) findViewById(R.id.startbutton); after setContentView(R.layout.main);

http://stackoverflow.com/a/29830634
has body: You might be looking for something like this: $.ajaxSetup({ success: function(){ callYourFunctionHere(); } }); OR $(document).bind("ajaxSend", function(){ alert('ajax fired'); callYourFunctionHere(); }); Hope it works for you.
answers question: http://stackoverflow.com/q/29830584
type: Answer
has comment: http://stackoverflow.com/comment/47788607
has comment: http://stackoverflow.com/comment/47788645
upvote count: 1
has comment: http://stackoverflow.com/comment/47788718
score: 1
has comment: http://stackoverflow.com/comment/47788023
downvote count: 0

http://stackoverflow.com/a/29730047
score: 2
answers question: http://stackoverflow.com/q/29730000
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29730000
has body: I'm not sure I understand the question correctly, but if you want to pass mI to the callback and prevent it from changing. You could use the bind() method. timeouts["mr"+mI] = setTimeout(function(x){ groups["mr"+x].expired = 1; io.sockets.emit("invite_channel",'{"type":"pullback","mI":"mr'+x+'"}'); }.bind(this,mI),120000); bind(this,mI) will pass mI as an argument to the function. Once the function is declared the value of x won't change.
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47593671

http://stackoverflow.com/q/29699959
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29702748
has comment: http://stackoverflow.com/comment/47535942
answer count: 1
downvote count: 0
tagged with: meteor
has comment: http://stackoverflow.com/comment/47535761
favorite count: 0
has title: MeteorJS Uncaught SyntaxError: Unexpected end of input
accepted answer: http://stackoverflow.com/a/29702748
has body: I have this problem with meteor and the error in the client browser is this underscore.js?0a80a8623e1b40b5df5a05582f288ddd586eaa18:1110 Uncaught SyntaxError: Unexpected end of input meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:21 Uncaught ReferenceError: Package is not defined json.js?e22856eae714c681199eabc5c0710b904b125554:21 Uncaught ReferenceError: Package is not defined base64.js?1a63019243b73298e2964e6d4680f25bca657726:21 Uncaught ReferenceError: Package is not defined ejson.js?71047b64b5196348bdbe5fd5eea9ac97a5a9eb14:21 Uncaught ReferenceError: Package is not defined logging.js?07e201b648f16be8435a4f666156995eeda0c750:21 Uncaught ReferenceError: Package is not defined reload.js?da8974b7231dd8c0caccb5f322dcf97329d486d1:21 Uncaught ReferenceError: Package is not defined tracker.js?6d0890939291d9780f7e2607ee3af3e7f98a3d9c:21 Uncaught ReferenceError: Package is not defined random.js?fe7b46080c91ce482acf6fc326afbc5b176f0502:21 Uncaught ReferenceError: Package is not defined retry.js?1f1dd2c35d300110fdaba51ce4473583bc3bf031:21 Uncaught ReferenceError: Package is not defined but in the server there is no error. Any ideas?
tagged with: node.js
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/47812917
comment on: http://stackoverflow.com/q/29842079
score: 0
type: Comment
type: QuestionComment
has text: Thanks, I had no idea the spec was on GitHub. I'll get involved. I'd generally love to be involved in new specs, but I'm not interested when it feels like the 90s.

http://stackoverflow.com/q/29803382
has answer: http://stackoverflow.com/a/29803410
accepted answer: http://stackoverflow.com/a/29803438
score: -3
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47737828
downvote count: 3
has comment: http://stackoverflow.com/comment/47734819
type: Question
has answer: http://stackoverflow.com/a/29803413
has answer: http://stackoverflow.com/a/29803438
tagged with: javascript
has body: I'm trying to print the result of a JavaScript function, but instead I get the whole function Output x7: function function () { return "hello this is form function"; } I want the output: hello this is form function HTML &lt;p id="demo"&gt;&lt;/p&gt; JavaScript var x7 = function (){ return "hello this is form function"; }; document.getElementById("demo").innerHTML = "x7: " + typeof x7 + "&lt;br&gt;"+x7+"&lt;br&gt;";
answer count: 3
upvote count: 0
has comment: http://stackoverflow.com/comment/47737690
possible better answer: http://stackoverflow.com/a/29803410
favorite count: 0
has title: Wrong output in Javascript calling function

http://stackoverflow.com/a/29829999
has body: You are missing All your networking code. you can't pass a URL like that check this example on android DOCS http://developer.android.com/reference/android/webkit/WebView.html hope it will help you. if you still need help let me know and i think you are missing INTERNET permission too.
score: 0
answers question: http://stackoverflow.com/q/29829907
type: Answer
has comment: http://stackoverflow.com/comment/47788161
has comment: http://stackoverflow.com/comment/47791399

http://stackoverflow.com/q/29721364
has title: How to Parse a complex Json into an Array using Angular/Jquery or javascript?
has comment: http://stackoverflow.com/comment/47577263
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47577298
has body: Hi I have a json data that comes from $resource request and i need to parse it into array so I could iterate through its properties. any help would be appreciated. { "feed": { "author": { "name": { "label": "iTunes Store" }, "uri": { "label": "http://www.apple.com/itunes/" } }, "entry": [ { "im:name": { "label": "Paddington" }, "im:image": [ { "label": "url1", "attributes": { "height": "60" } }, { "label": "url2", "attributes": { "height": "60" } }, { "label": "url3", "attributes": { "height": "170" } } ] }, { "im:name": { "label": "Interstellar" },"im:image": [ { "label": "url4", "attributes": { "height": "60" } }, { "label": "url5", "attributes": { "height": "60" } }, { "label": "url6", "attributes": { "height": "170" } } ] } ], "updated": { "label": "2015-04-18T11:29:36-07:00" }, "rights": { "label": "Copyright 2008 Apple Inc." }, "title": { "label": "iTunes Store: Top Movies" } } } I need to populate the labels and the Urls app.factory('movieService',function ($resource) { return $resource('https://itunes.apple.com/us/rss/topmovies/limit=50/genre=:id/json', {id: '@id'}); }); Thanks
tagged with: http://stackoverflow.com/tag/json
downvote count: 3
has comment: http://stackoverflow.com/comment/47577295
has answer: http://stackoverflow.com/a/29721437
type: Question
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47577702
tagged with: jquery
has comment: http://stackoverflow.com/comment/47577464
has comment: http://stackoverflow.com/comment/47577287
answer count: 1
tagged with: angularjs-ng-repeat
accepted answer: http://stackoverflow.com/a/29721437
favorite count: 0
tagged with: angularjs
linked to: http://stackoverflow.com/q/29712507
score: -3

http://stackoverflow.com/a/29781019
has comment: http://stackoverflow.com/comment/47693058
answers question: http://stackoverflow.com/q/29780446
has comment: http://stackoverflow.com/comment/47693128
has comment: http://stackoverflow.com/comment/47692714
has body: You can filter an image using getImageData() and putImageData(). This will require cross-origin resource sharing (CORS) to be fulfilled, e.g. the image comes from the same server as the page (a security mechanism in the browser). If that part is OK, lets do an example using your image - The best would be if your images had an alpha channel instead of white background. This would allow you to use composite operators to change the colors directly without having to parse the pixels. You can do this two ways: Punch out the background once and for all, then use composite operator (recommended) Replace all black pixels with the color With the first approach you only have to parse the pixels once. Every time you need to change the colors just use a composite operator (see demo 2 below). Using Composite Operator Here is a way to punch out the background first. We will be using a unsigned 32-bit buffer for this as this is faster than using a byte-array. We can convert the byte-buffer by using the view's buffer and create a second view for it: var data32 = new Uint32Array(idata.data.buffer); See code below for details: var img = new Image(); img.crossOrigin = ""; img.onload = punchOut; img.src = "//i.imgur.com/8NWz72w.png"; function punchOut() { var canvas = document.createElement("canvas"), ctx = canvas.getContext("2d"); document.body.appendChild(this); document.body.appendChild(canvas); // set canvas size = image size canvas.width = this.naturalWidth; canvas.height = this.naturalHeight; // draw in image ctx.drawImage(this, 0, 0); // get pixel data var idata = ctx.getImageData(0, 0, canvas.width, canvas.height), data32 = new Uint32Array(idata.data.buffer), // create a uint32 buffer i = 0, len = data32.length; while(i < len) { if (data32[i] !== 0xff000000) data32[i] = 0; // if not black, set transparent i++ } ctx.putImageData(idata, 0, 0); // put pixels back on canvas } body {background:#aaa} Now that we have a transparent image we can use composite modes to alter its colors.…
has comment: http://stackoverflow.com/comment/47692646
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47692590
upvote count: 2
has comment: http://stackoverflow.com/comment/47693214
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29780446

http://stackoverflow.com/q/29824130
favorite count: 0
has comment: http://stackoverflow.com/comment/47774626
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47774660
answer count: 4
has comment: http://stackoverflow.com/comment/47775469
tagged with: hover
downvote count: 0
has comment: http://stackoverflow.com/comment/47774837
has comment: http://stackoverflow.com/comment/47775011
has comment: http://stackoverflow.com/comment/47774637
score: 1
has answer: http://stackoverflow.com/a/29824363
has answer: http://stackoverflow.com/a/29824257
type: Question
has title: Jquery id change .attr won't fully work
has answer: http://stackoverflow.com/a/29824733
has comment: http://stackoverflow.com/comment/47781949
has comment: http://stackoverflow.com/comment/47774691
has answer: http://stackoverflow.com/a/29824270
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47774877
upvote count: 1
has body: I've got a div (which I turned in a button with .click) with the Id of knight. Whenever I press ANY of the 3 buttons (including knight) it changes the id of knight to elf (yeah I'm making a game). I've got a .hover for knight, as follows: $('#knight').hover( function () { $(this).css('background-color', 'green'); }, function () { $(this).css('background-color', 'blue'); }); That works, whenever I load the page it changes to green when I hover over it and back to blue when I get off. Change id script. $('.submenu').click(function (e){ $('#knight').attr('id', 'elf').text('Elf'); }); When I press any of the buttons (submenu) the text changes to 'Elf' and the color becomes the one in the css with id #elf css #knight{ background-color: blue; height: 20px; width: 100px; } #elf{ background-color: #00FF00; height: 20px; width: 100px; } So I assume that when I hover over it after id change it takes the following code: $('#elf').hover( function () { $(this).css('background-color', '#01DF01'); }, function () { $(this).css('background-color', '#00FF00'); }); Instead of becoming different colors of green, it becomes green and blue again. It's like after taking css traits it resets the id back to #knight. Can someone help me? Edit #1 I forgot to show the div id knight which is the actual button with .click function Choose a class. Knight That's where the $('.submenu).click function comes in. Also if someone knows another way of removing text and these buttons and make new ones if you click on one please tell me. I knew I forgot to add something.
has comment: http://stackoverflow.com/comment/47775110

http://stackoverflow.com/comment/47720433
type: QuestionComment
has text: This is Jquery not Javascript!
comment on: http://stackoverflow.com/q/29796169
score: 0
type: Comment

http://stackoverflow.com/comment/47587998
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29726969
has text: Can include example `html` ?
score: 0

http://stackoverflow.com/q/29830648
tagged with: javascript
has title: How to make hash-tags with meteorjs and iron:router?
has answer: http://stackoverflow.com/a/29831070
has body: Im trying to make hash-tags support with iron:router. Now I have data of posts, each post has an array of tags, which renders as a list of links. &lt;ul class="list-unstyled list-inline"&gt; {{#each tags}} &lt;li&gt; &lt;a class="tag" href="{{pathFor 'postsTag'}}"&gt;{{this}}&lt;/a&gt; &lt;/li&gt; {{/each}} &lt;/ul&gt; But I cannot understand how to get the value of a tag on click and to render posts according to this specific hash-tag. I can get the value of a tag by Session on click Template.post.events({ "click .tag": function(e) { Session.set('tag',this.toString()); return false; } }); But i cannot make dynamic router on it.I tried something like that Router.route('/posts/:tag',{ name: 'postsTag', data: function() { return Posts.find({tags:{$in: value_of_tag }}); } });
downvote count: 0
tagged with: meteor
favorite count: 0
tagged with: iron-router
type: UnansweredQuestion
upvote count: 1
tagged with: hashtag
score: 1
type: Question
tagged with: mongodb
answer count: 1

http://stackoverflow.com/comment/47555330
comment on: http://stackoverflow.com/a/29709620
has text: Remove it header( "Location: $location" ); from your file and return a valid url
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47748361
comment on: http://stackoverflow.com/a/29789099
score: 0
type: AnswerComment
type: Comment
has text: i'm happy it helped you. maybe you can select my response as the good one! :)

http://stackoverflow.com/q/29739326
downvote count: 2
has comment: http://stackoverflow.com/comment/47612168
tagged with: javascript
tagged with: jquery
has title: jquery nicescroll: mouse wheel issue
score: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: nicescroll
has answer: http://stackoverflow.com/a/29739607
has body: On chrome and when the page direction is 'rtl', the page cannot be scrolled when the mouse wheel is scrolled forwards, page scrolls only when the mouse wheel is scrolled backwards. you may find the issue here. $(function () { $('header').niceScroll(); })
type: Question
upvote count: 2

angularjs-ng-repeat
tags question: http://stackoverflow.com/q/29815138
tags question: http://stackoverflow.com/q/29806659
tags question: http://stackoverflow.com/q/29749026
tags question: http://stackoverflow.com/q/29839854
tags question: http://stackoverflow.com/q/29722158
tags question: http://stackoverflow.com/q/29778345
tags question: http://stackoverflow.com/q/29721734
tags question: http://stackoverflow.com/q/29808183
tags question: http://stackoverflow.com/q/29714383
tags question: http://stackoverflow.com/q/29704307
tags question: http://stackoverflow.com/q/29748160
type: Tag
tags question: http://stackoverflow.com/q/29783019
tags question: http://stackoverflow.com/q/29735884
tags question: http://stackoverflow.com/q/29819137
tags question: http://stackoverflow.com/q/29737922
tags question: http://stackoverflow.com/q/29787182
tags question: http://stackoverflow.com/q/29791020
tags question: http://stackoverflow.com/q/29822351
tags question: http://stackoverflow.com/q/29837636
tags question: http://stackoverflow.com/q/29765012
tags question: http://stackoverflow.com/q/29708998
tags question: http://stackoverflow.com/q/29813285
tags question: http://stackoverflow.com/q/29809594
tag name: angularjs-ng-repeat
tags question: http://stackoverflow.com/q/29694237
tags question: http://stackoverflow.com/q/29721364
tags question: http://stackoverflow.com/q/29698748
tags question: http://stackoverflow.com/q/29758569
tags question: http://stackoverflow.com/q/29842469
tags question: http://stackoverflow.com/q/29732153
tags question: http://stackoverflow.com/q/29689826
tags question: http://stackoverflow.com/q/29705513

http://stackoverflow.com/comment/47666636
comment on: http://stackoverflow.com/q/29767830
score: 0
type: Comment
type: QuestionComment
has text: This question has been asked many times before. I will attempt to find a duplicate.

http://stackoverflow.com/q/29731212
has title: Validation errors with form
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29732428
accepted answer: http://stackoverflow.com/a/29732428
type: Question
has comment: http://stackoverflow.com/comment/47595666
has comment: http://stackoverflow.com/comment/47596637
tagged with: javascript
tagged with: forms
score: 0
tagged with: validation
answer count: 1
has body: I am doing an assignment for school and it is a restaurant website. I am working on the "order online" page. I must include a table in my website so I put it in my form with all of my menu items and their cost and the total. The problem I am having is: I have each menu item wrapped in a form element in order to make my Javascript work but when I try to validate it, I get errors because my fieldset is outside of a form element and if I move it around I go from 3 errors to 150 and I just don't really understand why. Also, this is causing a problem with my reset button because the reset button is in a different form element then each menu item, and finally I can't get my grand total at the bottom working. Lefebvre-Oliver Final Assignment Order Online Basic Information Name: Address: City Would you like the same order as last time? Yes No Special Instructions: Order Food Item Quantity Unit Price in ($) Total Price in ($) Appetizers Spiedini di Albicocca al Prosciutto Crudo Tortino di Gorgonzola Soup and Salads Zuppa di Giorno Minestrone Piemontese Zuppa de Pesce Insalata Mista Insalata Fagioli Pizza Margherita Sicilian Chicken Florentine Pasta Bucatini all'Amatriciana Rigatoni Alla Siciliana Paglia e Fieno Orecchiette con Rapini Pappardelle con Sugo di Coniglio Dessert Chocolate Zabaglione Cake Zuccotto Tira Misu Beverages Sparkling Water Coke, Iced Tea, Root Beer, Cream Soda Coffee and Brewed Decaf Cappuccino or Americano Total Cost: Total amount
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47559045
type: AnswerComment
score: 0
type: Comment
has text: The element ID and the jQuery selector match - this is not the problem.
comment on: http://stackoverflow.com/a/29711734

http://stackoverflow.com/q/29769946
type: AnsweredQuestion
has title: How to dynamically create select with selected option
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47670462
possible better answer: http://stackoverflow.com/a/29770246
has body: I am making select tag dynamically like this, what I want to make third option selected var dropDownList = $(' ', { 'id': 'my id', // some id i want to apply 'class': 'my class', //some class i want to aply }); for (iLoop = 0; iLoop < myarray.length ; ++iLoop) { if(iLoop ==2){ $(' ', { 'value': myarray[iLoop ].value, 'text': myarray[iLoop ].text, 'selected': ?? // true/false }).appendTo(dropDownList); } else{ $(' ', { 'value': myarray[iLoop ].value, 'text': myarray[iLoop ].text, }).appendTo(dropDownList); } } Beside i dont want to make like this var selectElement=' Volvo Saab Opel Audi ';
has answer: http://stackoverflow.com/a/29770246
has answer: http://stackoverflow.com/a/29770045
tagged with: javascript
tagged with: jquery
answer count: 2
has comment: http://stackoverflow.com/comment/47670531
score: 1
has comment: http://stackoverflow.com/comment/47670602
favorite count: 0
accepted answer: http://stackoverflow.com/a/29770045
upvote count: 2
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47647087
has text: Putting user information in the user doc seems to me the most Meteoric solution. I'd prefer to have a solution which tends towards this paradigm. My motivation is that I have multiple preference parameters which will and must be independently varied. There are enough parameters that the number of required documents gets kind of silly, and it seems more logical to use session vars auto-updating from the *one* document inside a *single* tracker established *once*. I have a further motivation which is that the session vars are a bit easier to manage across different contexts than pub/subbing.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29753954

http://stackoverflow.com/comment/47719280
type: Comment
comment on: http://stackoverflow.com/q/29795438
score: 0
type: QuestionComment
has text: And why do you need an `EditorTemplate` anyway (as opposed to just `@Html.TextBoxFor(m => m.yourDate, "{0:d}", new { @class = "datePicker", @readonly = "readonly")` ?)

http://stackoverflow.com/q/29727518
has title: Get selection range values inside another selection in contentEditable
tagged with: javascript
score: 0
has body: I have a contentditable element. When user selects some text, I know about it using a keyup event. I'm interested in knowing when and if the selection has changed from last selection. The problem is (see Fiddle): html: This is a sample text js: $(function(){ var selectedRange, selectedNode; $("#div1").on("keyup mouseup", function(e) { selectedRange = window.getSelection().getRangeAt(0); selectedNode = selectedRange.commonAncestorContainer; console.log("selected node: ", selectedNode); console.log("selected node value: ", selectedNode.nodeValue); console.log("selection chars range: START POS: ", selectedRange.startOffset); console.log("selection chars range: END POS: ", selectedRange.endOffset); }); }); When a user selects some text, and then selects another text within the first selection's range (or just puts the caret inside the selected range) - the range object returns the wrong value, claiming that the selection hasn't been changed. Only after second selection/ mouse click will the range object return the correct value. It is very important for me to know the selection has changed on the first mouse click. I came across this answer, 3 years ago, hoping things have changed by now. Please note I'm supporting all major browsers (ie >=10) (e.g. no "selectstart" event in firefox). Here's how to reproduce this issue: Go to the fiddle attached, run the code and open web console. In the output window, select the word "sample" using the mouse, starting from letter "s" , releasing the mouse after letter "e". Notice the console saying the start offset ("POS") is 10 & end offset is 16. click with the mouse inside the word "sample", between letters "m" to letter "p" (selecting nothing). Notice the web console, the range start position & end position are told to stay the same. Repeat step 4. Notice correct values return by Range API now - position is 13. Thank you.
favorite count: 0
linked to: http://stackoverflow.com/q/20775824
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/8442158
tagged with: range
upvote count: 1
has answer: http://stackoverflow.com/a/29728146
has answer: http://stackoverflow.com/a/29727971
has comment: http://stackoverflow.com/comment/47589439
has comment: http://stackoverflow.com/comment/47588964
downvote count: 1
tagged with: selection
type: Question
answer count: 2

http://stackoverflow.com/a/29784144
has body: I've updated a JS fiddle to provide a sample. http://jsfiddle.net/x0z90vqg/ (Updated fiddle showing type property on xAxis if not using HighStock) I believe your issue is that you're not using the Highcharts global object's properties useUTC and timezoneOffset properties appropriately. Using the highcharts-ng control masks some of the capabilities of the Highcharts library, but you're still able to access the features you need pretty easily. The relevant piece of the fiddle is: Highcharts.setOptions({ global : { useUTC : false, timezoneOffset: -5 } }); $scope.chartConfig.getHighcharts().redraw(); The above example sets the Highcharts global object to not use UTC for the date/time series and set's the offset to -5 hours (you can obtain the needed offset using the moment.js like you already are), and then telling the chart to redraw through the highcharts-ng's exposed getHighcharts() method. That method returns the actual chart object and from there it's like you're using highcharts directly and not through any intermediary component. Edit @Matt brought up a very good point. Setting the timezoneOffset like this isn't quite the same thing as setting a true timezone. A true timezone would take into account DST changes and such, this is just a static offset from UTC. Setting the UTC offset like this also affects the entire graph, not just one series. If you require displaying (and comparing) two or more series on the same graph in different timezones, and displaying that data as their respective timezones, you can enable multiple X-axis and in the format label logic for each axis, take the X value for the tick and convert it via javascript function into the timezone'd value and label you want to display. This should result in two X-axis with labels in two different timezones, but the data in the central part of the graph running off the same UTC scale. If doing this, you would likely also want to override the formatter for the tool tip popup as well so that you can conve…
has comment: http://stackoverflow.com/comment/47722305
type: Answer
has comment: http://stackoverflow.com/comment/47722874
score: 2
answers question: http://stackoverflow.com/q/29782362
has comment: http://stackoverflow.com/comment/47722131
has comment: http://stackoverflow.com/comment/47699512
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/47626959
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29747118
has text: You could store the data from the request in an array (using a callback for each request) and wait until all data has been sent. Then you can update your table.
score: 0

http://stackoverflow.com/a/29834824
type: Answer
has comment: http://stackoverflow.com/comment/47816748
has comment: http://stackoverflow.com/comment/47798829
has comment: http://stackoverflow.com/comment/47798725
accepted answer of: http://stackoverflow.com/q/29834587
has body: The second approach is good but you're using it weird. selectMonster will randomly generate monster with some random logic and a call to new monster. But then you call selectMonster() a few times for no apparent reason. Your code should look like: var current_monster = selectMonster(); // note that you already have function named monster $(".monster_info").html(current_monster.monsterStats()); $("button").click(function() { battle(current_monster); }); You can also go all the way with prototyping to define your monsters: function Monster(name, hp, attack) { this.name = name; this.hp = hp; this.attack = attack; this.alive = true; // etc } Monster.prototype.monsterStats = function() { return this.name + "&lt;br/&gt;" + "Hit Points: " + this.hitPoints + "&lt;br/&gt;" + "Armor Class: " + this.armorClass + "&lt;br/&gt;" + "Attack Bonus: " + this.attackBonus + "&lt;br/&gt;" + "Weapon Damage: " + this.weaponDamage; } function Werewolf() { Monster.call(this, "werewolf", 5, 4); // call parent } Werewolf.prototype = new Monster(); function Goblin() { Monster.call(this, "goblin", 15, 3); // call parent } Goblin.prototype = new Monster(); var goblin = new Goblin(); console.log(goblin.hp); // 15 console.log(goblin.monsterStats()); // goblin &lt;br /&gt; etc..
score: 0
answers question: http://stackoverflow.com/q/29834587
type: AcceptedAnswer

http://stackoverflow.com/q/29772186
answer count: 2
tagged with: meanjs
tagged with: angularjs
type: UnansweredQuestion
tagged with: roles
has title: Where to add role based authentication to MeanJS app?
score: 0
type: Question
has answer: http://stackoverflow.com/a/29772448
has body: I have a meanjs starter template (with yeoman generator). Where can I add specific permissions to my modules? For instance, 'use strict'; // Configuring the Articles module angular.module('adminpanel').run(['Menus', function(Menus) { // Set top bar menu items //Menus.addMenuItem('topbar', 'admin panel', 'adminpanel/', 'adminpanel'); Menus.addMenuItem('topbar', 'Admin Panel', 'adminpanel', 'dropdown', '/buildings(/create)?'); Menus.addSubMenuItem('topbar', 'adminpanel', 'List Collections', 'adminpanel/collections'); } ]); and the routes like so 'use strict'; //Setting up route angular.module('adminpanel').config(['$stateProvider', function($stateProvider) { // Adminpanels state routing $stateProvider. state('listCollections', { url: '/adminpanel/collections', templateUrl: 'modules/adminpanels/views/list-collections.client.view.html' }). state('showCollection', { url: '/adminpanel/collections/:collectionName', templateUrl: 'modules/adminpanels/views/show-collection.client.view.html' }). state('showCollectionItem', { url: '/adminpanel/collections/:collectionName/:itemId', templateUrl: 'modules/adminpanels/views/show-item.client.view.html' }); } ]); Are these the correct places to add role-based authentication (on the client side), with added measure on the serverside (I've already done that)? Does anybody know how I can add an option to the Menus.(some function), such as 'admin.hasPermission', without breaking it? Any resources on this sort of thing? Thanks for the help!
has answer: http://stackoverflow.com/a/29902974
tagged with: javascript

http://stackoverflow.com/comment/47620110
comment on: http://stackoverflow.com/a/29742347
score: 0
type: Comment
has text: thanks, I went for something similar / a little simpler: http://www.cssscript.com/material-design-click-ripple-effect-vanilla-javascript-material-touch/
type: AnswerComment

http://stackoverflow.com/q/29771597
tagged with: template-strings
has answer: http://stackoverflow.com/a/29771751
favorite count: 0
duplicate of: http://stackoverflow.com/q/29182244
has comment: http://stackoverflow.com/comment/47673576
has comment: http://stackoverflow.com/comment/47674146
upvote count: 29
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47673596
score: 29
accepted answer: http://stackoverflow.com/a/29771751
has body: So I have this string: var name = "Chaim"; var templateStr = "Hello, my name is ${name}"; How can I convert it into a template-string so that the result would be equal to: var template = `Hello, my name is ${name}`; Is there a way to programmatically construct a Template literal?
has comment: http://stackoverflow.com/comment/47674350
type: Question
has comment: http://stackoverflow.com/comment/47673648
has title: How can I construct a Template String from a regular string?
tagged with: javascript
has comment: http://stackoverflow.com/comment/47678824
has comment: http://stackoverflow.com/comment/47673700
has comment: http://stackoverflow.com/comment/47674310
has comment: http://stackoverflow.com/comment/47678251
tagged with: ecmascript-6
has comment: http://stackoverflow.com/comment/47678737
linked to: http://stackoverflow.com/q/29182244
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47674743
has comment: http://stackoverflow.com/comment/47674618

http://stackoverflow.com/q/29720812
answer count: 1
score: 4
upvote count: 4
tagged with: browser
has answer: http://stackoverflow.com/a/29721374
tagged with: javascript
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/47576148
accepted answer: http://stackoverflow.com/a/29721374
favorite count: 0
has title: THREE.js does not render in the browser
type: Question
tagged with: three.js
has body: I was watching the tutorial of creating a solar system using the THREE.js library. However I could not see the result in the browser's window. Could you, please, help me finding an error in the code? Here is the code: Solar System - Intro (1) link to the video: https://www.youtube.com/watch?v=kzwEZjVMdkA&list=LLSn1erQiQ7lWhWY9IMOEGTw&index=5

http://stackoverflow.com/q/29783478
score: 9
downvote count: 0
tagged with: amazon-web-services
has title: How to handle KeyTooLongError Node.js(AWS)?
favorite count: 0
tagged with: node.js
answer count: 0
type: UnansweredQuestion
type: Question
upvote count: 9
has comment: http://stackoverflow.com/comment/47698903
tagged with: amazon-s3
tagged with: javascript
has body: I am trying to get some images from my S3 server, but some of them have really large URLs. How could I download those images even with the large URL? Code: //download the object from the bucket sourceS3.getObject(getparamsOrig, function(gerr, s3obj) { if (gerr) { //if there is problem just print to console and move on. console.log('Download issue'); console.log(gerr); return; } }); Debug: DEBUG [03314cb6] Download issue DEBUG [03314cb6] { [KeyTooLongError: Your key is too long] DEBUG [03314cb6] message: 'Your key is too long', DEBUG [03314cb6] code: 'KeyTooLongError', DEBUG [03314cb6] time: Tue Apr 21 2015 17:10:51 GMT-0400 (EDT), DEBUG [03314cb6] statusCode: 400, DEBUG [03314cb6] retryable: false }

http://stackoverflow.com/comment/47694273
type: Comment
has text: The solution is great but Can it be done without using animation? I mean the fillRect(x,y,1,1) method puts each pixel in its position one by one and if we add a delay then we could actually see each pixel being put?? I tried to do that and I've added a new code but there seems to be some problem.
type: AnswerComment
comment on: http://stackoverflow.com/a/29778908
score: 0

http://stackoverflow.com/comment/47645620
comment on: http://stackoverflow.com/a/29756346
type: AnswerComment
score: 0
type: Comment
has text: @Diodeus I'm not sure what you are trying to say I'm afraid. I've updated the question to make it more clear.

http://stackoverflow.com/comment/47595879
type: Comment
has text: You are welcome. Here is a version if you want to support IE<11 http://jsfiddle.net/212oc0kw/1/
type: AnswerComment
comment on: http://stackoverflow.com/a/29731216
score: 0

http://stackoverflow.com/comment/47691396
type: QuestionComment
comment on: http://stackoverflow.com/q/29780131
has text: as long as value() is a global function this can be done, but you cannot extend the base object by giving it a function that has the same name as a property, check your javascript console to see such. http://prntscr.com/6wk71d and http://prntscr.com/6wk7o7 taken directly from your fiddle. Also, for the sake of not looking like the bad boy, I didn't vote down.
score: 0
type: Comment

http://stackoverflow.com/comment/47688964
comment on: http://stackoverflow.com/q/29779232
score: 0
type: Comment
type: QuestionComment
has text: its ajax base tabs so there is no head,body tags. this is plain content.htm file. although its loading css properly.

http://stackoverflow.com/q/29807089
type: Question
has answer: http://stackoverflow.com/a/29807145
accepted answer: http://stackoverflow.com/a/29807145
answer count: 2
possible better answer: http://stackoverflow.com/a/29807204
tagged with: jquery
has title: How to handle multiple inputs of the same type in a html form?
favorite count: 0
has answer: http://stackoverflow.com/a/29807204
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
linked to: http://stackoverflow.com/q/7470268
downvote count: 0
type: AnsweredQuestion
has body: Let's say I've got a form in which you can describe a family: &lt;input type="text" name="mother"&gt; &lt;input type="text" name="father"&gt; &lt;input type="text" name="child"&gt; But I want people to be able to add an infinite number of children to the form. So I can use Javascript to simply continue adding new inputs for more children, but I wonder how I should name these. Do I simply do child1, child2, child3, etc.? And on the backend I simply loop over all the children? And what if all children also need an "age" input field. Do I simply continue adding fields such as child1_age, child2_age, child3_age? I guess this would work, but I have the feeling that there's a smarter way of this. Does anybody know of a better way to handle this? All tips are welcome!
tagged with: javascript
score: 4
tagged with: forms

http://stackoverflow.com/q/29770935
answer count: 1
has body: Is it possible to get the result on calling a url and passing the respective parameters along with the url? For example suppose I pass two nos along with the url and I get the sum back. The sum is calculated in the called url page
tagged with: javascript
has comment: http://stackoverflow.com/comment/47672288
tagged with: asp.net
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47854542
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29771060
has title: passing the parameter along with the url and getting the result back

http://stackoverflow.com/q/29700887
tagged with: javascript
tagged with: base64
score: 2
type: AnsweredQuestion
tagged with: google-chrome-extension
has title: Store a base64 string in chrome.storage
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29701881
type: Question
upvote count: 2
tagged with: local-storage
answer count: 1
accepted answer: http://stackoverflow.com/a/29701881
has body: Okay so I have a script in a Chrome extension that I'm building that grabs data, processes it, and stores it in Chrome's storage. Pretty standard stuff. // a property of the incoming 'data' object is `base64` // which contains the base64 string we are trying to save chrome.storage.local.set({'data': data}, function(){ console.log('Saved settings to localStorage!'); }); The issue is that a piece of the data object I'm trying to store is a base64 of an image. Attempting to store this results in a "QUOTA_BYTES" error, indicating that what I am trying to store is too big. My next thought was to try and chunk the data off, via something like this: chunkBase64 = function( base64 ){ var a = base64.match(/.{1,4}/g), o = {}; a.forEach(function(val,i){ o[''+i] = val; }); return o; }; ..which essentially just breaks it up into chunks and stores those chunks in an object that I then attempt to add to chrome.storage. This also fails. I also tried using standard localStorage just to store the base64, but this also does not work/fails because it is too large (?).

http://stackoverflow.com/comment/100130145
has text: This one is very useful
comment on: http://stackoverflow.com/a/31937237
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/29695147
has body: Add this styles in your stylesheet and try. #shoppingMap .headlineText:hover, #shoppingMap .sublineText:hover{ color :red; }
score: 0
answers question: http://stackoverflow.com/q/29694955
type: Answer

http://stackoverflow.com/comment/47616071
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29699945
has text: @LinkinTED Focusing the input does not mean that the keyboard is opened - the only thing we know is that when keyboard is open the input is *likely* focused - input can still be focused without keyboard being displayed.
score: 0

http://stackoverflow.com/q/29720668
type: AnsweredQuestion
score: 0
tagged with: wordpress
has answer: http://stackoverflow.com/a/29720854
type: Question
has comment: http://stackoverflow.com/comment/47575894
has title: jQuery not detect click with script added to own WordPress theme?
has comment: http://stackoverflow.com/comment/47575984
has body: I'm building my first WordPress theme and I have added my own script along with jQuery according to the info from WordPress.org codex pages, but nothing happens and I can't find the reason despite hours of searching! I'm stuck and going nowhere with this problem and need some help. Both the script and jQuery are in the header when I right click to view the code. Have I missed something? The code in the functions.php file: function add_scripts() { wp_register_script( 'custom-script', get_template_directory_uri() . '/js/script.js', array( 'jquery' ) ); wp_enqueue_script( 'custom-script' ); } add_action( 'wp_enqueue_scripts', 'add_scripts' ); The script that is really simple right now. Just for testing: jQuery(document).ready(function(){ $('document').ready(function() { //Mobile menu $("#main-menu-mobile-btn").click(function(){ alert("working!?"); $("#main-menu-mobile").slideToggle("fast"); }); }); }); And this is the HTML-code that I have added to the header.php file: test
tagged with: javascript
has comment: http://stackoverflow.com/comment/47576048
accepted answer: http://stackoverflow.com/a/29720854
answer count: 1
tagged with: jquery
tagged with: wordpress-theming
has comment: http://stackoverflow.com/comment/47575980
has comment: http://stackoverflow.com/comment/47575873

http://stackoverflow.com/a/29983940
type: Answer
has body: You can change background-color in "react-native-icons". You can choose icons only from icon font. &lt;SMXTabBarItemIOS name="home" iconName={'ion|ios-home-outline'} title={'Home'} iconSize={30} ... ... &lt;/SMXTabBarItemIOS&gt; Right now is not possible to change inactive tab text/icon color from iOS default gray. You can change only active/selected tab text/icon color via "tintColor".
answers question: http://stackoverflow.com/q/29767278
score: 0

http://stackoverflow.com/q/29791356
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/29791482
has body: I am relatively new to jquery but i need that script to start working properly. I have an jquery script for reading JSON data from url. It is working by itself but when i try to load data inside slick carousel, carousel stops working. I think that the problem is inside my script. Please help! My code: (function($){ $.fn.scores = function() { liveScores(); }; function liveScores() { setTimeout(liveScores, 5000); var jsonData = "http://url"; $.getJSON(jsonData, function(rawJsonData){ var complete =[]; //var realcatCount = rawJsonData.doc[0].data[0].realcategories.length; for (realCat = 0; realCat <= 3; realCat ++) { console.log(realCat); var basePath = rawJsonData.doc[0].data[0].realcategories[realCat] var tournament = basePath.tournaments[0].name; var name = basePath.name; var matchStatus = basePath.tournaments[0].matches[0].status._id; var homeTeam = basePath.tournaments[0].matches[0].teams.home.name; var awayTeam = basePath.tournaments[0].matches[0].teams.away.name; var time = basePath.tournaments[0].matches[0]._dt.time; var date = basePath.tournaments[0].matches[0]._dt.date; var homeScore = basePath.tournaments[0].matches[0].result.home; var awayScore = basePath.tournaments[0].matches[0].result.away; var teamIdHome = basePath.tournaments[0].matches[0].teams.home.uid; var teamIdHAway = basePath.tournaments[0].matches[0].teams.away.uid; complete.push(' '+tournament+' '+name+' '+homeScore+ ' vs. '+awayScore+' '+homeTeam+' '+awayTeam+' '); } console.log(complete); $('#results').empty().append(complete); }); }; })(jQuery); This is the order i load scripts and plugins at the bottom of the page. First i load carousels item (JSON data) and then the slick carousel itself. And the slick carousel works just fine until i put data from my plugin into it.
tagged with: plugins
accepted answer: http://stackoverflow.com/a/29791482
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has title: Jquery JSON plugin colliding with slick carousel
type: Question

http://stackoverflow.com/a/29722574
has body: Is this what you are trying to accomplish? Just replace the contents of the clickButton() function with your ajax calls. You forgot to put the () on ng-click="clickButton(). You need to actually call the function. Plunker To add the search functionality you mentioned in the comment, just add a filter to the first ng-repeat: ng-repeat="item in items| filter: {Name: search}" Plunker with search
score: 0
has comment: http://stackoverflow.com/comment/47584091
answers question: http://stackoverflow.com/q/29722158
type: Answer

http://stackoverflow.com/comment/47759821
type: Comment
comment on: http://stackoverflow.com/a/29816201
has text: thank you for your answer Anders. what do u mean that still make them dynamic by passing other props to them? can components be passed by props?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47797747
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29816459
type: QuestionComment
has text: The page keeps going back to home page even when I use the return false and POST Request xmlhttp.open("POST", "commentpost.php", true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send("page=4&comment=" + comment + "&postID=" + id); return false;

http://stackoverflow.com/a/29744682
score: 0
has comment: http://stackoverflow.com/comment/47621905
has body: You have to add max-height property. .class { max-height: 150px; overflow-y: scroll; }
type: Answer
answers question: http://stackoverflow.com/q/29744608

http://stackoverflow.com/q/29782302
score: 1
has answer: http://stackoverflow.com/a/29782403
possible better answer: http://stackoverflow.com/a/29782394
favorite count: 0
has body: I have code as below: io.on("connection", function(socket) { socket.on("req1", Handler1); }); var Handler1= function(args1) { console.log(args1); socket.emit('resp1', {id: 21321}); &lt;---- ERROR - Socket not defined } Any idea how to get access to socket obj in Handler1 ?? Declaring global object and assign socket to it works, but I don't know if it is a good solution? What will happen on many client's connections to server?
has answer: http://stackoverflow.com/a/29782394
type: Question
tagged with: node.js
has comment: http://stackoverflow.com/comment/47694646
answer count: 3
accepted answer: http://stackoverflow.com/a/29782403
upvote count: 1
tagged with: socket.io
has answer: http://stackoverflow.com/a/29782412
has title: Access to parent scope from socket.io handler
tagged with: javascript
tagged with: scope
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/47548080
type: AnswerComment
has text: How do you know if he is using jQuery ?
comment on: http://stackoverflow.com/a/29706201
type: Comment
score: 0

http://stackoverflow.com/comment/47690427
type: Comment
has text: Any JS console errors?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29779023

http://stackoverflow.com/a/29743531
has body: You can do this by index if your DOM elements will be in the same order: $('.box').hide(); $(".click-btn").on('click', function() { $('.box').slideUp('slow'); $('.total-1').children().eq($(this).parents('.single').index()).slideDown('slow'); });
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29743188
type: Answer
downvote count: 0

http://stackoverflow.com/q/29737161
has title: Check if word from one input exist in another
has answer: http://stackoverflow.com/a/29737346
answer count: 1
downvote count: 0
favorite count: 0
has body: I'm having a little problem, when I want to check if a word from one input, exist in another input. The first input can only contain one word. When I've typed a word and then hit space, the script should check if the word already exist in the second input. It works fine, except when I'm using a +-sign. If c++ exist in the second input, and I'm typing c in the first input, and then hit space, it tells that the word already exist, which is incorrect. I've tried to search to web for a solution, and what I've found was something with regEx and escaping, but it still doesn't seems to work. This is what I've tried so far: $word = $('input.word').val(); $check_here = $('input.check-here').val(); function escapeRegExp(string) { $regex = '\\b'; $regex += string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); $regex += '\\b'; $result = new RegExp($regex, "g"); return $result; } if ( escapeRegExp( $word ).test( $check_here ) ) { alert("Word exist"); } else { alert("Word do not exist"); } Live Fiddle PS: I've also tried to put $check_here in the escapeRegExp() function, like I've done with $word, but that do not work at all. A friendly person, who please can tell me whats wrong?
accepted answer: http://stackoverflow.com/a/29737346
type: AnsweredQuestion
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47607929
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/64228418
score: 0
has text: Is your issue fixed? If yes, please answer it
comment on: http://stackoverflow.com/q/29711462
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29720502
answer count: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29847990
score: 2
downvote count: 0
has body: I try to find entries by indices: var questions = db.addCollection('questions',{indices: ['key']}); questions.insert({ key: 1, quest: 'any idea' }, { key: 2, quest: 'no idea' }); questions.find({'key':1}); but I get no result. Dumping the database shows the entries. Any idea ?
tagged with: lokijs
type: Question
has title: Find by number index
tagged with: javascript
upvote count: 2

http://stackoverflow.com/q/29812728
has comment: http://stackoverflow.com/comment/47753586
has comment: http://stackoverflow.com/comment/47753722
has title: Ng-repeat isn't reading from the scope?
downvote count: 0
has comment: http://stackoverflow.com/comment/47753753
has comment: http://stackoverflow.com/comment/47753531
score: 1
type: Question
has comment: http://stackoverflow.com/comment/47753695
has comment: http://stackoverflow.com/comment/47753577
has comment: http://stackoverflow.com/comment/47753641
tagged with: javascript
has comment: http://stackoverflow.com/comment/47753463
has comment: http://stackoverflow.com/comment/47753762
has comment: http://stackoverflow.com/comment/47753690
tagged with: pug
upvote count: 1
has comment: http://stackoverflow.com/comment/47753378
answer count: 1
has body: I work with angular &amp; ng-repeat at work, which is why I am so perplexed as to why this won't render. It's probably something silly I'm overlooking, but I've spent enough time on it that it merits asking someone else for a hint. The relevant bits: JS .controller('ListCtrl', function($scope, dataAPI){ dataAPI.getIndex().then(function(res) { console.log('server response', res); $scope.notes = res; }); Jade h1 Hello this is the list div(ng-controller='ListCtrl') div(ng-repeat='note in notes') div {{ note.dist_path }} The console log of data loaded (array of objects) server response [Object, Object, Object, Object] No errors in the console. I inspect the scope, and I see exactly what I would expect. An object of arrays.
has comment: http://stackoverflow.com/comment/47753434
has answer: http://stackoverflow.com/a/29813078
has comment: http://stackoverflow.com/comment/47753729
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47753506

http://stackoverflow.com/a/29742754
answers question: http://stackoverflow.com/q/29742508
has comment: http://stackoverflow.com/comment/94872478
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29742508
has comment: http://stackoverflow.com/comment/47618975
has comment: http://stackoverflow.com/comment/47619265
score: 51
upvote count: 51
type: Answer
has body: You can set the background of an image to the loading gif. It is a simple css trick. You wouldn't need then to make a js script. .loading { background: transparent url('http://thinkfuture.com/wp-content/uploads/2013/10/loading_spinner.gif') center no-repeat; } Update : In case you have transparent images then the story becames a bit more complicated but, still can be done with css and some div elements. .image-wrapper { overflow: hidden; width: 106px; height: 106px; display: inline-block; } .image-wrapper img { float: left; display: block; opacity: 0.2; /* simulating a semitransparent image */ } .image-wrapper:after, .loading { content: ' '; background: transparent url('http://thinkfuture.com/wp-content/uploads/2013/10/loading_spinner.gif') center no-repeat ; background-size : auto 100%; width: 106px; height: 106px; float: left; display: block; } Unfortunately the browser adds a broken icon or a ? while loading, this is why the image contains an empty alt; Update 2 : The second variant relies very much on the image size, if you have difrent sizes than the loading gif won't be pushed away properly, as an alternative would be to use the first variant and a little js script that will remove the background as soon as the image is loaded: $('img').load(function(){ $(this).css('background','none'); }); .loading { background: transparent url('http://thinkfuture.com/wp-content/uploads/2013/10/loading_spinner.gif') center no-repeat; }
has comment: http://stackoverflow.com/comment/89923354
has comment: http://stackoverflow.com/comment/94869993
has comment: http://stackoverflow.com/comment/47620858

http://stackoverflow.com/a/58531661
has body: If you are confident that the period will always be less than a day you could use this one-liner: new Date(timeDiff).toISOString().slice(11,19) // HH:MM:SS N.B. This will be wrong if timeDiff is greater than a day.
downvote count: 0
score: 16
has comment: http://stackoverflow.com/comment/132894084
upvote count: 16
answers question: http://stackoverflow.com/q/29816872
type: Answer

http://stackoverflow.com/q/29811872
tagged with: while-loop
tagged with: for-loop
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29811924
has comment: http://stackoverflow.com/comment/47752352
linked to: http://stackoverflow.com/q/13944216
favorite count: 0
has comment: http://stackoverflow.com/comment/47751649
type: Question
has comment: http://stackoverflow.com/comment/47751647
has title: Or condition never evaluates to true
has comment: http://stackoverflow.com/comment/89120252
has answer: http://stackoverflow.com/a/29812034
has body: this javascript code runs successfully but I think it doesn't make through its "else" statement since it doesn't print its console...why? i = 0; for(var i=1; i&lt;4; i++) { var crazy = prompt("would you marry me?"); if(crazy === "Yes"|| "yes") { console.log("hell ya!"); } /* when it asks "will you marry me" and if the user says either "No" or "no", it does't print "ok..I'' try again next time". instead, it still says "hell ya !" */ else if (crazy ==="No" ||"no") { console.log("ok..I'll try again next time !"); } } var love = false; do { console.log("nonetheless, I LOVE YOU !"); } while(love);
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/29811941
has answer: http://stackoverflow.com/a/29811924
upvote count: 1
has answer: http://stackoverflow.com/a/29811941
downvote count: 1
tagged with: do-while
tagged with: javascript

http://stackoverflow.com/q/29726713
has comment: http://stackoverflow.com/comment/47587407
has body: This is my first time posting here and I'm only doing this because I have researched all over the place. There are questions out there that are coded similarly but they weren't looking for the right thing that would help me. var sentence = "The Shattuck is the best" var longest = function(str) { var strArr = str.split(" "); for (var i = 0; i &lt; strArr.length; i++) { for (var j = 0; j &lt; strArr.length; j++) { if (strArr[i].length &gt; strArr[j].length) { strArr.splice(j, 1); } else { j = 0 } } } return strArr }; longest(sentence); //should return Shattuck but I get an infinite loop problem.
type: Question
tagged with: function
score: -2
tagged with: arrays
tagged with: nested-loops
has comment: http://stackoverflow.com/comment/47588114
tagged with: javascript
upvote count: 2
linked to: http://stackoverflow.com/q/12216758
answer count: 3
has answer: http://stackoverflow.com/a/29726768
accepted answer: http://stackoverflow.com/a/29726768
has title: Javascript: Writing a function that returns the longest word in a string. With NO jquery used
has answer: http://stackoverflow.com/a/29726788
linked to: http://stackoverflow.com/q/17386774
has answer: http://stackoverflow.com/a/29726852
favorite count: 0
downvote count: 4
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29726788

http://stackoverflow.com/q/29714271
accepted answer: http://stackoverflow.com/a/29714380
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47563742
tagged with: angularjs
has title: get the value of ng-repeat repeated input elements
has comment: http://stackoverflow.com/comment/47563946
answer count: 4
favorite count: 0
score: 2
has answer: http://stackoverflow.com/a/29714301
upvote count: 2
tagged with: php
possible better answer: http://stackoverflow.com/a/29714457
has answer: http://stackoverflow.com/a/29714352
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29714457
has body: I am generating multiple Input box like below using ng-repeat for a listing. WIth JQuery We assign a class / unique ID and get its value. But am confused how to do the same with ng-repeat. (I am showing 50 list items in a page). Save Above code is incomplete and error code. Rephrasing the Question: How can I get the value of each input field just above the clicked Save button (When save button is Clicked) in a angular Way.
has answer: http://stackoverflow.com/a/29714380
type: Question

http://stackoverflow.com/comment/47538802
comment on: http://stackoverflow.com/a/29701520
has text: Ah, ok. I knew this was an option, but I thought there might be a better way.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47687207
type: QuestionComment
comment on: http://stackoverflow.com/q/29754736
score: 0
has text: Careful, the solution you found uses the old API. It'll work, but going forward it's going to get phased out, plus the new API functions won't make sense if you look at the reference. To change over to the new API, use the upper case call, and check this reference for conversions of the different settings: http://datatables.net/upgrade/1.10-convert
type: Comment

http://stackoverflow.com/q/29694136
answer count: 0
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47525123
tagged with: javascript
has comment: http://stackoverflow.com/comment/47524774
has body: We are using ng-resource to bring in objects from the REST endpoint. Let's suppose we have a Category page where you can edit an Item inside that category. When the controller requires objects (here a Category object and an Item object), we use resolvers to delay the Controller instancing before we inject those objects, based on id-s that we get from current route. Code is pretty self-explainable: urls.js: $routeProvider .when('/categories/:categoryId/:itemId', { controller: 'itemController', resolve: Resolvers.itemController, templateUrl: '/templates/edit-item.html', }) item.js: Resolvers.itemController = { item: ['$route', 'ItemResource', function ($route, ItemResource) { return ItemResource.get({id: $route.current.params.itemId}).$promise }], category: ['$route', 'CategoryResource', function ($route, CategoryResource) { return CategoryResource.get({id: $route.current.params.categoryId}).$promise }] } angular.module('controllers') .controller('itemController', ['$scope', 'item', 'category', function($scope, category, item) { ...... }]) We are facing difficulties unit-testing this controller. It means we need to inject category and item with stubs. Is this what we are supposed to do, is it a good track? What other industry options are there that we are missing to see? Thank you!
downvote count: 0
favorite count: 0
has title: Best pattern for injecting required ngResources to controller
has comment: http://stackoverflow.com/comment/47525263
has comment: http://stackoverflow.com/comment/47526124
tagged with: angularjs
type: UnansweredQuestion
tagged with: ngroute

http://stackoverflow.com/a/29881416
type: Answer
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29824582
has comment: http://stackoverflow.com/comment/132975290
answers question: http://stackoverflow.com/q/29824582
has body: I found the answer to this by myself. i was able to get it done this way. Read the file with InputStream and then write it to a ByteArrayOutputStream. like below. ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ... buffer.write(bytes, 0, len); Then create a byte array from it. byte[] byteArray = buffer.toByteArray(); Finally i did convert it to a Base64 String (which is also applicable in my case) using the "Base64.encodeBase64String()" method in apache.commons.codec.binary package. So i can pass Base64 String as a method parameter. If you further need there are lot of libraries(3rd-party and default) available for Base64 to Blob conversion as well.

http://stackoverflow.com/a/29859230
type: Answer
has body: It turns out the culprit was an isotope setting. The setting for .isotope-container called overflow and set to value hidden was causing the updated images to not be rendered. Once I disabled that setting the images started working as they were supposed to. I will start looking into the angular-isotope directive so that I can stop using isotope all by itself. Thank you all for the help!
accepted answer of: http://stackoverflow.com/q/29813285
answers question: http://stackoverflow.com/q/29813285
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/47785462
has text: why you don't implement it using `httpInterceptor`, which would provide you control over response..& you can easily throw an error..
comment on: http://stackoverflow.com/q/29829505
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47598413
score: 0
comment on: http://stackoverflow.com/q/29732570
has text: I forgot about that! thank you. It gave me an error of `Uncaught TypeError: Cannot read property 'value' of null` When I tried to get the value of the password input
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47561226
score: 0
has text: This exact scenario was described on css-tricks - take a look at the last code example on this post: https://css-tricks.com/multiple-simultaneous-ajax-requests-one-callback-jquery/
comment on: http://stackoverflow.com/q/29712314
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/57829515
comment on: http://stackoverflow.com/q/29786242
has text: Is this question still outstanding? If yes, please provide more details so we can help you solve it. If resolved, please close the question by (a) selecting a correct answer, or (b) providing your own answer and marking it as correct.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/30468602
type: AcceptedAnswer
type: Answer
has body: what exactly does his pattern introduce? OLOO embraces the prototype chain as-is, without needing to layer on other (IMO confusing) semantics to get the linkage. So, these two snippets have the EXACT same outcome, but get there differently. Constructor Form: function Foo() {} Foo.prototype.y = 11; function Bar() {} Bar.prototype = Object.create(Foo.prototype); Bar.prototype.z = 31; var x = new Bar(); x.y + x.z; // 42 OLOO Form: var FooObj = { y: 11 }; var BarObj = Object.create(FooObj); BarObj.z = 31; var x = Object.create(BarObj); x.y + x.z; // 42 In both snippets, an x object is Prototype-linked to an object (Bar.prototype or BarObj), which in turn is linked to third object (Foo.prototype or FooObj). The relationships and delegation are identical between the snippets. The memory usage is identical between the snippets. The ability to create many "children" (aka, many objects like x1 through x1000, etc) is identical between the snippets. The performance of the delegation (x.y and x.z) is identical between the snippets. The object creation performance is slower with OLOO, but sanity checking that reveals that the slower performance is really not an issue. What I argue OLOO offers is that it's much simpler to just express the objects and directly link them, than to indirectly link them through the constructor/new mechanisms. The latter pretends to be about classes but really is just a terrible syntax for expressing delegation (side note: so is ES6 class syntax!). OLOO is just cutting out the middle-man. Here's another comparison of class vs OLOO.
accepted answer of: http://stackoverflow.com/q/29788181
has comment: http://stackoverflow.com/comment/80563413
upvote count: 166
has comment: http://stackoverflow.com/comment/87300150
has comment: http://stackoverflow.com/comment/68042155
answers question: http://stackoverflow.com/q/29788181
downvote count: 0
score: 166
has comment: http://stackoverflow.com/comment/70721707
has comment: http://stackoverflow.com/comment/70503788

http://stackoverflow.com/comment/47562391
score: 2
comment on: http://stackoverflow.com/q/29713474
has text: You need single quotes around all the `' '`.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29799988
downvote count: 1
type: Question
linked to: http://stackoverflow.com/q/340983
tagged with: javascript
has comment: http://stackoverflow.com/comment/47728153
has title: Failing to check and change img path
has comment: http://stackoverflow.com/comment/47728209
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47729096
favorite count: 0
type: UnansweredQuestion
has body: I have two images (one black thumbs up image and a green one) and the idea is the following: when the page loads it starts with the black thumbs up; if i click the image it changes to the green thumbs up; if i click it again it goes back to the black one; This is the code i have. What am i doing wrong? &lt;script&gt; function changeImage(){ If (document.getElementById('like').src='like.png') { document.getElementById('like').src='like2.png'; } } &lt;/script&gt; &lt;img class='feed2' src='Imagens/like.png' id="like" onclick="changeImage()"&gt;
upvote count: 1
has comment: http://stackoverflow.com/comment/47728674
has answer: http://stackoverflow.com/a/29800092
has comment: http://stackoverflow.com/comment/47728206

http://stackoverflow.com/q/29744600
has answer: http://stackoverflow.com/a/29744720
tagged with: javascript
tagged with: jquery
has body: I am opening a jquery popUp div using $("#saveDialogSingleFeature").dialog(); I only want the div to appear for 3 seconds then close automatically tried this using $("#saveDialogSingleFeature").dialog('close')}, 3000); but this doesnt do anything....shouldnt it close? $(function () { $("#saveDialogSingleFeature").dialog(); $("#saveDialogSingleFeature").dialog('close')}, 3000); });
score: 0
answer count: 3
has title: set timer on jquery pop up
has answer: http://stackoverflow.com/a/29744702
has answer: http://stackoverflow.com/a/29744694
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47622680

http://stackoverflow.com/comment/85842363
type: AnswerComment
has text: @try-catch-finally Is it ok for you to post the technically correct answer?
comment on: http://stackoverflow.com/a/33129455
type: Comment
score: 3

http://stackoverflow.com/comment/47671134
score: 1
comment on: http://stackoverflow.com/q/29770122
type: Comment
has text: you can use `CSS3 transform Property`. transform: rotateX(angle) // Defines a 3D rotation along the X-axis
type: QuestionComment

oauth
tags question: http://stackoverflow.com/q/29817694
tag name: oauth
type: Tag
tags question: http://stackoverflow.com/q/29815409

http://stackoverflow.com/comment/47593466
type: Comment
comment on: http://stackoverflow.com/a/29729934
score: 0
has text: Oh wow thank you boss! This is the one im looking for, the only problem I have is it only removes my textbox because the label is on a separate is there a way I to work around this without me using a single for both the label and the textbox?
type: AnswerComment

http://stackoverflow.com/a/29733337
has body: As others have commented, the example array you provided isn't a valid JavaScript array. You could, however, keep a list for each guitar type: var mapping = { Ibanez: ['JoeSatriani','SteveVai'], Fender: ['YngwieMalmsteen','EricJohnson'] Gibson: ['EricJohnson'], Takamine: ['SteveVai'] ]; Or a list of each guitar/musician pair: var pairs = [ ['Ibanez','JoeSatriani'], ['Ibanez','SteveVai'], ['Fender','YngwieMalmsteen'], ['Fender','EricJohnson'], ['Gibson','EricJohnson'], ['Takamine','SteveVai'] ]; Your solution is going to depend on which pattern you go with. However, in the second case it can be done in one chained functional call: pairs.map(function(e) {return e[1]}) // Discard the brand names .sort() // Sort by artist .reduce(function(p,c,i,a){ if (i&gt;0 &amp;&amp; a[i]==a[i-1] &amp;&amp; !p.some(function(v) {return v == c;})) p.push(c); return p; },[]); //Return the artist names that are duplicated http://jsfiddle.net/mkurqmqd/1/ To break that reduce call down a bit, here's the callback again: function(p,c,i,a){ if (i&gt;0 &amp;&amp; a[i]==a[i-1] &amp;&amp; !p.some(function(v) { return v == c; })) p.push(c); return p; } reduce is going to call our callback for each element in the array, and it's going to pass the returned value for each call into the next call as the first parameter (p). It's useful for accumulating a list as you move across an array. Because we're looking back at the previous item, we need to make sure we don't go out of bounds on item 0. Then we're checking to see if this item matches the previous one in the (sorted) list. Then we're checking (with Array.prototype.some()) whether the value we've found is ALREADY in our list of duplicates...to avoid having duplicate duplicates! If all of those checks pass, we add the name to our list of duplicate values.
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/47599942
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29732916

http://stackoverflow.com/comment/47721617
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29796693
has text: Please refer [enter link description here][1] [1]: http://stackoverflow.com/questions/10691409/add-new-element-at-the-beginning-of-a-json
score: 0

http://stackoverflow.com/comment/47586369
type: Comment
has text: That would only allow read access, not write access. Also websockets are limited compared to regular sockets.
comment on: http://stackoverflow.com/a/29725644
score: 0
type: AnswerComment

http://stackoverflow.com/comment/135441497
score: 0
type: Comment
has text: should be import * as timekeeper from 'timekeeper'; or var timekeeper = require('timekeeper'); in 2023.
type: AnswerComment
comment on: http://stackoverflow.com/a/47781245

http://stackoverflow.com/a/29841791
has body: You should be using the following set up. With this you can call valid() on the document load and this will highlight the form straight away until you enter values into the fields. The Class (note the [Required] attributes): public class MyModel { [Required] [DataType(DataType.EmailAddress)] public string Email { get; set; } [Required] public string Text { get; set; } } The View: @using (Html.BeginForm()) { @Html.ValidationSummary(true) @Html.EditorFor(m => m.email) @Html.ValidationMessageFor(m => m.email) @Html.EditorFor(m => m.Text) @Html.ValidationMessageFor(m => m.Text) Submit } This will use the jQuery Unobtrusive Validation package linked via your Model to validate the form. If you need them, you can get the packages via the following id's in NuGet: jQuery.Validation Microsoft.jQuery.Unobtrusive.Validation As a sidenote, if you require the ability to validate the Email address field entry to be a true email address try the following package dataannotationsextensions in NuGet. Also see: http://dataannotationsextensions.org This will allow you to add further attribute info to your Model like: [Required] [Email] [DataType(DataType.EmailAddress)] public string Email { get; set; } (There are probably loads more packages out there that do the above email validation) If visually the field doesn't highlight as you expect, please check the CSS file to make sure input[type=email] is covered as well as input[type=text]
has comment: http://stackoverflow.com/comment/47815160
upvote count: 1
score: 0
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29841162

http://stackoverflow.com/q/29779302
linked to: http://stackoverflow.com/q/29785633
has comment: http://stackoverflow.com/comment/47701161
tagged with: maps
has body: I am trying to find out if one can query a graph in Sesame triplestore using JavaScript and extract the result as SPARQL/JSON. I want to extract Lat/Long values and plot on a map using leaflet.js. The follow up question is at Querying Sesame triplestore using JavaScript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47701121
accepted answer: http://stackoverflow.com/a/29784376
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29784376
has comment: http://stackoverflow.com/comment/47700809
score: 0
has comment: http://stackoverflow.com/comment/47701021
answer count: 1
tagged with: sesame
has title: Querying a Sesame triplestore using JavaScript

http://stackoverflow.com/q/29750874
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
has body: I'm using Google Custom Search Engine (https://cse.google.com). I used the client side script which creates a search element inside my html pages. The code looks like this: &lt;script&gt; (function() { var cx = 'xxxxxxxxxxxxxxxxxx:yyyyy'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); })(); &lt;/script&gt; &lt;gcse:searchresults-only&gt;&lt;/gcse:searchresults-only&gt; It works fine, but I need to add an option for users to choose which date range they want to search for. For example 'past month' or 'past week' ... I saw people are talking about a parameter called as_qdr which could be set to 'm' or 'w' for this purpose. The problem is, by using the default javascript code, I don't have access to specific API url to append as_qdr=m to. I couldn't find any good documentation about how to do this. If you take a look at http://www.reuters.com/search/news?blob=test for example you'll see what I mean. There is an option to choose the date range for the result. Is there anyone who has done this before? Thanks.
tagged with: seo
downvote count: 0
has title: Limit date range in Google Custom Search Engine
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29831493
accepted answer: http://stackoverflow.com/a/29831493
tagged with: google-custom-search
score: 1

http://stackoverflow.com/comment/47784944
type: Comment
has text: Thank you. Let me give this a try now.
comment on: http://stackoverflow.com/a/29808452
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47673941
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29771620
has text: I hope you know that users won't naturally resize the browser, right ? Most of the time, they are either on phone or computer (+ tablet). Thus, using a ìf(screen.width >= 769) {}`might be enough if it's working. Or, you'll have to create handlers who will check on resize. The best solution I can see is the one above, by @Shaggy.
score: 0

http://stackoverflow.com/comment/47637843
has text: @hindmost Thanks for your comment. Yes I have been tried a lot of different ways and failed in each way.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29752679

http://stackoverflow.com/q/29751573
has comment: http://stackoverflow.com/comment/47635553
accepted answer: http://stackoverflow.com/a/29751992
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has body: I have made a sidebar which is positioned as fixed to the left-hand side of the screen. Then where the issue comes in is the 'first' section of context is fine just when I try to add the second section of context, it basically sits its exactly on top of the first section instead of going under it. I have tried different positioning but it's always either on top of it or to the left of the screen ignoring the sidebar. So my question is, how do I get the second section to continue under the first section and the third section then of course to follow on the same way. Thanks in advance. body{ background-color: #fdfdfd; font-family: Arial, "Open Sans", sans-serif-light, sans-serif, "Segoe UI"; } #wrapper { width: 100%; height: 100%; } #sidebar{ background-color: #212528; position: fixed; width: 20%; height: 100%; top: 0; left: 0; overflow: hidden; } #nav{ color: #DADADA; display: block; max-width: 100%; } #nav ul { padding-left: 0; } #nav li{ list-style-type: none; margin: 0; padding: 0.75em 0 0.75em 0; text-align: center; max-width: 100%; } #nav li:hover { background:#333; } #nav li a { display: block; padding: 0.5em 0; } .link{ text-align: right; margin-right: 25%; letter-spacing: 1px; } #welcometext{ text-align: center; font-style: italic; text-transform: uppercase; font-size: 1em; margin-top: 2em; } #searchbar{ width: 70%; margin-left: auto; margin-right: auto; padding: 1em 1em 0.5em 1em; text-align: right; } #searchbar input{ max-width: 95%; } #sectionone { position: fixed; top: 0; right: 0; width: 80%; } #containerone { margin-top: 0; width: 80%; height: 100%; margin-left: auto; margin-right: auto; text-align: center; border-bottom: 2px solid #DADADA; box-shadow: inset 0 -6px 0 0 #fdfdfd, inset 0 -8px 0 0 #DADADA; } #header{ margin: 6em 0 6em 0; } #logo h1 { color: #ed786a; text-shadow: 0.1em 0.1em 0 rgba(0,0,0,0.1); letter-spacing: 13px; } #logo p { margin-top: -0.6em; color: #888888; letter-spacing: 4px; font-size: 0.85em; } #sectiontwo{ float: ; width: 80%; top…
has comment: http://stackoverflow.com/comment/47635294
possible better answer: http://stackoverflow.com/a/29752046
has answer: http://stackoverflow.com/a/29752046
has comment: http://stackoverflow.com/comment/47635514
has comment: http://stackoverflow.com/comment/47635525
tagged with: css
type: AnsweredQuestion
has title: DIV Sections Overlapping One Another
has comment: http://stackoverflow.com/comment/47635599
has answer: http://stackoverflow.com/a/29751992
type: Question

http://stackoverflow.com/q/29831458
has title: Troble with Nodes in HTML (hierarchyRequestError)
has comment: http://stackoverflow.com/comment/47789500
answer count: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47790072
score: 0
has body: I get an error message when I use the following code, I've looked at similar questions they all say that I must be trying to insert an element node where it can't go, but I can't see what I've done wrong. function cutSelect(){ $.each(fibre, function(i, carpet){ if(carpet.weave == 'Cut'){ pile.push(carpet); } }); document.getElementById("weaveSelect").style.display = "none"; $.each(pile, function(i, carpet){ place = document.getElementById("displayDiv"); imgLink = document.createElement("a"); img = document.createElement("img"); br = document.createElement("br"); name = document.createElement("a"); price = document.createElement("p"); extra = document.createElement("p"); imgLink.href = carpet.link; img.src = carpet.photo; img.style.width = "300px"; img.style.height = "300px"; img.style.padding = "20px, 20px, 10px, 20px"; imgLink.appendChild(img); name.href = carpet.link; name.innerHTML = carpet.name; price.innerHTML = "£" + carpet.price + "m2"; extra.innerHTML = carpet.extra; place.appendChild(imgLink); place.appendChild(br); place.appendChild(name); place.appendChild(price); place.appendChild(extra); }); } Hopefully someone can shed some light on the issue.
tagged with: javascript
has comment: http://stackoverflow.com/comment/47789459

http://stackoverflow.com/q/29804589
favorite count: 0
has title: Prevent loss of context for 'this' variable in a function passed as a parameter
tagged with: typeerror
tagged with: parameters
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29804659
score: 1
accepted answer: http://stackoverflow.com/a/29804659
upvote count: 1
type: Question
tagged with: javascript
has body: Question How can I prevent the loss of context for this variable inside a function passed as a parameter? Simple Example, also in JSFiddle var a = { start: function() { b.start( this.process ); }, process: function( justAParameter ) { justAParameter += ' of multiple contexts!' this.finish( justAParameter ); }, finish: function( finishParameter ) { console.log( finishParameter ); } } var b = { start: function( justAFunction ) { justAFunction( 'Hello world' ) } } a.start(); Expected Output Hello world of multiple contexts! Received Output TypeError: this.finish is not a function
tagged with: function
tagged with: this
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/47710595
comment on: http://stackoverflow.com/q/29790644
has text: You aren't sending JSON to the server. You need to use JSON.stringify on the data: http://stackoverflow.com/questions/6587221/send-json-data-with-jquery
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47792404
type: Comment
has text: @user384496 you're welcome! I'm glad I was able to help!
comment on: http://stackoverflow.com/a/29831184
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47610187
type: Comment
has text: You can do `parseInt(src, 10) - 1` that is going to give you the index. `src` is a property of the img element.
score: 0
comment on: http://stackoverflow.com/a/29727262
type: AnswerComment

http://stackoverflow.com/comment/47742267
type: Comment
comment on: http://stackoverflow.com/a/29806691
type: AnswerComment
has text: I just gave you an idea.. it was not the exact code that you wanted
score: 0

http://stackoverflow.com/comment/47632958
comment on: http://stackoverflow.com/a/29749598
type: AnswerComment
type: Comment
has text: I see you edited your post. The thing is, we need it to dynamic as I have stated in my question.
score: 0

http://stackoverflow.com/comment/127176422
type: Comment
has text: In my previous comment I gave some Deno code. for async import. That code worked for me, but it felt slow. In my case I had 7 files, and when I switched from async import to the barrel file approach (index.ts), my it took 0.5 seconds instead of >16 seconds.
comment on: http://stackoverflow.com/a/55049040
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47685399
comment on: http://stackoverflow.com/a/29777601
has text: @TrueBlueAussie thanks, made that change in my answer
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47774660
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29824130
has text: Wouldn't it be better to use classes instead of id ? I'm not sure modifying an ID is supported.
type: Comment

string
tags question: http://stackoverflow.com/q/29832810
tags question: http://stackoverflow.com/q/29730570
tags question: http://stackoverflow.com/q/29796976
tags question: http://stackoverflow.com/q/29724760
tags question: http://stackoverflow.com/q/29726156
tags question: http://stackoverflow.com/q/29825464
tags question: http://stackoverflow.com/q/29736077
tags question: http://stackoverflow.com/q/29705687
tags question: http://stackoverflow.com/q/29732916
tag name: string
tags question: http://stackoverflow.com/q/29737488
tags question: http://stackoverflow.com/q/29841916
tags question: http://stackoverflow.com/q/29700342
type: Tag
tags question: http://stackoverflow.com/q/29844662
tags question: http://stackoverflow.com/q/29812800
tags question: http://stackoverflow.com/q/29810843
tags question: http://stackoverflow.com/q/29757121
tags question: http://stackoverflow.com/q/29764143
tags question: http://stackoverflow.com/q/29780955
tags question: http://stackoverflow.com/q/29817546
tags question: http://stackoverflow.com/q/29733954
tags question: http://stackoverflow.com/q/29838799
tags question: http://stackoverflow.com/q/29702454
tags question: http://stackoverflow.com/q/29782632
tags question: http://stackoverflow.com/q/29688508

http://stackoverflow.com/comment/47762328
has text: please post only the relevant parts of your code
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29817706

http://stackoverflow.com/q/29836686
tagged with: canvas
has answer: http://stackoverflow.com/a/55716527
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29836798
has comment: http://stackoverflow.com/comment/47800025
tagged with: web
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47800018
has title: Code in setInterval executing more than once
has body: I'm working on a game in JavaScript, and I want to change the way it behaves. What I am looking for is a way to change the direction of gravity every 10 seconds. Here is my setInterval code, called in my draw() function, being ran whilst the game runs: setInterval(function(){ changeGravity(); },10000); and here is the code that is called: function changeGravity(){ var rnd = Math.floor((Math.random() * 4) + 1); var dir = direction[rnd]; gravity.direction = dir; } When ran, the interval lasts for 10 seconds before executing, however once executed it does not stop. What I'm looking for is for it to execute only once every 10 seconds. Thanks for your help! :)
type: Question
downvote count: 2
has comment: http://stackoverflow.com/comment/47800045
has answer: http://stackoverflow.com/a/29836727
upvote count: 3
answer count: 3

http://stackoverflow.com/comment/47749074
has text: @sesamechicken yes all feeds are brought in the same way, which is why I find this very strange, all other browsers its fine. We have a front end guy looking at it now so I'm waiting to hear back from him, will update accordingly
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29737107

http://stackoverflow.com/q/29808633
answer count: 3
has answer: http://stackoverflow.com/a/29808716
has title: AngularJS: How do I communicate data from a service to a controller?
tagged with: angularjs
has body: I'm a new to AngularJS and not terribly familiar with JavaScript. I'm trying to make a simple app using AngularJS v1.3.15. I have this controller: var app = angular.module('game', []) app.controller('SimpleController', ['market_data', function(market_data) { this.city_name = "City"; market_data.success(function(data) { console.log(data.city_name); this.city_name = data.city_name; }); }]); And this view: Hello {{simple.city_name}}! The city name line does not change from the default: City. As far as I can tell, the service, market_data seems to be working great. My call to console.log prints out the string that I expect to be returned by the service. So, data.city_name contains the proper information, but this.city_name does not update the controller. What's the best way to get this data into the controller so that it will show up in my view?
has answer: http://stackoverflow.com/a/29808800
accepted answer: http://stackoverflow.com/a/29808800
type: AnsweredQuestion
type: Question
tagged with: frameworks
has answer: http://stackoverflow.com/a/29808771
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29808716
score: 0

http://stackoverflow.com/comment/47755462
has text: Did you link the js file to the html file ? Unless the game runs on a server, you shouldnt need to launch it on a host. As long as they are in the same folder and they are LINKED. it should work
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29813974
score: 1

http://stackoverflow.com/comment/47580457
has text: Try `$('#contentArea').css('width', '786px !important');` or in javascript `center .style.width= '786px !important';`
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29723023

http://stackoverflow.com/a/29724883
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You're performing lexicographic comparison on string values. Instead, you should convert to an integer: parseInt(incoming_troops[i].value, 10) I fixed the fiddle for you: https://jsfiddle.net/ub5pw6r8/2/ var lastReach = 0; for (var i = 0; i &lt; incoming_troops.length; i++) { var x = parseInt(incoming_troops[i].value, 10); // Base-10 conversion. if (x &gt; lastReach) { lastReach = x; // Current maximum. } } // When the loop is done, we have the overall maximum. Now display it. document.getElementById("max_num").innerHTML = lastReach;
accepted answer of: http://stackoverflow.com/q/29724842
score: 3
answers question: http://stackoverflow.com/q/29724842
upvote count: 3

http://stackoverflow.com/comment/47771845
comment on: http://stackoverflow.com/q/29819286
type: Comment
type: QuestionComment
has text: @Qualiture - Thanks a lot! This was on the back of my mind, but I was really hoping to not involve another view. But it looks like this is the only way forward as I dont think any API's exists to stop the painting of the screen until a user action occurs. Much appreciated.
score: 0

http://stackoverflow.com/q/29814850
score: 4
tagged with: express
upvote count: 4
has title: Testing REST routes with curl -X PUT, returns 404
answer count: 3
has answer: http://stackoverflow.com/a/29901097
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
tagged with: curl
has answer: http://stackoverflow.com/a/38574648
has body: I'm learning about the MEAN stack and am following the MEAN tutorial over at thinkster.io https://thinkster.io/mean-stack-tutorial/ I'm on the "Opening REST Routes" section. I'm trying to PUT an upvote using curl with the command: curl -X PUT http://localhost:3000/posts/55387047f2334d2 c227e8079/upvote I get the following error messages: C:\Users\Michael\Desktop>curl -X PUT http://localhost:3000/posts/55387047f2334d2 c227e8079/upvote Not Found 404 Error: Not Found at app.use.res.render.message (C:\Users\Michael\Desktop\flapper-news\app.js: 39:13) at Layer.handle [as handle_request] (C:\Users\Michael\Desktop\flapper-news\n ode_modules\express\lib\router\layer.js:82:5) at trim_prefix (C:\Users\Michael\Desktop\flapper-news\node_modules\express\l ib\router\index.js:302:13) at C:\Users\Michael\Desktop\flapper-news\node_modules\express\lib\router\ind ex.js:270:7 at Function.proto.process_params (C:\Users\Michael\Desktop\flapper-news\node _modules\express\lib\router\index.js:321:12) at next (C:\Users\Michael\Desktop\flapper-news\node_modules\express\lib\rout er\index.js:261:10) at C:\Users\Michael\Desktop\flapper-news\node_modules\express\lib\router\ind ex.js:603:15 at next (C:\Users\Michael\Desktop\flapper-news\node_modules\express\lib\rout er\index.js:246:14) at Function.proto.handle (C:\Users\Michael\Desktop\flapper-news\node_modules \express\lib\router\index.js:166:3) at router (C:\Users\Michael\Desktop\flapper-news\node_modules\express\lib\ro uter\index.js:35:12) My mongoose schema is defined about the module.exports=app in app.js so I'm not sure what else to do. I checked my copy and pasting skills and there isn't a typo.
has answer: http://stackoverflow.com/a/29815096
type: Question
tagged with: mean-stack
tagged with: javascript

http://stackoverflow.com/comment/47575509
comment on: http://stackoverflow.com/a/29717112
type: AnswerComment
type: Comment
score: 0
has text: Seems like a mix of a scroll to and a slide down animation whith some calculations for the size. I changed the code and made some comments to explain what it does. Have fun http://jsfiddle.net/mrvtwpjp/44/

http://stackoverflow.com/comment/47743591
type: Comment
has text: OK - I wanted to make sure it wasn't critical to what you're doing.
comment on: http://stackoverflow.com/q/29806628
score: 0
type: QuestionComment

http://stackoverflow.com/q/29725201
accepted answer: http://stackoverflow.com/a/29727074
type: AnsweredQuestion
downvote count: 0
has body: I am a newbie to Chrome developer tool and I found it is very powerful. Currently, I am looking for a way to trace the flow of functions when I open a webpage and also, I am wondering is there s how can I find which function does an element trigger when it is clicked. Here are some examples: 1) Tracing function sequences: For example, there are 20 functions in my script. Some of the functions will call the other functions. I would like to trace the function calls. Like which function is called first and then what functions are called following by this function. Since these 20 functions are pretty huge, it is quite hard to follow the sequence by just looking at the script. 2) Which function does an element trigger in javascript: For example, I have one button on the webpage, there is one or are more functions associated with this element. By using the Event Listener of Chrome developer tool, I can only see some DOM elements under "Click" rather what function it is associated with. Is there a way to find associated functions? I appreciate you help!
tagged with: google-chrome-devtools
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/47584732
tagged with: javascript
upvote count: 11
has comment: http://stackoverflow.com/comment/47584795
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47584770
has comment: http://stackoverflow.com/comment/47584868
has title: Chrome developer tool trace function sequences
score: 11
has answer: http://stackoverflow.com/a/29727074

http://stackoverflow.com/comment/47770291
score: 0
has text: Thanks @Abdul for finding the dupe
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29822008

http://stackoverflow.com/comment/47799116
score: 0
has text: If I understand correctly, that's exactly what's happening. The scroll box is hidden, the iframe loads, and then when the visitor reaches a certain point on a page (specified by the user of our app), it scrolls up with the loaded iframe. Works great in chrome. Kinda weird in safari and firefox. Are iframes best to not be animated? Or is it something else?
type: Comment
comment on: http://stackoverflow.com/q/29803036
type: QuestionComment

http://stackoverflow.com/comment/47526711
has text: This did the trick indeed! Thanks a lot. Is it also possible to use only the "1" button to change the var consecutively from true to false, to true again etc.?
type: Comment
comment on: http://stackoverflow.com/a/29694981
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47664487
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29763922
has text: Notice in the URL that you have `jsonp=jQuery18305426675335038453_1429531451051`? I don't know the site, but if you leave that part out it is possible they will serve pure JSON and not JSONP. (Also, there's millions of people who read StackOverflow; one person decided you should be downvoted? Who cares? Ignore and truck on.)

http://stackoverflow.com/a/29829888
has body: This is something a lot of us are struggling with... gotta keep that DOM clean amirite? If your DOM hierarchy is predictable, you can use Template.parentData(n) to get the parent data context. Alternatively, if there's no relation to the context you need, use Blaze.getData(el). I have a feeling this will become your new best friend. I know as soon as I stumbled upon it I felt like I was cheating it was so easy. Here's my favorite use for it (in an event, iterating over all input fields): var checkFields = t.findAll('input'); var allGood = true; for (var i = 0; i &lt; checkFields.length; i++) { if (!simplyValid.validateField(Blaze.getData(checkFields[i]), checkFields[i].value)) allGood = false; } Next, if your top-most module has it's own route, you can store it as an iron router param. This is nice because it sticks the id in the url for easy sharing, I personally like clean urls, but other folks love this. Finally, my own pattern is a module-scoped object. In my case, for each route, in the onCreated I set my object window.M = {}. Then, I fill it up with local collections, a reactive dictionary, and anything else I need. I clear it onDestroyed. Sure, it's technically a global, but the scope dies with the module. Eliminate the #with: {{#with collection='clients'}} {{&gt;subTemplate}} {{/with}} Becomes {{&gt;subTemplate collection= 'clients'}} Assign the #with to an object within the context: ``` {{#with collection='clients'}} {{>subTemplate name='foobar'}} //you lose the with context here {{/with}} Becomes {{>subTemplate collection=this name='foobar'}} //you keep context inside an object Access initial parent data via spacebars' double dots &amp; reference that context all the way down {{&gt;subTemplate parent=..}} ``` Those are all the patterns I currently use to keep a clean DOM. Will be happy to edit if someone else suggests another.
answers question: http://stackoverflow.com/q/29829444
has comment: http://stackoverflow.com/comment/47787226
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/47789842
upvote count: 1
has comment: http://stackoverflow.com/comment/47853845
accepted answer of: http://stackoverflow.com/q/29829444

http://stackoverflow.com/q/29775928
accepted answer: http://stackoverflow.com/a/29776517
type: Question
has answer: http://stackoverflow.com/a/29776517
tagged with: javascript
has body: This is my javascript class var CommunicationInterface = inherit(Interface, { __constructor: function() { this.heartBeatDuration = 60 * 1000; this.client = null; this._isSetupped = false; this.__base(); }, setup: function() { // console.log('xmpp interface setup started'); var _this = this; var deferred = Q.defer(); if (this._isSetupped) { deferred.resolve(); return deferred.promise; } CommConfig.get('params') .then(function(params) { _this.client = new Client({ id: params.id + '@' + config('HOST'), password: params.password, host: config('HOST'), port: config('PORT'), reconnect: true }); _this.client.on('online', _this.onOnline.bind(_this)); setInterval(function() { _this.heartBeat.bind(_this)(params.id); }, _this.heartBeatDuration); _this._isSetupped = true; deferred.resolve(); }, function(err){ console.log(err); }); return deferred.promise; }, heartBeat: function(Id) { var stanza = this._makeMessage({ 'to': id + '@' + config('HOST'), 'type': 'chat' }, '{}'); console.log('foo'); this.client.send(stanza); console.log('bar'); }, onOnline: function() { console.log('online'); this.client.send('online'); this.emitter.emit('online'); }, }); and the test code is: describe('CommunicationInterface', function() { var commInterface; var stubGetConfig, stubCommClient, stubCommClientConnect, spyCommClientSend; var clock; before(function () { var deferred = Q.defer(); stubGetConfig = sinon.stub(CommConfig, 'get') .withArgs('params') .returns(deferred.promise); deferred.resolve({ 'id': 'test', 'password': '123456', }); stubCommClientConnect = sinon.stub(CommunicationInterface.Client.prototype, 'connect'); clock = sinon.useFakeTimers(); }); beforeEach(function () { commInterface = new CommunicationInterface(); stubCommClient = sinon.spy(commInterface.client); }); afterEach(function () { stubCommClientConnect.reset(); stubGetConfig.reset(); stubCommClient.reset(); clock.restore(); }); it('test 1', function(done) { commInterface.setup() .done(function () { var spyCommClientSend = s…
score: 0
answer count: 1
has title: Javascript sinon.js spy working in one test case but not in other
tagged with: sinon
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/a/30435997
answers question: http://stackoverflow.com/q/29734361
has body: UPDATE: It seems this was caused by the incompatibility of Sprockets 3.1.0 with angular-rails-templates. This solution got my app working: angular-rails-templates: templates are not found
accepted answer of: http://stackoverflow.com/q/29734361
upvote count: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/a/29742407
score: 0
has body: To fix your issue, you need to set the application adapter to FixtureAdapter: $ ember g adapter application then // adapters/application.js import DS from "ember-data"; export default DS.FixtureAdapter.extend({}); EDIT you'll also need to load the records in your persons route: $ ember g route persons then: //routes/persons.js export default Ember.Route.extend({ model: function() { return this.store.find('person'); } }); As far as I can tell, it's because FixtureAdapter doesn't set up smart defaults for you like the RESTAdapter does. EDIT 2: Ember has an inflector. So to Ember, the plural of person is people, which you can see in your browser console Ember.Inflector.inflector.pluralize('person') //=&gt; "people" so just rename routes/persons.js to routes/people.js and visit /people. P.S. you shouldn't need that setupController. Your model hook already does that.
has comment: http://stackoverflow.com/comment/47618488
type: Answer
answers question: http://stackoverflow.com/q/29742286

http://stackoverflow.com/comment/47763592
type: Comment
type: QuestionComment
has text: REST API works well. But the above js method hits a 404 block
comment on: http://stackoverflow.com/q/29818052
score: 0

http://stackoverflow.com/comment/47530747
has text: @Qoop In the controller or in the Twig template?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29696814
score: 0

http://stackoverflow.com/a/39644868
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29778809
downvote count: 0
score: 1
has body: Here is the complete code for validating file extension usign AngularJs {{theFile.name}} {{FileMessage}}

http://stackoverflow.com/comment/47661960
has text: Generally you're right. I would say most of the time it is `(window, document)`. This is just because mostly this objects get accessed many times, for DOM manipulation, etc.. You will see many times too, that someone passes in his favorite library, because it gets accessed many times too, like jQuery: `(window, document, window.jQuery)` Of course you could pass in `window.Date`, but how often do you access it? One or two times? So maybe you optimize the scope lookup a bit, but create a minimal longer download time, because of more chars in your code. So find a balance ;)
type: AnswerComment
comment on: http://stackoverflow.com/a/29764552
score: 0
type: Comment

http://stackoverflow.com/q/29734446
has body: JavaScript: HTML: Load More The Problem: Simply put, the script does not create a section element after the last element in the section with the ID "gallery" as intended. I've been struggling with this for hours and I'm not sure how to proceed. If someone could point out what I am doing wrong, I would appreciate it. I've looked over documentation, but to no avail.
type: Question
has comment: http://stackoverflow.com/comment/47602066
upvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
has title: Adding elements when button is clicked
favorite count: 0
score: -1
has comment: http://stackoverflow.com/comment/47602167
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47602154
has comment: http://stackoverflow.com/comment/47602209
has comment: http://stackoverflow.com/comment/47602060
has comment: http://stackoverflow.com/comment/47602264
downvote count: 1
has answer: http://stackoverflow.com/a/29734522
has comment: http://stackoverflow.com/comment/47602082
has comment: http://stackoverflow.com/comment/47602180
has comment: http://stackoverflow.com/comment/47602240

http://stackoverflow.com/comment/47795381
comment on: http://stackoverflow.com/a/29831707
score: 0
type: AnswerComment
type: Comment
has text: It's actually the opposite i'm trying to do. CT is the count of how many fields have been added. So i want on submission of the form, the hidden field to equal the value of the count.

http://stackoverflow.com/comment/47610077
score: 0
has text: This works fine when the user adds in new items by selecting from dropdown. But if ng-model already exists items doesn't get populated in the UI.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29718360

http://stackoverflow.com/q/29797130
tagged with: x-editable
tagged with: javascript
score: 0
has body: Using the http://vitalets.github.io/x-editable/ plugin. Upon posting a result, it has two callbacks: error and success. error will be triggered whenever the server doesn't respond with a 200 header. As such, the server could validate some data, and upon failure, provide a 400 response with some associated text which will be received by the client. I don't think JavaScript tracking solutions such as qbaka/GA/etc will log 400 status responses as errors, but still not positive. success, on the other hand, will be will be triggered whenever the server responds with a 200 header, and JSON could be returned which contains error status, etc, eliminating the need to use the error callback. Is one approach more appropriate than the other? Why?
answer count: 1
has answer: http://stackoverflow.com/a/29798755
has title: should response headers (i.e. 400) be used to indicate errors (particularily with x-editable)
type: UnansweredQuestion
tagged with: http
tagged with: http-headers
type: Question

http://stackoverflow.com/a/29788237
has comment: http://stackoverflow.com/comment/47706080
downvote count: 1
type: Answer
has body: as per my understanding from above i think this will help you if($(window).scrollTop() == 0){ $('#menu').addClass("sticky"); } else { $('#menu').removeClass("sticky"); }
score: 1
has comment: http://stackoverflow.com/comment/47705999
answers question: http://stackoverflow.com/q/29787966
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29787966
type: AcceptedAnswer

http://stackoverflow.com/q/29823766
answer count: 3
has comment: http://stackoverflow.com/comment/47774394
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47774411
has answer: http://stackoverflow.com/a/29824061
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29824080
has comment: http://stackoverflow.com/comment/47778308
possible better answer: http://stackoverflow.com/a/29824061
has answer: http://stackoverflow.com/a/29824369
type: Question
has title: AngularJS change body width according to page innerWidth
has answer: http://stackoverflow.com/a/29824080
tagged with: javascript
has body: I would like to make my page scrollable. Therfore i need to add width element on top of the body. if i will do width:100%; the scroller will never show, so i'm looking for a simple solution to sample to page width and set it to the body when it changes. i have two issues: i can't make it work. the watch only fires when the app loaded and not every time the window width changes. This is the code i used: $scope.$watch(function(){ return $window.innerWidth; }, function(value) { $scope.cols = value; var width = value +'px !important'; $('body').css("width", width); });
tagged with: jquery
score: 0

http://stackoverflow.com/comment/47807345
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29840448
has text: The same issue goes with the body tag. If i try to add the script element in the body tag instead of the HEAD tag as described in the code above, I face the same issue.
type: Comment

http://stackoverflow.com/comment/47647107
comment on: http://stackoverflow.com/q/29757171
score: 0
type: Comment
type: QuestionComment
has text: It's still more versatile than hard-coding complex regexes into the code.

http://stackoverflow.com/q/29832048
has title: jQuery image uploader with localStorage. Partially working. Default image not showing
type: Question
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/29832148
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I am working on a admin feature for company control panel. The widget I am trying to create is for admin's to replace the default logo on the control panel with their own company logo. I'm using localStorage for proof of concept but it will be saved into database and CMS at production. I have the basics working in terms of uploading a new image/logo and replacing the default. However, we are pre-seeding the control panel header with an "out of box" default logo. For some reason, the default logo does not show up when page is first loaded. You currently get a broken image icon. Once you upload a new image it replaces the header logo and keeps the current selection in the admin widget. If you refresh page it recalls this from localStorage which is working just fine but if you reset, you will notice that the pre-seeded logo does not appear. var img = new Image(); img.src = localStorage.theImage; $('.logoArea').html(img); $("body").on("change", ".uploadLogo", function() { var fileInput = $(this)[0]; var file = fileInput.files[0]; var reader = new FileReader(); reader.onload = function(e) { // CREATE A NEW IMAGE var img = new Image(); img.src = reader.result; localStorage.theImage = reader.result; // STORE IMAGE IN LOCAL STORAGE $(".logoArea").html(img); } reader.readAsDataURL(file); }); Not sure where I'm going wrong. Please see fiddle for working model Update: This was resolved and I updated fiddle below to working version in case it helps anyone else out. https://jsfiddle.net/evmcatj1/7/
has answer: http://stackoverflow.com/a/29832148
upvote count: 1
tagged with: local-storage

http://stackoverflow.com/a/29791164
type: Answer
upvote count: 3
score: 3
has body: You can return an object as a result var config = function() { return { name: ["john", "lucy", "lily"], age: ["22", "21", "22"], gender: ["male", "female", "female"], people: function(index) { index--; return { name: this.name[index], age: this.age[index], gender: this.gender[index] }; } }; }(); alert(config.people(1).name);
answers question: http://stackoverflow.com/q/29791063
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29791063

http://stackoverflow.com/comment/47619611
type: Comment
type: QuestionComment
has text: @zerkms I do, since you are changing the loop every time and at some point `i === in_year`. Its not advised though, better to increment `i :)`
comment on: http://stackoverflow.com/q/29743392
score: 0

http://stackoverflow.com/comment/64384075
type: AnswerComment
comment on: http://stackoverflow.com/a/36993045
score: 0
type: Comment
has text: @stepan here is the gist link to the relevant code sections of the ionic app I wrote for testing receiving of UDP broadcasts on Android https://gist.github.com/bfalzarano/e530ca80767a0aea71a145be44943941

http://stackoverflow.com/q/29726315
score: 1
upvote count: 1
has body: I want draw a image when I mousedown is fired, but I can't. What should I fix? var brush = new Image(); brush.src = "http://icons.iconarchive.com/icons/designcontest/vintage/256/Brush-icon.png" brush.onload = function(){ $("&lt;canvas&gt;&lt;/canvas&gt;").appendTo("body"); var canvas = $('canvas'); var context = canvas[0].getContext('2d'); canvas.width(500).height(300); $('canvas').mousedown(function(event){ alert('canvas clicked on coordinates ('+event.pageX+','+event.pageY+')'); contex.drawImage(brush, event.pageX, event.pageY); }) } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;body&gt; &lt;/body&gt;
type: Question
has answer: http://stackoverflow.com/a/29726358
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29726358
tagged with: canvas
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has title: Image doesn't print when event is triggered
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion

http://stackoverflow.com/comment/47606137
has text: got that @Sean updated then with "track by $index" in ng-repeat
comment on: http://stackoverflow.com/q/29735884
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47771448
has text: BTW, you should be accepting answers for previous questions, if they've actually answered your questions.
score: 0
comment on: http://stackoverflow.com/a/29822624
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29736212
has comment: http://stackoverflow.com/comment/47606705
score: 0
has comment: http://stackoverflow.com/comment/47605868
upvote count: 1
answer count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/29736915
has comment: http://stackoverflow.com/comment/47606078
has body: i have been working on a website for the last couple days. I uploaded it just now and have no idea why I'm getting little lines at the peak of images on scroll events? Any idea how solve this? The website is http://oliverkle.in Essentially i have the images with an altered speed using JQuery. I'll show the basis of an image and its HTML: &lt;div class="mountains1"&gt;&lt;/div&gt; CSS: .mountains1 { background: url(../img/mountains1.png) repeat; background-size: cover; width: 100%; height: 800px; position: absolute; z-index: 13; } and JavaScript: var parallax = function(){ var $scrollY = $(window).scrollTop(); var $scrollX = $(window).scrollLeft(); $('.mountains1' ).css('top', '1640' -($scrollY * 1) + 'px'); } $(document).ready(function(){parallax();}); $(window).scroll(function(){parallax();}); ps. I'm using safari, when the bug occurs, it doesn't happen in chrome. When i use the ceil() or round() method for some reason it breaks it? Here are the changes i made in response to Leo var parallax = function(){ var $scrollY = $(window).scrollTop(); var $scrollX = $(window).scrollLeft(); var $scrollYint = Math.round($scrollY); $('.cloudback' ).css('top', '-375' -($scrollYint * 0.4) + 'px'); $('.mountains1' ).css('top', '1640' -($scrollYint * 1) + 'px'); $('.mountains2' ).css('top', '1200'-($scrollYint * 0.75) + 'px'); $('.mountains3' ).css('top', '720'-($scrollYint * 0.3) + 'px'); $('.navbar2' ).css('top', '1700' -($scrollYint * 0.7) + 'px'); $('.forest1' ).css('top', '3100' -($scrollYint * 0.8) + 'px'); $('.forest2' ).css('top', '2600'-($scrollYint * 0.6) + 'px'); $('.forest3' ).css('top', '2100'-($scrollYint * 0.4) + 'px'); $('.navbar3' ).css('top', '3600' -($scrollYint * 0.8) + 'px'); //$('.grass1' ).css('top', '5250' -($scrollY * 0.8) + 'px'); //$('.grass2' ).css('top', '4500'-($scrollY * 0.6) + 'px'); //$('.grass3' ).css('top', '3750'-($scrollY * 0.4) + 'px'); //$('.navbar4' ).css('top', '5500' -($scrollY * 0.8) + 'px'); }
tagged with: javascript
has comment: http://stackoverflow.com/comment/47605681
has comment: http://stackoverflow.com/comment/47605677
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47605600
has comment: http://stackoverflow.com/comment/47605703
favorite count: 0
has comment: http://stackoverflow.com/comment/47606938
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47605706
has answer: http://stackoverflow.com/a/29736915
has title: Weird line bug at the top of images?

http://stackoverflow.com/comment/47848243
has text: The only change that was necessary was to swap which point the modulus is added to. I'm hoping that you see that this class of problems uses the modulus and not a while loop. The problem you've stated feels very much like a homework problem, so if it is, I'd hope that's the takeaway.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29836878
type: AnswerComment

http://stackoverflow.com/comment/51443184
type: Comment
has text: @UFM http://getbootstrap.com/javascript/#tabs
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29802587

http://stackoverflow.com/a/29841204
score: 0
accepted answer of: http://stackoverflow.com/q/29841167
type: Answer
answers question: http://stackoverflow.com/q/29841167
type: AcceptedAnswer
has body: There is no function that can allow you to click on a certain part of a default HTML element like Drop Down. When you click on the inspect element, you'll see that the Drop down is a basic unit and can't be divided into sub-elements so that you can fetch teh exact area that is clicked for drop-down

http://stackoverflow.com/comment/48016869
type: AnswerComment
score: 0
type: Comment
has text: Just have the ad code within a div, that you can later clear, and reinsert somewhere else.
comment on: http://stackoverflow.com/a/29691840

http://stackoverflow.com/comment/57183221
comment on: http://stackoverflow.com/a/30863451
has text: I use it in my demo project. you can refer to the demo https://github.com/kaich/ASReact/blob/master/App/Main/TypePage.js
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29775491
has body: You could context.fillRect each newly changed pixel on the canvas as it's calculated. Something like this (warning: untested code, may need tweeks!): var n=i/4; var y=parseInt(n/canvas.width); var x=n-y*canvas.width; context.fillStyle='rgba('+d[i]+','+d[i+1]+','+d[i+2]+','+d[i+3]/255')'; context.fillRect(x,y,1,1); Here's demo code that first does the inverting and then shows the effect over time: var canvas=document.getElementById("canvas"); var ctx=canvas.getContext("2d"); var cw=canvas.width; var ch=canvas.height; var nextTime=0; // a new line of converted image will be displayed // after this delay var delay=1000/60*2; var y=0; var imgData,d; var img=new Image(); img.crossOrigin='anonymous'; img.onload=start; img.src="https://dl.dropboxusercontent.com/u/139992952/multple/sun.png"; function start(){ cw=canvas.width=img.width; ch=canvas.height=img.height; ctx.drawImage(img,0,0); imgData=ctx.getImageData(0,0,cw,ch); d=imgData.data; for (var i=0; i&lt; d.length; i+=4) { d[i] = 255 - d[i]; d[i+1] = 255 - d[i+1]; d[i+2] = 255 - d[i+2]; } requestAnimationFrame(animate); } function animate(time){ if(time&lt;nextTime){requestAnimationFrame(animate); return;} nextTime=time+delay; for(var x=0;x&lt;cw;x++){ var i=(y*cw+x)*4; ctx.fillStyle='rgba('+d[i]+','+d[i+1]+','+d[i+2]+','+d[i+3]/255+')'; ctx.fillRect(x,y,1,1); } if(++y&lt;ch){ requestAnimationFrame(animate); }else{ ctx.putImageData(imgData,0,0); } } body{ background-color: ivory; } #canvas{border:1px solid red;} &lt;canvas id="canvas" width=300 height=300&gt;&lt;/canvas&gt;
accepted answer of: http://stackoverflow.com/q/29770093
score: -1
answers question: http://stackoverflow.com/q/29770093
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/47697425
type: Answer
has comment: http://stackoverflow.com/comment/47693614
upvote count: 0

http://stackoverflow.com/comment/47623901
type: QuestionComment
comment on: http://stackoverflow.com/q/29745596
has text: test your issue with this code `alert(moment(testDate).format('MM/DD/YYYY'));`
type: Comment
score: 0

http://stackoverflow.com/a/29783729
has body: I'd definitely recommend using the meteor events as everyone else suggested. What you had actually works, it is just since the div with the "folders" class has no content, the div is very small (unless you have a height attribute on ".folders" or "#google_drive_thumbnail") and thus very hard to click on. Inspect element on the div and you'll see the size
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29781327
score: 1
downvote count: 0

http://stackoverflow.com/comment/47536819
type: QuestionComment
type: Comment
score: 0
has text: Sounds like you may have a much bigger problem than finding how to highlight the text. If you have a table with "very large data like 800 ,2000, 5000 rows", that is going to make navigating the page to find highlighted text a nightmare. Filtering the table with only relevant results in a better solution, like this example: http://codepen.io/PageOnline/pen/nCfAj
comment on: http://stackoverflow.com/q/29700391

http://stackoverflow.com/comment/47696567
type: QuestionComment
comment on: http://stackoverflow.com/q/29783275
score: 0
has text: I don't want people to review my code, I want people to help me find a solution that fits the framework and my needs. Thank you.
type: Comment

http://stackoverflow.com/a/29757932
type: Answer
upvote count: 3
has body: First, add the path as a custom attribute to your element like &lt;input class="token_input" data-path="/admin/tags/filter"/&gt; Then, you could do something like $(function() { $(".token_input").each(function(){ $(this).tokenInput($(this).attr('data-path'), { crossDomain: false, prePopulate: $(this).data("pre"), theme: "facebook" }); });
score: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29757814
answers question: http://stackoverflow.com/q/29757814

http://stackoverflow.com/q/29723696
accepted answer: http://stackoverflow.com/a/29723737
type: AnsweredQuestion
score: 1
favorite count: 0
type: Question
tagged with: regex
has comment: http://stackoverflow.com/comment/47581638
upvote count: 2
has answer: http://stackoverflow.com/a/29723737
answer count: 3
has answer: http://stackoverflow.com/a/29723743
downvote count: 1
has answer: http://stackoverflow.com/a/29723826
has comment: http://stackoverflow.com/comment/47581632
has title: How to split a string when first letter is found in JavaScript?
possible better answer: http://stackoverflow.com/a/29723743
tagged with: javascript
has body: If i have: var x = "123442234535asd"; What regular expression would I have to use on x.split(regex); to get "asd"? PS: x would always have a random string of numbers first and a string of letters after.

http://stackoverflow.com/comment/47719677
type: Comment
has text: I've tryed that. This only works if I want the icon to apear under the link .bar { display: none; } .foo:hover + .bar { display: inline-block; }
score: 0
comment on: http://stackoverflow.com/q/29795566
type: QuestionComment

http://stackoverflow.com/comment/47852386
score: 0
type: AnswerComment
type: Comment
has text: Switched around the HTML with the JS... Could this be an issue with Shopifys liquid files which places sections from different files?
comment on: http://stackoverflow.com/a/29841991

http://stackoverflow.com/a/29721611
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47577960
answers question: http://stackoverflow.com/q/29721610
downvote count: 0
has comment: http://stackoverflow.com/comment/47578537
has comment: http://stackoverflow.com/comment/47578561
type: Answer
has body: Since I was not able to find a pre-existing library to take care of promise batching, I wrote a simple primitive myself. It is a class that wraps an array of functions to be executed, and partitions it into batches of given size. It will wait for each batch to finish before running the next. It is a rather naive implementation. A full-blown throttling mechanism would probably be desirable in some networking scenarios. Fiddle. Code: /** * Executes any number of functions, one batch at a time. * * @see http://jsfiddle.net/93z8L6sw/2 */ var Promise_allBatched = (function() { var Promise_allBatched = function(arr, batchSize) { if (arr.length == 0) return Promise.resolve([]); batchSize = batchSize || 10; var results = []; return _runBatch(arr, batchSize, results, 0) .return(results); // return all results }; function _runBatch(arr, batchSize, results, iFrom) { // run next batch var requests = []; var iTo = Math.min(arr.length, iFrom + batchSize); for (var i = iFrom; i &lt; iTo; ++i) { var fn = arr[i]; var request; if (fn instanceof Function) { request = fn(); } else { request = fn; } requests.push(request); // start promise } return Promise.all(requests) // run batch .then(function(batchResults) { results.push.apply(results, batchResults); // store all results in one array console.log('Finished batch: ' + results.length + '/' + arr.length); }) .then(function() { if (iTo &lt; arr.length) { // keep recursing return _runBatch(arr, batchSize, results, iTo); } }); } return Promise_allBatched; })();

http://stackoverflow.com/q/29769409
has comment: http://stackoverflow.com/comment/47670579
has body: At the moment the Owl Carousel autoHeight works only with 1 item on screen. Their plan is to calculate all visible items and change height according to highest item. I work around this problem by calling the .active classes on the visible items, and give the invisible items a small height. Is there already a more elegant solution? $('.owl-carousel').owlCarousel({ loop: true, items: 3, margin: 1, autoHeight: true, }); Fiddle Any Ideas? Thanks!
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/47353324
has comment: http://stackoverflow.com/comment/47670269
has answer: http://stackoverflow.com/a/30057129
downvote count: 0
has comment: http://stackoverflow.com/comment/47669883
has answer: http://stackoverflow.com/a/54727078
tagged with: height
has answer: http://stackoverflow.com/a/60207944
favorite count: 0
type: UnansweredQuestion
score: 6
linked to: http://stackoverflow.com/q/51118827
tagged with: owl-carousel-2
upvote count: 6
answer count: 4
has title: Owl Carousel 2 - autoHeight (multiple items)
has comment: http://stackoverflow.com/comment/47670461
tagged with: owl-carousel
type: Question

http://stackoverflow.com/q/29699945
has comment: http://stackoverflow.com/comment/47537195
has comment: http://stackoverflow.com/comment/47540145
has comment: http://stackoverflow.com/comment/47616071
accepted answer: http://stackoverflow.com/a/29700475
has comment: http://stackoverflow.com/comment/47537748
type: AnsweredQuestion
score: 10
linked to: http://stackoverflow.com/q/2593139
upvote count: 10
has comment: http://stackoverflow.com/comment/47536017
type: Question
has body: In my webpage I have a text input field which gets covered by the keyboard in Windows 8.1 tablet. I want the tablet to 'push up' the web page content (as it works on the iPad). So: Is it possible to make the keyboard NOT covering my input field? And can I detect if a virtual keyboard is active with javascript?
tagged with: browser
downvote count: 0
answer count: 1
tagged with: javascript
has title: Handle virtual keyboard on Windows 8 tablet
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: windows-8.1
tagged with: css
has answer: http://stackoverflow.com/a/29700475

http://stackoverflow.com/q/29708162
score: 1
has body: I want to show when a business is "opened or closed" by displaying "open" and "closed" images. The trick is, I want the information to be taken based on a free/busy call coming from a Google calendar. So far, the page is pulling the correct information in and of itself- the problem is that when I've parced the data with the JavaScript, the CURRENT time is correct, END time of the "busy" event is correct, however the start time is displaying 6 hours before it's supposed to and I can't figure out why or how to correct it. So the PHP is currently: &lt;!-- Google Calendar for The Commons --&gt; &lt;?php date_default_timezone_set("GMT"); $request = array( 'items' =&gt; array( array('id' =&gt; 'REMOVED FOR PRIVACY'), ), 'timeMin' =&gt; date('c'), 'timeMax' =&gt; date('c', strtotime('+2 month')), ); $curl = curl_init(); $options = array( CURLOPT_CONNECTTIMEOUT =&gt; 5, CURLOPT_FOLLOWLOCATION =&gt; true, CURLOPT_HEADER =&gt; false, CURLOPT_RETURNTRANSFER =&gt; true, CURLOPT_SSL_VERIFYPEER =&gt; false, CURLOPT_TIMEOUT =&gt; 10, CURLOPT_POST =&gt; true, CURLOPT_POSTFIELDS =&gt; json_encode($request), CURLOPT_HTTPHEADER =&gt; array( 'Content-Type: application/json', 'Content-Length: ' . strlen(json_encode($request)) ), CURLOPT_URL =&gt; 'https://www.googleapis.com/calendar/v3/freeBusy?fields=calendars&amp;key=REMOVED FOR PRIVACY', CURLOPT_USERAGENT =&gt; 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10;rv:36.0) Gecko/20100101 Firefox/36.0', ); curl_setopt_array($curl, $options); $result = curl_exec($curl); curl_close($curl); echo $result; And then it links well to the JavaScript and clearly its providing all the information. $(document).ready(function () { $.get("/dining-new/admin/php/commonsgcalendar.php", function (data) { var currenttime = Date(); var nowDate = parseInt(currenttime.substring(8, 11)); var nowHour = parseInt(currenttime.substring((16, 18)) - 4 ) * 60; // its in GMT so to get EST I'm subtracting 4 hours then changing everything into minutes by multiplying by 60 v…
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
has title: changing image based on free/busy call
has answer: http://stackoverflow.com/a/29708212
favorite count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: php
tagged with: css

http://stackoverflow.com/comment/55812799
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/34028168
score: 0
has text: While this code may answer the question, it would be better to explain how it solves the problem without introducing others and why to use it. Code-only answers are not useful in the long run.

http://stackoverflow.com/q/29694820
tagged with: mustache
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47526426
has comment: http://stackoverflow.com/comment/47526473
has title: Mustache returns [object object] after iterating over array
type: Question
score: 0
answer count: 1
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/29911233
has body: Im going over a very simple case and wondering why it renders the array as [object object] instead of printing strings (function(){ var context = { steps: ['step1', 'step2', 'step3'], } var template = document.getElementById('template').innerHTML; var result = Mustache.render(template, context); document.getElementById('template').innerHTML = result; })(); template is: {{#steps}} 01. {{.}} {{/steps}}
has comment: http://stackoverflow.com/comment/47526299

http://stackoverflow.com/q/29834354
tagged with: javascript
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/47797058
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
has title: Extending $scope in Angular.js
has body: Sometimes, i see people using this pattern: angular.extend($scope, {somekey, someval}). What is the benefit in using this style of scope extension, when i can set the scope directly like so: $scope.somekey = someval?
has comment: http://stackoverflow.com/comment/47795461
has answer: http://stackoverflow.com/a/29834661
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29834661
has comment: http://stackoverflow.com/comment/47795410
type: Question

ejs
tags question: http://stackoverflow.com/q/29766417
tag name: ejs
type: Tag
tags question: http://stackoverflow.com/q/29771181

http://stackoverflow.com/comment/47523799
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29693658
has text: I can see it BTW. Using Chrome. Though it is quite subtle.
score: 0

http://stackoverflow.com/q/29718849
has comment: http://stackoverflow.com/comment/47572288
has body: I want to display page as a modal instead of redirecting. My problem is, I can display the table inside modal but none of the supposed data is in it. Here is what I have so far: HTML: &lt;td&gt;&lt;a class="btn btn-small btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="&lt;?php echo getApplicantDetailsModals($l['Applicants']['id'],$l['Applicants']['lastname'],$l['Applicants']['firstname']) ?&gt;"&gt;Name here&lt;/a&gt;&lt;/td&gt; &lt;div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="memberModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title" id="memberModalLabel"&gt;Borrower Last 5 Loans Details&lt;/h4&gt; &lt;/div&gt; &lt;div class="ct"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; I am using getApplicantDetailsModals as a helper that will point to the template. Helper: function getApplicantDetailsModals($id, $lastname, $firstname) { $user = sfContext::getInstance()-&gt;getUser(); if($user-&gt;hasCredential('VIEW_APPLICANT')) { $controller = sfContext::getInstance()-&gt;getController(); $url = $controller-&gt;genUrl(array( 'module'=&gt;'misc', 'action'=&gt;'applicant', 'id'=&gt;$id )); return "&lt;span class='info'&gt;&lt;a href='$url'&gt;$lastname, $firstname&lt;/a&gt;&lt;/span&gt;"; } else { return "$lastname, $firstname"; } Symfony 1.4 Action: public function executeApplicant(sfWebRequest $r) { $this-&gt;applicant = Doctrine_Core::getTable('Loans')-&gt;findOneLoans($r-&gt;getParameter('id')); PHP: &lt;?php include_component('misc','applicant')?&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;name&lt;/td&gt; &lt;/tr&gt; &lt;?php foreach($applicant as $a):?&gt; &lt;td&gt;&lt;?php echo $a-&gt;name ?&gt;&lt;/td&gt; &lt;?php endforeach…
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/47572645
answer count: 0
has comment: http://stackoverflow.com/comment/47572516
has comment: http://stackoverflow.com/comment/47572697
type: Question
has comment: http://stackoverflow.com/comment/47572449
tagged with: symfony-1.4
tagged with: javascript
tagged with: ajax
score: 0
has title: No data displayed in Twitter Bootstrap Modal php

http://stackoverflow.com/comment/47592512
has text: this code, jQuery('#p_amount').html(response.p_amount); updates the div containing id=p_amount but when I use this here, var amount = 'p_amount'; this var amount gets nothing.
score: 0
comment on: http://stackoverflow.com/a/29728110
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47727607
score: 0
type: QuestionComment
has text: @piggy good place to learn, i want this regex modified
comment on: http://stackoverflow.com/q/29799740
type: Comment

http://stackoverflow.com/q/29690724
has title: Laravel and Ajax on a particular div
tagged with: php
tagged with: laravel-5
has comment: http://stackoverflow.com/comment/47518071
type: Question
has comment: http://stackoverflow.com/comment/47518147
has answer: http://stackoverflow.com/a/29690890
tagged with: javascript
has comment: http://stackoverflow.com/comment/47518066
has comment: http://stackoverflow.com/comment/47518033
score: 0
has comment: http://stackoverflow.com/comment/47518101
answer count: 1
tagged with: jquery
has body: I have a normal javascript datatable with some features due to javascript. but I also have a delete button for every row to delete data row for which I am using ajax to refresh the entire datatable but not to the entire page which is successful. but the thing is after deleting one item the entire table looks normatable but not the javascript datatable. and I dont wnat to load the entire page. datatable : dataTables.bootstrap.css, dataTables.bootstrap.js, jquery.dataTables.js
tagged with: ajax
type: UnansweredQuestion

http://stackoverflow.com/comment/47913391
has text: 'in order simulate a "click" on hybrid mobile app' -- This isn't quite right. You're injecting the YUI library into the page. And I still can't understand why... Whatever site you're testing has its own responsibility of importing the JS file, not your selenium code. Your selenium code is _injecting_ the download of a JS file into the head of that html page. Let's back up for a second: what JS is the site currently pulling in already? How about images, or css? If you can find that out, you can keep a local copy and put it in the same general location and we can go from there...
type: Comment
comment on: http://stackoverflow.com/a/29748606
score: 0
type: AnswerComment

http://stackoverflow.com/comment/118412127
has text: Almost 6 years later of _"At some point in the future, there may be a way of registering your service worker to be woken up via a periodic/time-based event […]"_ Any plans yet for this apparently much desired feature?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29750936
score: 3

http://stackoverflow.com/q/29831291
accepted answer: http://stackoverflow.com/a/29831400
upvote count: 2
tagged with: twitter-bootstrap
answer count: 1
has title: Injection error, using ui-bootstrap
has comment: http://stackoverflow.com/comment/47789138
has answer: http://stackoverflow.com/a/29831400
has body: Unknown provider: $confirmModalProvider &lt;- $confirmModal &lt;- confirmModalCtrl Why am I getting this error? I'm trying to use AngularJS UI Bootstrap to open a modal and get the result. I get this error when I trigger $scope.deleteQuestion(). Any idea what I'd doing wrong here? var crtPromoCtrl = angular.module('crtPromoCtrl', ['crtPromoSrv']); crtPromoCtrl.controller('surveyCtrl', ['$scope', '$modal', 'surveySrv', function($scope, $modal, surveySrv) { $scope.questions = surveySrv.getQuestions(); $scope.editQuestion = function(index) { surveySrv.setEditQuestion(index); }; $scope.deleteQuestion = function(index) { var confirmModal = $modal.open({ templateUrl: 'confirm-delete.html', controller: 'confirmModalCtrl', size: 'sm' }); confirmModal.result.then(function(msg) { console.log(msg); }); return false; }; }]); crtPromoCtrl.controller('confirmModalCtrl', ['$scope', '$confirmModal', function($scope, $confirmModal) { $scope.yes = function() { $confirmModal.close('yes'); }; $scope.no = function() { $confirmModal.dismiss('no'); }; }]); EDIT: https://angular-ui.github.io/bootstrap/#/modal
score: 2
type: AnsweredQuestion
tagged with: bootstrap-modal
downvote count: 0
has comment: http://stackoverflow.com/comment/47789237
tagged with: angular-ui
tagged with: javascript
has comment: http://stackoverflow.com/comment/47789476
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47789231
type: Question

http://stackoverflow.com/comment/47572803
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29716486
has text: This is so because, `window.onload` is kind of a global object, so when you are registering it in your diagram2.js file, it is getting overwritten.

http://stackoverflow.com/q/29744958
has answer: http://stackoverflow.com/a/29745291
has comment: http://stackoverflow.com/comment/47622779
score: 4
has title: Using custom wrappers for inputs: pros and cons?
has comment: http://stackoverflow.com/comment/47623025
answer count: 3
has answer: http://stackoverflow.com/a/32841863
has body: Often there are times when I need to have totally custom input elements: checkboxes, radio buttons, selects, etc. Just wanted to ask if such practice is okay and acceptable: we create some sort of wrapper for our input (radio box in this case) we hide our real radio boxes(opacity: 0, visibility: hidden, left: -9999px, etc) On click on a parent wrapper: we get the input name attribute, find all inputs with [type="radio][name="clickedInputName"], set them all to become unchecked and set the one we clicked to set it to checked. Attaching some not quite beautiful jsfiddle: https://jsfiddle.net/moLvh9dd/ $('.radio-wrapper').on('click', function(e){ e.preventDefault(); var targetInput = $(this).find($('input')); var clickedInputName = 'input[type="radio"] [name="'+targetInput.attr('name')+'"]'; $(clickedInputName).each(function(){ $(this).prop('checked', false); $(this).parent().removeClass('input-checked'); }) targetInput.prop('checked', true); $(this).addClass('input-checked'); }); Checked the browser compatibility, + - works everywhere down to IE8, so despite the fact that it just works I want to know if it's the right way? Is it acceptable?` Despite the fact that it's javascript/jQuery dependent. EDIT: Thanks for some great answers on radio and checkbox inputs but what about custom select element? With various amount of options for every select? For example like here - some ugly jQuery again: https://jsfiddle.net/4gt7gavq/
accepted answer: http://stackoverflow.com/a/29745291
upvote count: 4
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/29745713
type: Question
has answer: http://stackoverflow.com/a/29745713
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/47516548
comment on: http://stackoverflow.com/q/29689878
score: 2
has text: The return value of `console.log()` is `undefined`.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29751889
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29751592
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29751592
has body: You could create your own filter that removes children elements and checks the textNodes of the current element only. As the string you're trying to match is present in the comments as well, any use of innerHTML is out, so textContent is used. $("#bug").on('click', function () { $("div, p").filter(function() { var clone = this.cloneNode(true); while (clone.firstElementChild) { clone.removeChild(clone.firstElementChild); } return clone.textContent.indexOf('John') != -1; }).css("color", "red"); }); FIDDLE

http://stackoverflow.com/a/29767067
score: 0
has body: you can try like this but it is some what like @Rory implementation: var arrayFoo = [ "first foo item", "second foo item", "third foo item"]; var arrayBiz = [ "first biz item", "second biz item", "third biz item"]; var arr=[]; arr['arrayFoo']=arrayFoo; arr['arrayBiz']=arrayBiz; $('ul').click(function () { listName = $(this).attr('id'); listArray = "array"+listName;// it will not refer to the declared array.it will be merely a string so can be used as key. console.log(listArray); arr[listArray].forEach(function (listItem) { $('#' + listName).append(' ' + listItem + ' '); }); }); Foo Biz
type: Answer
answers question: http://stackoverflow.com/q/29766708

http://stackoverflow.com/q/29842583
favorite count: 0
has title: Bootstrap woff2 font not getting loaded correctly
has comment: http://stackoverflow.com/comment/47811613
accepted answer: http://stackoverflow.com/a/29842667
tagged with: css
possible better answer: http://stackoverflow.com/a/34393573
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
downvote count: 0
has answer: http://stackoverflow.com/a/29842667
has body: Bootstrap font not loading correctly glyphicons-halflings-regular.woff2. It shows the error in my Chrome-console. Any solution to get it loaded properly, so that it doesn't show the error in the console?
score: 34
has answer: http://stackoverflow.com/a/34809403
type: Question
tagged with: asp.net-mvc
tagged with: javascript
upvote count: 34
has answer: http://stackoverflow.com/a/34393573
answer count: 3
has comment: http://stackoverflow.com/comment/47811405
tagged with: woff2

jquery-selectors
tags question: http://stackoverflow.com/q/29743994
type: Tag
tags question: http://stackoverflow.com/q/29735851
tags question: http://stackoverflow.com/q/29735715
tags question: http://stackoverflow.com/q/29733951
tags question: http://stackoverflow.com/q/29799915
tags question: http://stackoverflow.com/q/29811183
tag name: jquery-selectors
tags question: http://stackoverflow.com/q/29751592

http://stackoverflow.com/q/29754443
has answer: http://stackoverflow.com/a/29754872
type: Question
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: hi i'm having issues with a small slideshow. // define array of image paths (src) var backgroundImage = [ { src: 'assets/bg/1.jpg' }, { src: 'assets/bg/2.jpg' }, { src: 'assets/bg/3.jpg' }, { src: 'assets/bg/4.jpg' }, { src: 'assets/bg/5.jpg' }]; $(document).ready( function() { // index to select item in array var i = 0; // use the jQuery function ($) to select the &lt;img&gt; by id var img = $('#back-img'); // set the initial src value img.attr("src", backgroundImage[i].src); // advance to next image i++; // setInterval takes to parameters, a callback and an interval window.setInterval(function() { // reset the index to 0 if past the end if (i &gt;= backgroundImage.length) { i = 0; } // fade out the old image and fade in the new one img.attr("src").fadeOut(900, function() { alert("ok") }); img.attr("src", backgroundImage[i].src).fadeIn('900'); // advance to next image ++i; }, // set the image time to 7000ms 7000 ) } ); the script doesn't work. it load the first image but doesnt swap to the other ones. I guess something is wrong with my fadeOut function cause if i replace it with a hide() func, it works...
has comment: http://stackoverflow.com/comment/47641495
has comment: http://stackoverflow.com/comment/47641059
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47641691
downvote count: 1
has title: jQuery slide show, issue with fadeOut

http://stackoverflow.com/comment/47691898
type: AnswerComment
type: Comment
has text: @AndrewLavers , noob question but by saying `var interval;` u mean but `var interval;` in the global scope ?
comment on: http://stackoverflow.com/a/29780444
score: 0

http://stackoverflow.com/comment/47737745
type: QuestionComment
comment on: http://stackoverflow.com/q/29804631
score: 1
has text: You wouldn't want to assign it to a constant since you will be updating it's value, so I would probably do something like `window.whatever_data = JSON.parse('<?php json_encode($ach)?>');` and make sure you are properly escaping single quotes so you don't break the javascript string. And then access `$window.whatever_data` from your controller/service/factory/etc
type: Comment

http://stackoverflow.com/comment/47806159
comment on: http://stackoverflow.com/q/29839854
type: Comment
has text: did you try calling `$apply()` after you have made the changes to DOM using JQuery?
score: 0
type: QuestionComment

http://stackoverflow.com/a/29708112
type: Answer
has body: The problem is your bind function is happening before the element is rendered so jquery has nothing to bind to. You need a better way like checking when the li is clicked from my-list node. If you look at $(document).ready(function(){ $('li') //this will have length 0 since the elements are not in the DOM tree yet. }); You're looking for https://api.jquery.com/on/ $(function(){ $('#my-list').on('click', 'li',function() { $(this).hide(); }); }); the $(function(){}) is short hand for $(document).ready
upvote count: 5
answers question: http://stackoverflow.com/q/29708067
score: 5
downvote count: 0

http://stackoverflow.com/comment/47597162
type: Comment
has text: On a side note some of your questions can be a little confusing and I suspect that is why people are voting them down and they aren't getting more attention. You might want to check out [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask)
type: QuestionComment
comment on: http://stackoverflow.com/q/29730953
score: 0

http://stackoverflow.com/q/29752798
score: 1
has body: I'm following this Angular tutorial to make a simple web application. The end of this portion asks me to create an 8x8 table adding an additional ng-repeat. I tried to simply follow the pattern I'd do in something like JavaScript to create a matrix: var ary = []; for (var i = 0; i < 8; i++) { ary[i] = []; for (var j =0; j < 8; j++) { ary[i][j] = value; } } It's just outputting one row of numbers when I try in Angular: {{i}}{{p}}
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29752892
tagged with: javascript
tagged with: matrix
answer count: 1
downvote count: 0
has title: simple 2d array using ng-repeat
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29752892
has comment: http://stackoverflow.com/comment/47637826
type: AnsweredQuestion

http://stackoverflow.com/q/29770745
score: 2
type: AnsweredQuestion
has body: I have these 2 separate functions, each work and are initialized by 2 different input buttons which are used to pass two different Country Names to create a html table comparison of the 2 countries from a SQL database. How can I rewrite this to initialize both function together with 1 button not 2? sam.php
upvote count: 2
accepted answer: http://stackoverflow.com/a/29770858
type: Question
has answer: http://stackoverflow.com/a/29770801
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29770801
answer count: 3
has title: Two separate Functions, but I want them to be initialized at the same time
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/29770858
favorite count: 0
has answer: http://stackoverflow.com/a/29771006

asp.net-mvc
tags question: http://stackoverflow.com/q/29698588
tags question: http://stackoverflow.com/q/29707061
tags question: http://stackoverflow.com/q/29835030
tags question: http://stackoverflow.com/q/29731660
tags question: http://stackoverflow.com/q/29785622
tags question: http://stackoverflow.com/q/29835112
tags question: http://stackoverflow.com/q/29841162
tags question: http://stackoverflow.com/q/29724931
tags question: http://stackoverflow.com/q/29716098
tags question: http://stackoverflow.com/q/29748856
tags question: http://stackoverflow.com/q/29785535
tags question: http://stackoverflow.com/q/29709330
tags question: http://stackoverflow.com/q/29783760
tags question: http://stackoverflow.com/q/29834625
tags question: http://stackoverflow.com/q/29733073
tags question: http://stackoverflow.com/q/29826676
tags question: http://stackoverflow.com/q/29798819
tags question: http://stackoverflow.com/q/29834313
tags question: http://stackoverflow.com/q/29837165
tags question: http://stackoverflow.com/q/29741161
tags question: http://stackoverflow.com/q/29714976
tags question: http://stackoverflow.com/q/29707613
tag name: asp.net-mvc
tags question: http://stackoverflow.com/q/29839425
tags question: http://stackoverflow.com/q/29767286
tags question: http://stackoverflow.com/q/29807055
tags question: http://stackoverflow.com/q/29824050
tags question: http://stackoverflow.com/q/29828571
tags question: http://stackoverflow.com/q/29795438
tags question: http://stackoverflow.com/q/29693987
tags question: http://stackoverflow.com/q/29699920
tags question: http://stackoverflow.com/q/29746637
tags question: http://stackoverflow.com/q/29696295
tags question: http://stackoverflow.com/q/29717326
tags question: http://stackoverflow.com/q/29805916
tags question: http://stackoverflow.com/q/29716809
tags question: http://stackoverflow.com/q/29736603
tags question: http://stackoverflow.com/q/29841727
tags question: http://stackoverflow.com/q/29831406
tags question: http://stackoverflow.com/q/29828856
tags question: http://stackoverflow.com/q/29842583
type: Tag
tags question: http://stackoverflow.com/q/29771030
tags question: http://stackoverflow.com/q/29765760
tags question: http://stackoverflow.com/q/29812251
tags question: http://stackoverflow.com/q/29718320
tags question: http://stackoverflow.com/q/29698713
tags question: http://stackoverflow.com/q/29705649
tags question: http://stackoverflow.com/q/29799628
tags question: http://stackoverflow.com/q/29774144

http://stackoverflow.com/a/30076738
answers question: http://stackoverflow.com/q/29837272
upvote count: 3
type: Answer
downvote count: 0
has body: The click attribute on the canvas element is expecting a callback. In your code, you put the result of the function onClick as a callback (undefined), not the function itself. So basically, you can remove the paranthesis in your code : Hope this helps, Cheers
score: 3

http://stackoverflow.com/q/29820205
has comment: http://stackoverflow.com/comment/47806273
has body: I have an ASP.NET Web API that accepts a POST with a UserModel in it: [HttpPost] public object Post(UserModel userModel) { // some logic here } The UserModel is a complex type that looks like this: public class UserModel { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public AddressModel CurrentAddress { get; set; } } The AddressModel Model looks like this: public class AddressModel { public string Country { get; set; } public string City { get; set; } public string Street { get; set; } public string Number { get; set; } } I'm trying to call this API from javascript and send a JSON object. This is the JSON object I'm sending: var user = { Id: 1, FirstName: 'Hello', LastName: 'World', CurrentAddress: { Country: 'Israel', City: 'Tel Aviv', Street: 'Shalom', Number: '5' } }; What I get in my Post method is a UserModel with the UserModel fields filled with the correct information, the CurrentAddrent address is initialized, but the values sent are not there. The values of the parent object (the UserModel object are ok). What am I doing wrong here? how can you send a complex object to WebAPI Model?
type: UnansweredQuestion
has title: ASP.NET Web API - pass a complex type from javascript json
has comment: http://stackoverflow.com/comment/47770288
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/47774993
has comment: http://stackoverflow.com/comment/47770037
has answer: http://stackoverflow.com/a/31386052
tagged with: javascript
has comment: http://stackoverflow.com/comment/47766869
has comment: http://stackoverflow.com/comment/47771271
score: 0
answer count: 1
tagged with: asp.net-ajax
tagged with: asp.net-web-api
has comment: http://stackoverflow.com/comment/47767614

kinect
type: Tag
tags question: http://stackoverflow.com/q/29718988
tag name: kinect

http://stackoverflow.com/comment/47546933
type: Comment
type: QuestionComment
has text: if it is difficult, then take a look here http://stackoverflow.com/a/28679672/4131583
score: 0
comment on: http://stackoverflow.com/q/29688618

http://stackoverflow.com/q/29826676
favorite count: 0
type: Question
tagged with: razor
has answer: http://stackoverflow.com/a/33401280
upvote count: 1
answer count: 1
has body: I have included a new frame in my HTML-page, in this frame I have a Jtable . I need to set the default pagesize to 4 to have the included view without scoller. I made this changes: options: { paging: false, pageList: 'normal', //possible values: 'minimal', 'normal' pageSize: 4, pageSizes: [4, 25, 50, 100, 250, 500], pageSizeChangeArea: true, gotoPageArea: 'combobox', //possible values: 'textbox', 'combobox', 'none' messages: { pagingInfo: 'Showing {0}-{1} of {2}', pageSizeChangeLabel: 'Row count', gotoPageLabel: 'Go to page' } }, In jquery.jtable.js and jquery.jtable.min.js. But I get always the page size = 10. So , I need to know Why the modification that I made wasn't sufficient? How can I fix page size to 4 ?
has title: Set the page size in Jtable && razor application
tagged with: asp.net-mvc
tagged with: jtable
accepted answer: http://stackoverflow.com/a/33401280
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery

http://stackoverflow.com/q/29750079
has answer: http://stackoverflow.com/a/29750556
score: 1
has title: SetRequiredLevel How it works?
type: Question
tagged with: dynamics-crm-2011
accepted answer: http://stackoverflow.com/a/29750515
possible better answer: http://stackoverflow.com/a/29751289
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29751289
answer count: 3
has body: I have two fields : Cobertura and other 3 (lets call it x,y,z) If cobertura value is 150 or 160 I need to make the other 3 fields required and not allowed to save before fill these field, using java script in CRM 11. Using set required level will work for me? What exactly this function does?
favorite count: 0
has answer: http://stackoverflow.com/a/29750515
upvote count: 1
tagged with: required
type: AnsweredQuestion
tagged with: crm

http://stackoverflow.com/q/29790996
has answer: http://stackoverflow.com/a/29792529
has body: I want to use different sized images depending on the webpage size. For example, my images has two different sizes: &lt;img src="images/img1.jpg" data-big="images/img1.jpg" data-small="images/img1small.jpg" alt=""&gt;&lt;/img&gt; The data-small image has a width of 100px. @media (max-width:600px) { img[data-small] { content: attr(data-small, url); &lt;-- not working /*width:10px;*/ &lt;-- this would work } } I testet it on Firefox 37.0.1, Chrome 42.0.2311.90 m and IE 11 If I resize the browser to a very small width (&lt; 600px), the image is still the same.
score: 1
has answer: http://stackoverflow.com/a/29791212
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/47710905
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47710995
has comment: http://stackoverflow.com/comment/47711050
has comment: http://stackoverflow.com/comment/47710966
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29791104
tagged with: css
answer count: 4
has title: CSS3/HTML5 Responsive images
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29791325

http://stackoverflow.com/a/29786477
type: Answer
has body: You would use AJAX. Here is a good starting point with an example of JavaScript sending data to a PHP script running on the server. W3Schools Or you could submit the html form to the server and pass the data to a PHP script as is answered in this stackoverflow question
has comment: http://stackoverflow.com/comment/47726365
has comment: http://stackoverflow.com/comment/47702679
score: 0
answers question: http://stackoverflow.com/q/29786323
has comment: http://stackoverflow.com/comment/47702695

http://stackoverflow.com/q/29813739
has comment: http://stackoverflow.com/comment/47755266
score: 0
has title: Populating an array of objects with a loop
has comment: http://stackoverflow.com/comment/47755540
has body: I'm trying to loop through a number of items, and create an array. Each loop should be a new item in the array, but I'm having some issues doing it. It seems that only one set of items gets added, instead of multiple ones. I've tried below code. Please help me to solve it. function OpenPopup3(src,type,title){ var myData = []; rows.each(function(index) { var temp_obj = {}; temp_obj["src"] = $this.find('.elementOne').text(), temp_obj["type"] = $this.find('.elementTwo').text(), temp_obj["title"] = $this.find('.elementThree').text() myData.push(temp_obj); }); $.magnificPopup.open({ key: 'my-popup', items: myData, type: 'inline', inline: { markup: '&lt;div class=""&gt;&lt;div class="mfp-close"&gt;&lt;/div&gt;'+'&lt;img class="mfp-src"&gt;'+'&lt;div class="mfp-title"&gt;&lt;/div&gt;'+'&lt;/div&gt;' }, gallery: { enabled: true } }); } What I actually want is as below: { src: "/googleimages/123/a.png", type: "Stuff", title: "Title1" }, { src: "/googleimages/123/b.png", type: "Stuff", title: "Title2" }, { src: "/googleimages/123/c.png", type: "Stuff", title: "Title3" }
tagged with: arrays
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29813842
has comment: http://stackoverflow.com/comment/47780564
has comment: http://stackoverflow.com/comment/47755602
type: Question
has comment: http://stackoverflow.com/comment/47755146
has comment: http://stackoverflow.com/comment/47755131
has comment: http://stackoverflow.com/comment/47755348

http://stackoverflow.com/comment/47576360
type: Comment
type: QuestionComment
score: 0
has text: did i answer your question sir?
comment on: http://stackoverflow.com/q/29719678

http://stackoverflow.com/comment/47560718
type: Comment
comment on: http://stackoverflow.com/a/29710133
score: 0
type: AnswerComment
has text: You are understanding the problem correctly. Unfortunately, this didn't solve the issue.

http://stackoverflow.com/a/29798976
answers question: http://stackoverflow.com/q/29798784
type: Answer
has body: Change the line to var event = "details.php?id=" + $(e.target).data('id'); and try again
score: 0
has comment: http://stackoverflow.com/comment/47734862

http://stackoverflow.com/q/29689826
score: 0
has answer: http://stackoverflow.com/a/29690981
answer count: 2
tagged with: angularjs-ng-repeat
accepted answer: http://stackoverflow.com/a/29690981
has comment: http://stackoverflow.com/comment/47516956
has body: I am listing a bunch of JSON objects to a view, but only it's category ID is included. Not the name, which I need to display. I have to make a separate $http call to process which items match. Values will not render to view. Code: $scope.cardCategories = function(id) { angular.forEach($scope.categoryFilter, function(category, index){ if (category.id == id) { //console.log(category.name); return category.name; } else { return; } }) } value inside a simplified ng-repeat &lt;div ng-repeat="topic in latest"&gt; {{cardCategories(topic.category_id)}} &lt;/div&gt; I have also attempted to write this as a filter, but the value will not display. Console shows the matches. My suspicion is that I have to process the original latest array. Thanks. .filter('cardCategories', function($rootScope, $state){ return function(catId) { if (catId !== undefined &amp;&amp; $rootScope.cardCategories) { angular.forEach($rootScope.cardCategories.categories, function(category, index){ if (category.id == catId.category_id) { return category.name; } else { return; } }) } } }) View:
tagged with: angularjs
has answer: http://stackoverflow.com/a/29702003
has title: Replace value with API value in ng-repeat
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29702003
has comment: http://stackoverflow.com/comment/47516657
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47516640
tagged with: ionic-framework
has comment: http://stackoverflow.com/comment/47516934

gui-toolkit
tags question: http://stackoverflow.com/q/29750405
type: Tag
tag name: gui-toolkit

http://stackoverflow.com/a/36573531
has body: For enumerate the getters please use Object.keys or Object.getOwnPropertiesNames on prototype instead of constructor or/and instance: function readGetters(obj) { var result = []; Object.keys(obj).forEach((property) =&gt; { var descriptor = Object.getOwnPropertyDescriptor(obj, property); if (typeof descriptor.get === 'function') { result.push(property); } }); return result; } var SimpleTestObject = function() { this.value = "Test1"; this._hiddenVal = "Test2"; this._readOnlyVal = "Test3"; this._rwVal = "Test4"; }; SimpleTestObject.prototype = { get readOnlyVal() { return this._readOnlyVal; }, get rwVal() { return this._rwVal; }, set rwVal(value) { this._rwVal = value; }, func1: function() { } }; SimpleTestObject.func2 = function(test) { /* Test */ }; SimpleTestObject.outsideVal = "Test5"; // For constructor console.log(readGetters(SimpleTestObject.prototype)); // For instance var instance = new SimpleTestObject(); console.log(readGetters(Object.getPrototypeOf(instance)));
downvote count: 0
score: 3
answers question: http://stackoverflow.com/q/29772403
upvote count: 3
type: Answer

http://stackoverflow.com/q/29784721
has title: Wordpress: Integrate PHP Site with jQuery
has comment: http://stackoverflow.com/comment/47700294
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29792203
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I am integrating a PHP Site into my Wordpress Installation with a Plugin. This is working fine. Now I tried to update a dropdown list with data from a mySQL DB using a "jQuery": the html part: form method="get"> Hauptkategorie <?php while($row = mysql_fetch_array($query_parent)): ?> <option value="<?php echo $row['cat_id']; ?>"><?php echo $row['category']; ?> <?php endwhile; ?> Unterkategorie When calling the page with the "normal" (www.mysitename.com/wp-content/themes/theme/upload.php) URL then everything is working fine. But when I call the page from the "Wordpress - URL" (www.mysitename.com/upload) then the second dropdown list will never be populated. Do I have to call the routine below alltough I am integrating a php side into my wordpress application? <?php function my_scripts_method() { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'); wp_enqueue_script( 'jquery' ); } add_action('wp_enqueue_scripts', 'my_scripts_method'); ?> Kind Regards, Stefan
has comment: http://stackoverflow.com/comment/47699599
type: UnansweredQuestion
tagged with: wordpress
tagged with: php
has comment: http://stackoverflow.com/comment/47712896
has comment: http://stackoverflow.com/comment/47703244

http://stackoverflow.com/comment/47621778
comment on: http://stackoverflow.com/q/29744527
has text: "Seems like it will get a bit convoluted" --- so `#include` and linking is fine, but `require` is convoluted. How so?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29842780
downvote count: 0
has body: The keyword prefix did not work for me. I am assuming it is a reserved keyword. I will use pref in this example. Html Output: {{result}} Javascript Polymer({ pref: '', result: 'Output', prefChanged: function(oldValue, newValue) { this.result = newValue + 'Output'; // evaluate result here } } Or you could use Polymers observer pattern Html Output: {{result}} Javascript Polymer({ result: '', observe: { 'xyz.prefix': 'validate' }, validate: function(oldValue, newValue) { this.result = newValue + 'Output'; }, ready: function() { this.xyz = { prefix: 'test' } } }); If you're observing Arrays please refer to observe-js
type: Answer
has comment: http://stackoverflow.com/comment/47818774
has comment: http://stackoverflow.com/comment/47817052
score: 1
has comment: http://stackoverflow.com/comment/47816153
has comment: http://stackoverflow.com/comment/47853060
has comment: http://stackoverflow.com/comment/47824062
answers question: http://stackoverflow.com/q/29841916
has comment: http://stackoverflow.com/comment/47822877
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29841916
has comment: http://stackoverflow.com/comment/47815062
type: AcceptedAnswer

http://stackoverflow.com/q/29764373
favorite count: 0
type: UnansweredQuestion
score: 2
upvote count: 2
tagged with: twitter-bootstrap
type: Question
has title: get src on selected options
tagged with: javascript
has body: I'm using "Image Picker" plugin and I want to get all "data-image-src" of all selected options. Here's my code: First . . . I can get all values selected by using $(".image-picker").val();. How can I get the "data-image-src"? Thanks.
has answer: http://stackoverflow.com/a/29764423
has answer: http://stackoverflow.com/a/29764394
answer count: 2
downvote count: 0
tagged with: jquery

http://stackoverflow.com/comment/47778810
has text: It's validating so that's a plus. Thanks. I'll speak to our analytics guy and see if he notices any affect. Thanks a lot man.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29821865
score: 0

http://stackoverflow.com/q/29719571
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29719618
has body: The title probably didn't make much sense, so let me make it clear: I want to catch space characters that are not repeated one or three times. And replace them with nothing. For example, this; 'the quick brown fox jumps over the lazy dog' would become this; 'the quick brown fox jumps over the lazy dog' Currently i get by with spliting the string by three spaces, then by one space and cleaning empty indexes.
has title: regex to match if not repeated specific times
score: -1
answer count: 2
upvote count: 0
possible better answer: http://stackoverflow.com/a/29719615
tagged with: javascript
has answer: http://stackoverflow.com/a/29719615
favorite count: 0
has answer: http://stackoverflow.com/a/29719618
tagged with: regex
downvote count: 1

http://stackoverflow.com/q/29811257
possible better answer: http://stackoverflow.com/a/29811352
score: -4
has answer: http://stackoverflow.com/a/29811357
has comment: http://stackoverflow.com/comment/47750602
has answer: http://stackoverflow.com/a/29811366
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/1877475
has comment: http://stackoverflow.com/comment/47750554
type: Question
upvote count: 0
has comment: http://stackoverflow.com/comment/47750514
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29811366
downvote count: 4
has body: I am currently making a simple hang-man game using a browser. When the user clicks on a button, it calls a function pickWord(): Pick A Word The function then picks a random word from the dictionary, assigns it to a variable, and creates the spaces ( _ _ _ _) for the word to put in an html table. function pickWord() { var word = dictionary[Math.floor(Math.random()*dictionary.length)]; wordSpaces = "_" * word.length; document.getElementById('spaces').innerHTML = wordSpaces; } This is not working: The spaces are not displayed on the table. I made a JSFiddle to help solve the problem.
answer count: 3
has title: Javascript: Hang-Man Function Not Working
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29811352
favorite count: 0

http://stackoverflow.com/comment/47785749
score: 0
type: Comment
has text: Hi, thanks for the detailed and extremely informative reply. I am using get() method now. Working on loading of the templates and passing the feed objects from my view function, getting a 500 error as of now. Will update if not able to resolve the error.
type: AnswerComment
comment on: http://stackoverflow.com/a/29829056

http://stackoverflow.com/q/29789103
tagged with: http://stackoverflow.com/tag/json
type: Question
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/47709306
score: 0
has comment: http://stackoverflow.com/comment/47707282
has answer: http://stackoverflow.com/a/29789181
has title: $.getjson not able to append the array objects to html
type: UnansweredQuestion
has body: Hi my json data is like below [{ "menu": "File", }, { "menu": "File1", }] I have written jquery code to append the response to html like below $(document).ready(function () { $.getJSON('data.json', function (data) { var template = $('#personTpl').html(); var html = Mustache.to_html(template, data); $('#sampleArea').html(html); }); }); Mustache template is below : &lt;script id="personTpl" type="text/template"&gt; &lt;h1&gt;{{menu}}&lt;/h1&gt; &lt;/script&gt; Please help
has answer: http://stackoverflow.com/a/29790264

http://stackoverflow.com/q/29726029
accepted answer: http://stackoverflow.com/a/29726075
upvote count: 1
has answer: http://stackoverflow.com/a/29727016
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/29727016
type: Question
has title: How to empty input field after certain time delay?
tagged with: javascript
has body: I have only one input field in py landing page. After enter the email id on success... success: function(result){ console.log(result.status); if(result.status == true) { $('input').attr("style", "color:green"); $('input').delay(5000).val(""); } else { $('input').attr("style", "color:red"); $('input').delay(5000).val(""); } } The problem is delay not working... is that my mistake or other way around it ??
answer count: 2
has answer: http://stackoverflow.com/a/29726075

http://stackoverflow.com/a/29706408
has comment: http://stackoverflow.com/comment/47548491
score: 4
answers question: http://stackoverflow.com/q/29706336
has comment: http://stackoverflow.com/comment/47549704
type: Answer
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/47548656
has comment: http://stackoverflow.com/comment/47549351
has comment: http://stackoverflow.com/comment/47548873
has body: How about using the delegated flavor of .on() : $("body").on("click", "#comment_btn", function(){ ... }); Documentation here for .on(): http://api.jquery.com/on/

http://stackoverflow.com/comment/47775645
type: QuestionComment
has text: Also, can anyone tell me how to create a second sidebar on the right side of the calendar (to go with the already existing one on the left)? Nothing I try seems to work, and have consulted Google and multiple books.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29708540

http://stackoverflow.com/comment/47737771
has text: You don't need any javascript click handler or window.location.href to do this. How do the products get listed on home.php? Loaded from a database via PHP calls in a loop? During that loading it can build the links like ` ` using the product name, id, image etc fetched from the DB. The product.php page then uses the productId to load _it's_ contents like Cyclopeus suggests in his answer.
comment on: http://stackoverflow.com/q/29799336
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47685302
has text: You really have to share some HTML code at this point (ideally via jsfiddle), at the very least a tree structure. I really can't know what's happening without that.
type: Comment
comment on: http://stackoverflow.com/a/29756386
score: 0
type: AnswerComment

http://stackoverflow.com/q/29691742
has body: i want to get the value of Save using jquery through input on keyup function.. i am matching value with Buy..means if value matched with the value(range) of Buy..then get the value of Save.. for example if i entered 3 in textfield then it gets value from Save 45%..and if i entered 8 then result should be 51%..entered 15 result 56% and so on. here is image link for better understanding. http://easycaptures.com/fs/uploaded/807/3129634990.jpg Buy Unit Price/unit Save 3-5 Pairs $4.99 45% 6-11 Pairs $4.49 51% 12-23 Pairs $3.99 56% 24+ Pairs $3.90 57% here is input field Enter Quantity i have tried some code but still no luck..
has comment: http://stackoverflow.com/comment/47520176
has answer: http://stackoverflow.com/a/29691944
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29691845
possible better answer: http://stackoverflow.com/a/29692818
has comment: http://stackoverflow.com/comment/47519959
has answer: http://stackoverflow.com/a/29692818
answer count: 3
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29691944
favorite count: 0
has title: how to get value from table td using javascript
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question

http://stackoverflow.com/a/29796301
score: 1
answers question: http://stackoverflow.com/q/29790784
downvote count: 0
type: Answer
upvote count: 1
has body: create datachannel is active while on datachannel is passive. the caller would call createdatachannel which would return a rtcdatachannel object that can be later used to send object and other things using it s own events (onmessage/onopen/onclose). the callee would make sure to attach a function to the corresponding peerconnection's ondatachannel event which would extract the rtcdatachannel object from the event ( mychannel = event.channel ).

flux
tag name: flux
tags question: http://stackoverflow.com/q/29693640
tags question: http://stackoverflow.com/q/29689370
tags question: http://stackoverflow.com/q/29782024
tags question: http://stackoverflow.com/q/29730292
type: Tag

http://stackoverflow.com/q/29723588
has answer: http://stackoverflow.com/a/29723661
score: 0
answer count: 2
has body: I have no problem to redirect the page if a user enter the wrong username or password with the following code. However, if a user left either the username or password empty, the redirect function fail, it will go to wordpress/login.php. I want to redirect the page if the user didn't enter anything but hit the submit button. &lt;?php add_action( 'wp_login_failed', 'my_front_end_login_fail' ); // hook failed login function my_front_end_login_fail( $username ) { $referrer = $_SERVER['HTTP_REFERER']; // where did the post submission come from? // if there's a valid referrer, and it's not the default log-in screen if ( !empty($referrer) &amp;&amp; !strstr($referrer,'wp-login') &amp;&amp; !strstr($referrer,'wp-admin') ) { wp_redirect( $referrer . '?login=failed' ); // let's append some information (login=failed) to the URL for the theme to use exit; } } ?&gt;
has comment: http://stackoverflow.com/comment/47581722
tagged with: javascript
has answer: http://stackoverflow.com/a/74218801
tagged with: php
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47581507
tagged with: http-redirect
tagged with: wordpress
has title: redirect the page if a user login was empty at wordpress?
type: Question

http://stackoverflow.com/q/29771733
favorite count: 0
upvote count: 0
has answer: http://stackoverflow.com/a/29799085
has comment: http://stackoverflow.com/comment/47709410
tagged with: php
downvote count: 1
type: AnsweredQuestion
score: -1
tagged with: prototype
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/29799085
tagged with: javascript
tagged with: jquery
has title: Disable dates in Protoplasm DatePicker
accepted answer: http://stackoverflow.com/a/31696367
has body: I am using the ProtoPlasm Datepicker in one of my apps, now I want to disable all the dates earlier than today. I used the following code: Protoplasm.use('datepicker').transform('input[type="text"].xyz_datepicker', {dateFormat: 'MM/dd/yyyy'}); But I'm still unable to do it. Any help?
tagged with: datepicker
has comment: http://stackoverflow.com/comment/47682985
has answer: http://stackoverflow.com/a/31696367

http://stackoverflow.com/q/29831625
has answer: http://stackoverflow.com/a/29850275
has comment: http://stackoverflow.com/comment/47797744
has comment: http://stackoverflow.com/comment/47789841
has comment: http://stackoverflow.com/comment/47789912
has comment: http://stackoverflow.com/comment/47797691
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47797943
has comment: http://stackoverflow.com/comment/47821504
has comment: http://stackoverflow.com/comment/47789828
tagged with: forms
type: Question
accepted answer: http://stackoverflow.com/a/29850275
has comment: http://stackoverflow.com/comment/47797363
has comment: http://stackoverflow.com/comment/47789925
tagged with: session
tagged with: javascript
has answer: http://stackoverflow.com/a/29831707
has body: I have a form, which uses the following input towards the end: The initialisation of the form is: And the mySubmit function is: function mySubmit() { document.getElementById('ct_count').value = ct; document.getElementById("form1").submit(); } When i hit submit, I want to pass the value of ct, which is a variable count on the page, to email_submission.php and store it in a session variable. The session variable is returning blank on every submit, and i'm unsure if the value of the "ct" variable used is being passed through on the hidden field. Is someone able to pick up where i'm going wrong? There are already variables stored correctly through this, so it's not my session settings as far as i know. tldr: What's the correct way to take a javascript variable count and pass it through form submit to php? EDIT: this is the code for adding fields. intiial loop for the variable "ct" function new_link() { ct++; <?php $ct = $ct + 1; ?> document.getElementById("sec4_lender").setAttribute('name', 'sec4_lender_<?php echo $ct;?>'); document.getElementById("sec4_balance").setAttribute('name', 'sec4_balance_<?php echo $ct;?>'); document.getElementById("sec4_termdate").setAttribute('name', 'sec4_lender_<?php echo $ct;?>'); document.getElementById("sec4_security").setAttribute('name', 'sec4_security_<?php echo $ct;?>'); document.getElementById("sec4_description").setAttribute('name', 'sec4_description_<?php echo $ct;?>'); document.getElementById("sec4_status").setAttribute('name', 'sec4_status_<?php echo $ct;?>'); document.getElementById("sec4_repayment").setAttribute('name', 'sec4_repayment_<?php echo $ct;?>'); document.getElementById("sec4_repayment2").setAttribute('name', 'sec4_repayment_2_<?php echo $ct;?>'); var div1 = document.createElement('tr'); div1.id = 'sect4busloan_div_'+ct+''; // link to delete extended form elements var delLink = ' Del '; div1.innerHTML = document.getElementById('newlinktpl').innerHTML + delLink; document.getElementById('newlink').appendChild(div1); }…
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/29831707
has title: Hidden input value to php session
has comment: http://stackoverflow.com/comment/47789900

http://stackoverflow.com/q/29797819
tagged with: http://stackoverflow.com/tag/html
tagged with: web
has comment: http://stackoverflow.com/comment/47725196
type: UnansweredQuestion
tagged with: python
has comment: http://stackoverflow.com/comment/47724145
answer count: 0
has comment: http://stackoverflow.com/comment/47726425
has title: Python javascript communication
linked to: http://stackoverflow.com/q/14778167
type: Question
has body: I'd like to know whether or not it is possible to send data from JavaScript to a Python script that is running and if anyone has any concrete examples. This all on the same host. More specific: All on RPi: Python script listening for keys/input which it then responds to (sending it to Arduino via serial connection). Web page listening for key presses, key releases, a slider, ... JS has to send this data to python. Is it possible to send small things like a symbol (WASD) or a key code? It's also important that this doesn't have a lot of delay. The only thing I found so far is this: Return data from html/js to python
has comment: http://stackoverflow.com/comment/47723812
tagged with: javascript
score: 0

http://stackoverflow.com/comment/47641996
comment on: http://stackoverflow.com/a/29754670
type: AnswerComment
type: Comment
has text: ok i try it now with the buildin js chrome debugger with breakpoints. Thanks for your assistance.
score: 1

http://stackoverflow.com/q/29771118
tagged with: precompile
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/29771230
has answer: http://stackoverflow.com/a/29771227
has answer: http://stackoverflow.com/a/29771230
has title: A better understanding of javascript precompile
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29771227
has answer: http://stackoverflow.com/a/29771241
has body: var foo=1; function bar(){ foo=10; return; function foo(){} } bar(); alert(foo); I am currently learning on how javascript is actually running in the machine and this is a piece of code I see in the example. I got no idea why the final alert is 1 instead of 10. So I am wondering could any one help me explain how the javascript virtual machine is actually execute these code. Thanks!
type: Question
score: 5
upvote count: 5
tagged with: javascript
answer count: 3

http://stackoverflow.com/q/29782912
score: 0
has title: jHTMLArea-setting up dynamically
has answer: http://stackoverflow.com/a/29783834
type: AnsweredQuestion
tagged with: jhtmlarea
type: Question
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29783834
has body: I am using the jQueryEasyUI datagridview: http://www.jeasyui.com/extension/datagridview.php in the default formatter, I'm defining my textarea wich will become my jHTMLArea: detailFormatter: function(rowIndex, rowData){ var x = rowIndex + 1; html = ' '+ ' ' + ' ' + ' '+rowData.text+' ' + ' Save '+ ' Discard '+ ' ' + ' '+ ' '; $('#text_'+ x).htmlarea({ css: 'style/jHtmlArea.Editor.css', toolbar: [ ["bold", "italic", "underline"], ["p", "h3"], ["link", "unlink"] ] }); $('#text_'+ x).hide(); Now, when I expand the row to show the details, I load the jHTMLArea: onExpandRow: function(rowIndex, rowData) { var x = rowIndex + 1; window.index = x; window.gk_text = rowData.text; setHTML(x, rowData.text); } and: function setHTML(rel, text) { var html = text; html = html.replace(/\[/g, '<').replace(/\]/g, '>'); $('#text_'+ rel).htmlarea('html', html); } This is an example of the data: {"totals": 2, "rows": [{ id: 0, prg_code: "ABC", state: "OL", text: "[h3]Important Information[/h3][p]This is a notice.[/p]"}, { id: 0, prg_code: "DEF", state: "WB", text: "[h3]Important Information[/h3][p]This is a another notice.[/p]"}] } As you can see, I set the toolbar buttons to show only: ["bold", "italic", "underline"], ["p", "h3"], ["link", "unlink"] But, when I expand the row the editor has ALL the default buttons. Any ideas how to do that and make the editor fit 100% in the editor area? Note: The Save and Discard buttons work as expected. Oh, one other thing, when using in conjunction with Bootstrap, the Bootstrap .h? classes override the jHTMLArea classes and cause the toolbar to be messed up. Would also like to get a select editor for the Type with options OL (val:0), CR (val:1), and WB (val:2) Fiddle: http://jsfiddle.net/Mrbaseball34/qdt8t7jr/

http://stackoverflow.com/q/29829529
has answer: http://stackoverflow.com/a/40285068
downvote count: 0
answer count: 1
linked to: http://stackoverflow.com/q/17497063
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/47786003
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47792090
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47785989
upvote count: 1
has comment: http://stackoverflow.com/comment/47786046
tagged with: freeze
has title: Loading large number of entries in an array causes web page to freeze
has comment: http://stackoverflow.com/comment/47790282
has comment: http://stackoverflow.com/comment/47785419
has comment: http://stackoverflow.com/comment/47785970
score: 1
has comment: http://stackoverflow.com/comment/47786033
has comment: http://stackoverflow.com/comment/47785510
has comment: http://stackoverflow.com/comment/47786588
has body: I have a web page that loads large amount of entries through a promise call in AngularJS. The promise is resolved to an array that contains at least 4,000 entries (JSON object). When the data comes in from remote service, the web page freezes for 5 - 10 seconds, and a window always pops up asking if I want to stop the busy script. The code below is what I am currently doing: promiseObj.then(function(data) { //use async to handle each entry in data async.each(data, function(entry) { //handle entry here... omitted //push in the processed entry $scope.allSegs.push(entry); }, function(err) { console.log("error in retrieving all data asynchronously: ", err); }); //async }); To make the web page appear to be more responsive, I am thinking about splitting the large array (data as indicated in the above code) into multiple smaller arrays first, then use the 'async.each' to handle each smaller array sequentially. or is it better to use an interval timer to handle this? I
has comment: http://stackoverflow.com/comment/47785578
type: Question
has comment: http://stackoverflow.com/comment/47785725
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/47785608
has comment: http://stackoverflow.com/comment/47810328
has comment: http://stackoverflow.com/comment/47785533

http://stackoverflow.com/comment/47705515
has text: OK apparently I once commented on this question from a few years ago: http://stackoverflow.com/questions/6345358/queryselector-with-nested-nth-child-in-chrome-doesnt-appear-to-work Apparently different browsers have different bugs with nth-child in querySelector. I'm not sure if the situation has improved for either browser though.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29787964

http://stackoverflow.com/a/29817057
has comment: http://stackoverflow.com/comment/47761741
has comment: http://stackoverflow.com/comment/47761919
type: Answer
has body: You can get the position of the element as position().top, The css values can be retrieved as .css("margin-top") or .css("top") alert($('#mover').position().top); alert($('#mover').css("margin-top")); dasdasD Since you dislike jQuery, here is the solution in pure JS Update : var mover = document.getElementById('mover'); alert(window.getComputedStyle(mover).getPropertyValue('margin-top')); dasdasD
answers question: http://stackoverflow.com/q/29816952
score: 0
has comment: http://stackoverflow.com/comment/47761259

http://stackoverflow.com/a/29753777
accepted answer of: http://stackoverflow.com/q/29753111
downvote count: 0
answers question: http://stackoverflow.com/q/29753111
type: Answer
upvote count: 1
score: 1
has body: I think the problem you are encountering is that you capture a watch event correctly, but when you change the value of the second variable, it is also captured by the watchCollection handler and clears out that value as well. For instance: selCountry = 'Mexico' You then change selText = 'City' The code captures the selText change as you'd expect. It continues to clear out selCountry. But since you change the value of selCountry on the scope object, doing that also invokes watchCollection which then says "okay I need to now clear out searchText". You should be able to fix this by capturing changes using onChange event handlers using ng-change directive. Try the following // Comment out/remove current watchCollection handler. // Add the following in JS file $scope.searchTextChange = function(){ $scope.selCountry = ''; $scope.search = $scope.searchText; search($scope.search); }; $scope.selectCountryChange = function(){ $scope.searchText = ''; $scope.search = $scope.selCountry; search($scope.search); }; function search(value){ var count = 0; if(records) records.forEach(function(o){ if(o.Country.toLowerCase().indexOf(value.toLowerCase())) count++; }); $scope.matches = count; } And in your HTML file &lt;!-- Add ng-change to each element as I have below --&gt; &lt;select ng-options="country for country in countries" ng-model="selCountry" ng-change="selectCountryChange()"&gt; &lt;option value=""&gt;--select--&lt;/option&gt; &lt;/select&gt; &lt;input type="text" ng-model="searchText" ng-change="searchTextChange()"/&gt; New plunker: http://plnkr.co/edit/xCWxSM3RxsfZiQBY76L6?p=preview
type: AcceptedAnswer

http://stackoverflow.com/comment/47746356
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29808983
has text: @SOofWXLS How do you query the device size with PHP? It runs on the server, not the client. You need JS on the client to query the device size and send it to PHP.

http://stackoverflow.com/a/29704513
answers question: http://stackoverflow.com/q/29694558
type: Answer
score: 6
upvote count: 6
has body: On your iframe's source, you can check the parent's window by using window.top.location and see if it's set to 'https://www.mycompany.com/go/mybusinessname'. If not, redirect the page. var myUrl = 'https://www.mycompany.com/go/mybusinessname'; if(window.top.location.href !== myUrl) { window.top.location.href = myUrl; }
downvote count: 0

http://stackoverflow.com/q/29772682
tagged with: javascript
has comment: http://stackoverflow.com/comment/48253856
has title: Liferay under IE8, YUI Error: Invalid Argument
has comment: http://stackoverflow.com/comment/48221977
has comment: http://stackoverflow.com/comment/47676559
score: 0
has comment: http://stackoverflow.com/comment/48253585
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48248371
has comment: http://stackoverflow.com/comment/48251397
has comment: http://stackoverflow.com/comment/48269737
type: Question
has comment: http://stackoverflow.com/comment/47677281
tagged with: yui
tagged with: internet-explorer
has body: Im testing a Liferay 6.2 Portal on IE8 with Win XP and getting this error: Webpage error details Message: Invalid argument. Line: 18772 Char: 13 Code: 0 URI: http://a3f36f75.ngrok.io/html/js/everything.jsp?browserId=ie&amp;themeId=eacat_WAR_eacattheme&amp;colorSchemeId=01&amp;minifierType=js&amp;minifierBundleId=javascript.everything.files&amp;languageId=en_US&amp;b=6210&amp;t=1420466752000 Apparently is an error related to this function on the YUI module: /** * Sets a style property for a given element. * @method setStyle * @param {HTMLElement} An HTMLElement to apply the style to. * @param {String} att The style property to set. * @param {String|Number} val The value. */ setStyle: function(node, att, val, style) { style = style || node.style; var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES; if (style) { if (val === null || val === '') { // normalize unsetting val = ''; } else if (!isNaN(new Number(val)) &amp;&amp; re_unit.test(att)) { // number values may need a unit val += Y_DOM.DEFAULT_UNIT; } if (att in CUSTOM_STYLES) { if (CUSTOM_STYLES[att].set) { CUSTOM_STYLES[att].set(node, val, style); return; // NOTE: return } else if (typeof CUSTOM_STYLES[att] === 'string') { att = CUSTOM_STYLES[att]; } } else if (att === '') { // unset inline styles att = 'cssText'; val = ''; } style[att] = val; } }, Anybody have any idea what's happening here ? im using a datatable and Alloy UI to implement the table, also im noticing that the dom manipulation for the table is not working just for IE8, this is the code : var nodeObject = Y.one('#myDataTable table'); nodeObject.removeClass('table-table'); nodeObject.addClass('table'); nodeObject.addClass('mytable'); nodeObject.addClass('table-hover');
tagged with: windows-xp
has comment: http://stackoverflow.com/comment/47676794
has answer: http://stackoverflow.com/a/30069302
tagged with: liferay
answer count: 1

http://stackoverflow.com/comment/47639325
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29753567
has text: Rolled back to original version with the `paat` typo as others suggest it might be the problem
type: Comment

http://stackoverflow.com/comment/47696374
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29783192
has text: How are you loading the HTML? Does jQuery not add the click event? Maybe you have an older version of jQuery?

http://stackoverflow.com/a/29696205
answers question: http://stackoverflow.com/q/29696151
score: 0
type: Answer
has body: $(document).ready(function(){ $("#edit_poll").click(function() { var id=$(this).data("pollid"); add_poll_answers(id); }); }); where your element has data-pollid attribute

http://stackoverflow.com/comment/47691162
score: 0
type: Comment
type: QuestionComment
has text: @EJTH - no, you don't. Variables not scoped with `var` are automatically global. "Assigning a value to an undeclared variable implicitly creates it as a global variable (it becomes a property of the global object) when the assignment is executed. "
comment on: http://stackoverflow.com/q/29780124

http://stackoverflow.com/comment/47693136
type: QuestionComment
has text: AJAX is the only solution to your problem as suggested by @Barmar
comment on: http://stackoverflow.com/q/29781469
score: 0
type: Comment

http://stackoverflow.com/comment/47748573
type: AnswerComment
comment on: http://stackoverflow.com/a/29721362
type: Comment
has text: @web-tiki: Man, that awesome! How kind of you to take the time to build such a challenging animation. Thank you so much for your work!
score: 1

http://stackoverflow.com/comment/47632076
comment on: http://stackoverflow.com/q/29749894
type: Comment
has text: Look at the "CreateIntrinsics" process (8.2.2). The intrinsics are listed in Table 7.
score: 0
type: QuestionComment

http://stackoverflow.com/a/29825377
has body: You didn't include any of your code or explanation of how you are using the google chart API. But from javascript you should have an options object like this: var options = {'title':'Number of Cars', 'width':todaysWidth, 'height':todaysHeight, legend: 'none' }; Just set the width and height to the values you want and then draw the chart: myChart.draw(data,options); where myChart is an instance of the google.visualization pie chart class. When the values change, just make the changes to the options object and then call myChart.draw(data,options); again. So a function that would update this could be: function updateChart(newHeight,newWidth,myChart){ var options={'title':'Number of Cars', 'height':newHeight, 'width':newWidth, legend:'none' } myChart.draw(data,options); } and so whenever the data changes you'd call updateChart(...); with the appropriate height, width, and chart as arguments.
has comment: http://stackoverflow.com/comment/47777474
type: Answer
answers question: http://stackoverflow.com/q/29824877
score: 0
has comment: http://stackoverflow.com/comment/47778114

http://stackoverflow.com/comment/47816153
has text: Hi, I updated my answer with Polymers observer pattern. I hope this will help you
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29842780
type: AnswerComment

http://stackoverflow.com/comment/47563318
score: 0
comment on: http://stackoverflow.com/a/29712887
has text: @beda69 So you are telling me the timeout only works when it's 5000?
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47528524
type: Comment
comment on: http://stackoverflow.com/a/29696201
type: AnswerComment
has text: Oh ya.. It's a jQuery object containing the matching nodelist elements
score: 0

http://stackoverflow.com/q/29766417
type: AnsweredQuestion
type: Question
has title: sails.js get environment value from config in view
tagged with: sails.js
upvote count: 6
accepted answer: http://stackoverflow.com/a/29766876
tagged with: javascript
has body: I use Sails.js with default template engine (EJS). I have a view defined directly from routes config: config/routes.js '/': { view: 'homepage' } Is there a way to access environment in homepage.ejs? I need something like this: views/homepage.ejs(next does not work, so I need a working solution) ... Hello you are on <%= sails.env %> environment ... to be rendered as: Hello you are on production environment Please do not suggest me to create controller for this. I hope there is the way to get it either directly from view or through a locals in route, but how, that is the question.
tagged with: ejs
has answer: http://stackoverflow.com/a/29766876
downvote count: 0
answer count: 1
favorite count: 0
score: 6
tagged with: node.js

http://stackoverflow.com/q/29691102
has comment: http://stackoverflow.com/comment/47518744
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29691248
tagged with: animate.css
tagged with: impress.js
type: UnansweredQuestion
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47518726
has body: The goal is simple -> Say I got a sentence: "This is a special day for me ..." And I want the word "Special" being animated (little bounce). And here's what I tried (I'm using impress.js + animate.css). index.html: ... This is a special day for me I want the whole sentence to be on the same line so I added the "display: inline" part. This works fine in chrome but in safari the word "special" WON'T BOUNCE at all. If I remove the display: inline part on the word "special", then it works fine in both chrome and safari. (but the sentence won't be on the same line anymore) So it seems like the code: $(this).find("h3.xxxxx_bounce") I couldn't find the h3 element with additional style (display: inline in this case) in safari ? Is there any way better to get this done ?
type: Question
tagged with: css
has title: animate part of text in html (jquery)

http://stackoverflow.com/comment/47726019
has text: Very nice!! Simple and effective. Could also re factor this to even drill down into child properties.
comment on: http://stackoverflow.com/a/29798788
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29711108
type: Question
has body: I just created a table in javascript and i'm supposed to make the numbers in the table change color as they increase but I'm getting an error, what do you think the problem with this code is? var caloriesBurned = weight * i * j if ( caloriesBurned &lt;= userBMR*0.25 ) &lt;td&gt; &lt;span class = "black" &gt;; else if( caloriesBurned &gt; userBMR*0.25 &amp;&amp; caloriesBurned &lt; userBMR*0.5){ &lt;td&gt; &lt;span class="green"&gt;; Thank you
has comment: http://stackoverflow.com/comment/47558516
downvote count: 4
answer count: 1
accepted answer: http://stackoverflow.com/a/29711447
favorite count: 0
score: -3
tagged with: http://stackoverflow.com/tag/html
has title: How to add colours to a table in javascript?
has comment: http://stackoverflow.com/comment/47558080
upvote count: 1
has answer: http://stackoverflow.com/a/29711447
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47558196
has comment: http://stackoverflow.com/comment/47557964
has comment: http://stackoverflow.com/comment/47558269
tagged with: javascript

http://stackoverflow.com/comment/47658038
comment on: http://stackoverflow.com/q/29732539
type: QuestionComment
has text: Thanks for your reply I have added some sample code as you asked
type: Comment
score: 0

http://stackoverflow.com/a/29792441
type: Answer
has comment: http://stackoverflow.com/comment/47751075
upvote count: 1
has body: Use event.preventDefault(); to block the form to be submited. If you want to submit 2nd time, than you can verify if a class exist and add it after fields have been enabled. $(function() { $("#booking-form").submit(function(event) { if(!$(this).hasClass('submited')) { event.preventDefault(); // prevent form to submit alert("hi"); $("#Booking_clientPackagedService_id").attr("disabled", false); $(this).toggleClass('submited'); } }); }) Check the snippet to see the working example. $(function() { $("#booking-form").submit(function(event) { if(!$(this).hasClass('submited')) { event.preventDefault(); // prevent form to submit alert("hi"); $("#Booking_clientPackagedService_id").attr("disabled", false); $(this).toggleClass('submited'); } }); }) &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;form id="booking-form"&gt; &lt;input type="text" id="Booking_clientPackagedService_id" disabled="disabled" /&gt; &lt;input type="submit" value="Submit" /&gt; &lt;/form&gt;
accepted answer of: http://stackoverflow.com/q/29792363
score: 1
answers question: http://stackoverflow.com/q/29792363
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/29774380
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47679773
type: Answer
answers question: http://stackoverflow.com/q/29774273
has comment: http://stackoverflow.com/comment/47680095
has body: // Refresh/Cancel $scope.OnGridBODRefresh = function () { $scope.$broadcast('refresh',$scope.dtBODStartValue,$scope.dtBODStopValue); } I don't get why you wrapped your function into an object. If you remove the brackets around your function it would work like charm. The other issue is that your ng-click is not inside your div linked to the controller. Try to do it that way. If it doesn't work, there might also be an issue with kendo, where I would not be able to help. ({{refreshcount}}) Save Cancel @PLanguageTexts.TXT_AUTO_REFRESH: | @PLanguageTexts.TXT_BOD_TIME @PLanguageTexts.TXT_COMMENT {{dtChildStartValue}}
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29774273

http://stackoverflow.com/comment/47612236
score: 0
type: Comment
type: QuestionComment
has text: You should only use the `ng-model`, it provides you with a two-way binding to the model value
comment on: http://stackoverflow.com/q/29739565

http://stackoverflow.com/comment/47691640
score: 0
has text: @RevanProdigalKnight: Yes, they *recommend* it, but it's not a syntax requirement.
comment on: http://stackoverflow.com/q/29780681
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47791926
score: 0
comment on: http://stackoverflow.com/q/29832114
has text: why do you have "return data;" in your success callback? Does this do anything? Do you expect it to do anything?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29705669
upvote count: 1
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47547740
has title: How to pass the scope to the callback?
type: Question
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/29706053
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29706053
tagged with: callback
has body: I have the following code structure and I am trying to maintain the scope of "this" to the current object in the success and error callbacks. I have tried using Apply function, but I am not sure how to use in my use-case and that's where I need some help. Here is the code I have : function navigateToDocumentList(record){ var self= this; var handoutDocumentList=Ext.create('xxx.view.HandoutsDocumentListPanel'); var navigationView = self.getNavigationView(); navigationView.push(handoutDocumentList); navigationView.getNavigationBar().show(); navigationView.getNavigationBar().setTitle(record.data.name); var url = intermountain.constants.HANDOUTS_DOCUMENTS_OF_CATEGORY_SERVICE_URL+record.data.name; self.makeAJAXCallWIthParams(url, 16000, self.navigateToDocumentListSuccess, self.navigateToDocumentListError, self); } function makeAJAXCallWithParams(url, timeout, success, error, callbackObj) { Ext.Viewport.setMasked({ xtype: 'loadmask', message: 'Loading ...' }); Ext.Ajax.request({ url: url, timeout: 5000, success: success.apply(callbackObj,[]),// I need to know how to pass the function arguments here as earlier I was just calling it by success and now I need to call it using apply function failure: failure }); } Please let me know if I need to explain the problem better. Any input / hint would be appreciated. Thanks for your time!
favorite count: 0

http://stackoverflow.com/comment/47517331
type: AnswerComment
comment on: http://stackoverflow.com/a/29689145
score: 0
type: Comment
has text: I will look into this tomorrow since it is late night here :) as last suggestion can you put the first two lines inside `$(document).ready(function(){...`

http://stackoverflow.com/a/29733218
has comment: http://stackoverflow.com/comment/47603340
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29733099
has comment: http://stackoverflow.com/comment/47623121
type: AcceptedAnswer
downvote count: 0
has body: Simple solution is: window.location='/&lt;?php echo "$file_name"; ?&gt;.zip'; If you want, you can open new tab/window... Or you can try some library... Like this one - https://github.com/PixelsCommander/Download-File-JS
accepted answer of: http://stackoverflow.com/q/29733099
type: Answer

http://stackoverflow.com/a/29867216
type: Answer
has comment: http://stackoverflow.com/comment/91484143
score: 0
answers question: http://stackoverflow.com/q/29771158
has body: You could use @media queries in CSS, along with the @viewport CSS tag, instead of the meta viewport tag. There's a good explanation of how to do this here: http://www.html5hacks.com/blog/2012/11/28/elegantly-resize-your-page-with-the-at-viewport-css-declaration/ An example from the above link: @media (max-width: 699px) and (min-width: 520px) { @viewport { width: 640px; } } You could use this to set different viewports for portrait and landscape, and more generically narrower and wider screens.

http://stackoverflow.com/q/29694361
tagged with: http://stackoverflow.com/tag/html
has title: How refresh the style of an HTML element after changing it using Javascript?
tagged with: css
possible better answer: http://stackoverflow.com/a/29694464
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47570174
has answer: http://stackoverflow.com/a/29694464
upvote count: 3
has comment: http://stackoverflow.com/comment/47525312
accepted answer: http://stackoverflow.com/a/29694686
type: Question
score: 3
has comment: http://stackoverflow.com/comment/47525141
tagged with: javascript
has comment: http://stackoverflow.com/comment/47589274
answer count: 2
linked to: http://stackoverflow.com/q/16086201
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29694686
has body: I have an HTML page containing XML. Using Javascript, the XML attributes can be changed when the user clicks a button. (So far, everything works) However, the attribute that is changed is used in the linked CSS to determine the background color of the element. When the attribute value is changed, the style is not refreshed, so the color doesn't change. I can alter the javascript to also change the color, but that would involve hardcoding the color, and partially defeat the point of using CSS. So, it seems to me, I need to do one of two things, and I can't figure out how to do either: read the color from the CSS, and then assign it using javascript somehow use javascript to have the CSS re-applied to the document. Which approach is better? I assume the 2nd is easier, unless there is a side-effect I haven't thought of. And, whichever approach is better, HOW TO DO IT? My CSS contains: *[cleared=true] { background:lightgrey; } My XML looks like this: -826.20 826.20 1504140662984782 My Javascript is: function Reconcile(Element_ID){ try { var c=document.getElementById(Element_ID); c.setAttribute('Cleared','True'); } catch(e) { alert(e.description); } } I have tried changing the script from modifying 'Cleared' to 'Date', and I can see the date change. The 'Cleared' attribute is not displayed directly by the CSS, but is used to set the formatting of other elements and/or attributes. Changing the value of 'Cleared' before the page is loaded has the effect I expect - the CSS causes the formatting I expect. However, after the page is loaded, when the javascript changes the value of 'Cleared', no visible change in formatting takes place.
linked to: http://stackoverflow.com/q/1457740

http://stackoverflow.com/comment/47805635
has text: Sorry one other thing I don't get is why when number.length is equal to 3, why is number getting substringed 2,1?
comment on: http://stackoverflow.com/a/29838544
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47602497
score: 0
type: Comment
has text: Thanks, your response helped.
type: AnswerComment
comment on: http://stackoverflow.com/a/29733510

http://stackoverflow.com/a/29691911
type: Answer
answers question: http://stackoverflow.com/q/29691812
downvote count: 0
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47520401
has body: The easiest way to do this is that you should use ajax for this. On clicking each of the buttons send the action to separate files or methods. Retrieve whatever comes depending on the type of which action was submitted and successfully update the page. For eg: If you are retrieving then on click of retrieve you send it to some page where you retrieve the details and return it to the page and just update it. It's pretty easy if you do some google on this. Make sure all your button actions go to proper respective page. Hope this was helpful. As you mentioned this is one example here: for retrieving(I expect you know how to call another file using ajax and return values.) $.ajax({ url: 'retrieve.php', type: 'post', data: { id: id, name: name, blood_group: blood_group }, success: function(your_success_variable) { Here your_success_variable can be an array or json whatever you wish to send from the other file back just don't forget to return $('#blood_group').value(your_success_variable['blood_group]); } });

http://stackoverflow.com/comment/47667287
has text: @Indianer If your project is configured with the build tool then it may have configured commands to do all together.Hope my answer help you. Please accept if it so.
comment on: http://stackoverflow.com/a/29767664
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29763283
has title: bootstrap tooltip with multiple triggers
has comment: http://stackoverflow.com/comment/47658252
answer count: 0
upvote count: 2
type: UnansweredQuestion
score: 2
type: Question
downvote count: 0
tagged with: javascript
has body: i'm trying to use tooltip() on multiple triggers. For example :hover and focus The problem is bootstrap tooltip css is applied for the first trigger action and for the second trigger action default browser tooltip is applied instead of bootstrap css. function (scope, element, attrs) { $(element) .attr('title', attrs.clickTooltip) .tooltip({ trigger: "focus" }, { placement: "top" }); $(element) .attr('title', attrs.clickTooltip) .tooltip({ trigger: "hover" }, { placement: "top" }); } i have tried this way also: $(element) .attr('title', attrs.clickTooltip) .tooltip({ trigger: "hover focus" }, { placement: "top" }); Any help is appreciated..Thanks in advance
has comment: http://stackoverflow.com/comment/47659108
favorite count: 0

http://stackoverflow.com/q/29776784
has body: I was updating my jqGrid from 4.4.5 to 4.8.2 and noticed that the column widths stopped working (in IE9). The width in the grid just wrapped the text that was in that column. I found this thread : (jqgrid not work on IE8) and the only demo that worked was the demo46. I put a copy of my grid below to see if it needs to be changed to fix the problem. var myColNames = ['ID', 'Name']; var myColModel = [ { name: 'ID', index: 'ID', width: 50, key: true, hidden: false, editable: true }, { name: 'Name', index: 'Name', width: 150, key: true, hidden: false, editable: true }, ]; grid.jqGrid({ url: URL, datatype: 'json', ajaxGridOptions: { contentType: "application/json" }, colNames: myColNames, colModel: myColModel, loadonce: true, // enables sorting on client side hidegrid: false, // disable ^ button to show/hide ignoreCase: true, // client side sorting and filtering becomes case insensitive rowNum: gridRows, // number of rows to display per page height: 'auto', rowList: [10, 20, 50, 100, 500], // drop down for number of rows to display per page pager: pagerName, // name of pager div to display the pager in altRows: true, altclass: 'AIMAltRow', viewrecords: true, shrinkToFit: false, // enable scrolling of headers gridview: true, sortname: 'ID', sortorder: 'desc', rownumbers: true, });
type: Question
upvote count: 0
tagged with: jqgrid
tagged with: javascript
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/29777927
answer count: 2
has comment: http://stackoverflow.com/comment/47686611
tagged with: http://stackoverflow.com/tag/html
has title: JQgrid 4.8 column widths not working in IE9
favorite count: 0
possible better answer: http://stackoverflow.com/a/29835770
has answer: http://stackoverflow.com/a/29835770
linked to: http://stackoverflow.com/q/28957719
accepted answer: http://stackoverflow.com/a/29777927
tagged with: css
type: AnsweredQuestion
downvote count: 1

http://stackoverflow.com/a/29757549
downvote count: 0
has body: During evaluation the method OpenLayers.Style.createLiteral is called, which contains this line: value=(isNaN(value)||!value)?value:parseFloat(value); The content of your string is classified as not being "not a number", therefore feed to parseFloat which returns a number, and this number is converted to a string without a leading "+". Same way you would loose trailing zeros. As quick fix you may insert a zero width nonbreak space into your literal: return "+\ufeff212011223344"; This makes the string "not a number" w/o being visible.
type: Answer
answers question: http://stackoverflow.com/q/29752811
upvote count: 1
score: 1

http://stackoverflow.com/comment/47944512
type: AnswerComment
score: 0
type: Comment
has text: Ok. i have posted new question for that problem. Please check http://stackoverflow.com/questions/29817806/angularjs-load-tabs-based-on-active-tabs-but-prevent-rendering-on-visited-tabs/29818123#29818123
comment on: http://stackoverflow.com/a/29799850

http://stackoverflow.com/a/29798669
type: Answer
has comment: http://stackoverflow.com/comment/47773666
upvote count: 3
has comment: http://stackoverflow.com/comment/47773111
has comment: http://stackoverflow.com/comment/47908663
has body: afterRequest is an empty function From document - This is a template method. a hook into the functionality of this class. Feel free to override it in child classes. From source code (5.0) /** * Optional callback function which can be used to clean up after a request has been completed. * @param {Ext.data.Request} request The Request object * @param {Boolean} success True if the request was successful * @protected * @template * @method */ **afterRequest: Ext.emptyFn,** To override this function, you'll have to extend "Ext.data.proxy.Ajax". Give a function definition in the child class and use that child class in your store as the proxy. FIDDLE Why the exception occurs? In Ext 5.1 - During configuring an instance of a class, by the Configurator inside the configure function, a strict check happens for function override and the exception is thrown if the function you've overridden a function in the intance's config. Look up Ext.Configurator Extract from the class where the exception is thrown from inside the configure function (there's another check inside the reconfigure function as well) - if (instance.$configStrict &amp;&amp; typeof instance.self.prototype[name] === 'function') { // In strict mode you cannot override functions Ext.Error.raise("Cannot override method " + name + " on " + instance.$className + " instance."); } It is mostly safe to override $configStrict from true(default) to false, but not recommended as it is a private flag. NOTE: A lot of changes are not really documented and it's best to look into the source code whenever these kind issues are encountered.
has comment: http://stackoverflow.com/comment/47731294
score: 3
accepted answer of: http://stackoverflow.com/q/29796303
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47773565
has comment: http://stackoverflow.com/comment/47728378
has comment: http://stackoverflow.com/comment/47726435
answers question: http://stackoverflow.com/q/29796303

http://stackoverflow.com/a/29816237
answers question: http://stackoverflow.com/q/29813308
has body: First, try to use jQuery to simplify your JavaScript and ensure it will work on most browsers: Then, if you want only the server date, you don't need to query the database: <?php echo date('Y-m-d H:i:s') ?>
score: 0
type: Answer

http://stackoverflow.com/q/29836326
answer count: 3
has comment: http://stackoverflow.com/comment/47800017
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29836384
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/62500490
linked to: http://stackoverflow.com/q/12824549
has body: My code is this: document.addEventListener('click', function(ev){ if(ev.path[0].className == 'linkTogether'){//do something} if(ev.path[0].id == "createNewPage"){//do something} }); Which has actually been working well for dynamically created buttons and nodes, but something just feels off about it. So I'm wondering if this is best practice or if there is a better way to add event listeners to dynamically created elements. Thanks, Jack
has answer: http://stackoverflow.com/a/29836466
downvote count: 0
score: 1
type: Question
tagged with: addeventlistener
tagged with: javascript
has comment: http://stackoverflow.com/comment/47799371
has title: Is using a universal document.addEventListener("click",f) listener slower or weaker form than a specific use of it?

http://stackoverflow.com/q/29714662
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29714956
tagged with: css
answer count: 4
linked to: http://stackoverflow.com/q/134845
upvote count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29714742
type: Question
has answer: http://stackoverflow.com/a/29714983
tagged with: href
score: 3
has title: Alternative of href="#" retaining mouseover properties
has body: I have a long HTML page, on modal open the page scrolls to top which can be solved by removing href="#" from Click me to open modal But removing that, it changes mouseover display of "hand" on anchor tag to "text blinker". How do I get rid of href="#" without loosing that property?
tagged with: javascript
has answer: http://stackoverflow.com/a/29714684

http://stackoverflow.com/a/29703855
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29699830
has body: Since you are using JavaScript, I'd suggest that you make a GET request to the SharePoint REST API to get the information you want. You can access your document library and it's folder simply by making a request to http://siteUrl/_api/web/getfolderbyserverrelativeurl('Documents/NF1/Communications')/files?$orderby=TimeLastModified%20desc If you navigate to the above URL in your browser, substituting siteUrl with your sites real URL, you'll get a response back in XML format. Requesting from JavaScript Note that this method requires jQuery to work, otherwise you would have to make an XMLHttpRequest to the server. To make the request from JavaScript, an $.ajax() is very straightforward. $.ajax({ url: _spPageContextInfo.siteAbsoluteUrl + "_api/web/getfolderbyserverrelativeurl('Documents/NF1/Communications')/files?$orderby=TimeLastModified%20desc", type: "GET", headers: { "accept": "application/json;odata=verbose", }, success: function (result) { //Do something with the result here! $.each(result.d.results, function(i, item){ console.log("The URL to the file is: " + item.__metadata.uri); }); }, error: function (error) { //Ouch, an error occured with the request //Don't forget to handle the error in some way! } }); This will return an array of all the files in your folder, sorted by the field TimeLastModified, where the one with the latest modification time on the top index. The URL to each file can be accessed through the __metadata.uri property on each object in the array. In the above code sample, I iterate through all the files using jQuery $.each() function, and prints the URL of the file to the console. Depending on what you want to do with the URL, you'll have to write your custom code there. You can reference MSDN - Files and folders REST API reference if you want to explore the REST API further.

http://stackoverflow.com/a/29746742
has comment: http://stackoverflow.com/comment/47627438
type: Answer
score: 3
answers question: http://stackoverflow.com/q/29746645
upvote count: 3
has body: use $.isNumeric(colData) updated your link
downvote count: 0

http://stackoverflow.com/a/29754176
type: Answer
answers question: http://stackoverflow.com/q/29754096
score: 11
has comment: http://stackoverflow.com/comment/86574024
downvote count: 0
upvote count: 11
has body: try these settings on your webview. i have had success in the past with these mWebView = (WebView) findViewById(R.id.webview); WebSettings webSettings = mWebView.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setAllowUniversalAccessFromFileURLs(true); webSettings.setDomStorageEnabled(true); mWebView.setWebChromeClient(new WebChromeClient());
has comment: http://stackoverflow.com/comment/47640655

http://stackoverflow.com/q/29801573
has answer: http://stackoverflow.com/a/29801757
has comment: http://stackoverflow.com/comment/47732495
has comment: http://stackoverflow.com/comment/47731405
has comment: http://stackoverflow.com/comment/47732008
has comment: http://stackoverflow.com/comment/47731466
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47731348
score: 0
has title: Replacing a href link using jQuery .attr
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47731340
linked to: http://stackoverflow.com/q/179713
tagged with: href
has comment: http://stackoverflow.com/comment/47731305
accepted answer: http://stackoverflow.com/a/29801757
has comment: http://stackoverflow.com/comment/47731201
tagged with: javascript
has body: I'm trying to change the content of a href using jQuery. I've found a number of good answers on this site, and am trying to use this one to implement it: How to change the href for a hyperlink using jQuery I have it wrapped in an if statement like this: if(window.location.href == "http://test.com/Home.aspx"){ $("a[href='https://www.surveymonkey.com/s/tester123']").attr('href', 'https://www.surveymonkey.com/s/tester234'); } I've put some console logs in place and they show that this line of code is being reached, and that this: $("a[href='https://www.surveymonkey.com/s/tester123']") Is returning the correct link. However the href value is never replaced when I check the page source. I'm using http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js?build=7111092 I'm a bit stuck on how to debug what the issue is, can anyone help spot it? Hopefully its just a stupid mistake! --EDIT-- I have now also checked it using inspect element and it's not been replaced unfortunately. Also thanks to @Vohuman and @roxxypoxxy for the info on not being able to see the change unless I hovered over it. Stupidly I was expecting it to work like a find/replace!
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/47731407
favorite count: 0

http://stackoverflow.com/q/29755799
has body: I'm on Ember Cli version: 0.2.3 I'm currently exploring with Ember, and trying a very simple app. I have this in my templates/about.hbs About I'll write something interesting here Click me! and in my controllers/about_controller.js Blogger.AboutController = Ember.Controller.extend({ actions: { clickMe: function() { alert('Something something'); } } }); when I click on the button i get this error, I checked the syntax and can't seem to catch what's wrong. I need some fresh eyes. Uncaught Error: Nothing handled the action 'clickMe'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble. Now, I understand what the message is saying, but I don't know how to fix it yet.
has answer: http://stackoverflow.com/a/29756892
type: Question
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47644805
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29756892
tagged with: ember.js
has answer: http://stackoverflow.com/a/29756717
score: 1
tagged with: ember-cli
favorite count: 0
has title: Weird error with Ember controllers
has comment: http://stackoverflow.com/comment/47644372
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47646941
accepted answer: http://stackoverflow.com/a/29756717

http://stackoverflow.com/comment/47717383
type: QuestionComment
type: Comment
has text: you are assigning `view_data = response_data_json.view_data;` so why are you not using `view_data` why are you returning it in success method.
score: 0
comment on: http://stackoverflow.com/q/29794118

http://stackoverflow.com/a/29893969
has comment: http://stackoverflow.com/comment/47918374
score: 0
type: Answer
has body: WebDav is designed to extend websites (for example enable saving), so it's fairly easy. If you want to add file, you make a PUT request, just like when you want to get a file from server, you make a GET request. Samples (using JQuery): adding simple text file - JavaScript REST client Library or: adding binary file - How to upload a file using an HTTP "PUT" using JQuery? If you really need a library, it's nice to take a look at: http://www.webdavsystem.com/ajax/. It costs approx. 550$, nevertheless their website is really cool, you can learn a lot from them, for example about clients, which will enable you to gain access to your files in Owncloud server: http://www.webdavsystem.com/server/access/
accepted answer of: http://stackoverflow.com/q/29824040
answers question: http://stackoverflow.com/q/29824040
type: AcceptedAnswer

concurrency
tag name: concurrency
tags question: http://stackoverflow.com/q/29818927
tags question: http://stackoverflow.com/q/29811950
type: Tag

http://stackoverflow.com/comment/47769699
type: Comment
comment on: http://stackoverflow.com/q/29820658
has text: Somewhat yes. Found a better solution, posting it as an answer.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47765555
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29811007
has text: Can you provide some simple jsFiddle providing what you have now so i can fully understand? I think ive got the point but im not 100% sure.
score: 0

http://stackoverflow.com/q/29737554
downvote count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47608829
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/47608234
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47608278
score: -1
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/29737683
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47608390
has title: To Do list in HTML/Javascript/jQuery
has body: I'm trying to make a to do list in Javascript / HTML5. Here's my HTML: To Do What do you want to do? Add to List I'm trying to figure out how to work Javascript that will form a list with the user's entries. Sorry if this is easy, I am new to this. JavaScript window.onload = function () { $("addToList").onclick = addTask; } var addTask = function() { alert("You clicked it!"); }

http://stackoverflow.com/comment/47568943
type: Comment
type: QuestionComment
score: 0
has text: Remember to also validate this server-side. Javascript validation is easy to bypass.
comment on: http://stackoverflow.com/q/29716543

http://stackoverflow.com/comment/47608217
comment on: http://stackoverflow.com/a/29736931
has text: Thanks but I expect to edit the script using the THREE.js editor as illustrated here:- https://plus.google.com/photos/+ricardocabello/albums/6104607340192211937/6104607354618509202?pid=6104607354618509202&oid=113862800338869870683
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29791636
has comment: http://stackoverflow.com/comment/47717650
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/70285141
has answer: http://stackoverflow.com/a/29797192
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
possible better answer: http://stackoverflow.com/a/29797192
answer count: 4
has comment: http://stackoverflow.com/comment/47720073
favorite count: 0
has answer: http://stackoverflow.com/a/33116988
score: 4
has body: I have a page to increasing and decreasing quantity product on cart before going to checkout confirmation page. Actually im doing with ajax, and then the back end will execute manipulate quantity of product based on button i clicked (it has product_id). The problem is, for the first time the ajax runs well and then i refresh the table (not whole page). But, when i click the button again. It returns nothing. BUT, after i refresh page using F5 and then click the button again, the quantity is updated. Could you please show me the correct ways to solve this problem? (PS: Im sorry for my english) Ajax call : $(document).ready(function () { //Increase quantity on cart $(".btnPlus").on('click', function () { var id = $(this).val(); var url = "CRUD member/update-checkout-plus.php"; var postdata = {"id": id}; $.post(url, postdata, function (html) { $("#myCart").load(location.href + " #myCart"); }); }); Here is the button, im only working for the button plus, the minus button i havent do that yet. echo ' ' . ' ' . ' ' . ' ' . ' '; Backend (update-checkout-plus.php) : include '../../config.php'; $id = $_POST['id']; $query = mysql_query("SELECT stock FROM products WHERE product_id = '$id'"); $row = mysql_fetch_array($query); $stock = $row['stock']; //if the quantity has reached maximum of stock (DB) //quantity == $stock //else quantity++ if ($_SESSION['cart'][$id]['qty'] >= $stock) { $_SESSION['cart'][$id]['qty'] = $stock; } else { $_SESSION['cart'][$id]['qty'] ++; }
has answer: http://stackoverflow.com/a/29791819
tagged with: php
type: AnsweredQuestion
has title: Ajax Increasing Quantity on Cart only Work Once
accepted answer: http://stackoverflow.com/a/29791819

http://stackoverflow.com/comment/47623311
has text: yes .. need to add this also to retrive json response.
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29745423

http://stackoverflow.com/comment/47665121
type: Comment
type: QuestionComment
has text: Can't say any constructive, but what I've been taught: don't use eval. Even if you have to, you don't. All my teachers said there's always an alternative solution for the issue.
comment on: http://stackoverflow.com/q/29766991
score: 0

http://stackoverflow.com/comment/47689831
comment on: http://stackoverflow.com/a/29779202
has text: @TomekBuszewski: Doesn't have to be live, if you give all the relevant code and such. Both `load` and `pushState` will make it hard to do this on any of the "live" sites (or here as a Stack Snippet). I'm heading out, but presumably someone will be able to help. Good luck with it,
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47629684
comment on: http://stackoverflow.com/a/29745065
type: AnswerComment
score: 0
type: Comment
has text: Thank you very much for taking your time to help me! It works. You explained it very well.

http://stackoverflow.com/q/29762136
tagged with: javascript
type: Question
score: 0
accepted answer: http://stackoverflow.com/a/29762246
answer count: 1
tagged with: jquery
has title: Selenium test Automation : jquery select and verify whether text present ?
has answer: http://stackoverflow.com/a/29762246
has body: I am writing test automation using selenium, how to use jquery to select 9.0 GB from one of the table and verify text (9.0 GB) present in the table? All I need to do is for jquery to look into the table and look for particular text and verify that text is present. Below is the DOM : Primary 9.0 GB 8.0 GB
type: AnsweredQuestion

http://stackoverflow.com/comment/47523250
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29693270
has text: I think so you might be getting error Uncaught SyntaxError: Illegal break statement
score: 0

http://stackoverflow.com/comment/47677791
comment on: http://stackoverflow.com/q/29773632
score: 1
type: Comment
type: QuestionComment
has text: One of the ways I'd do is to avoid using `ID`s unless there is no other way around.

http://stackoverflow.com/comment/47642708
score: 1
type: AnswerComment
has text: Glad to help out, it was an interesting exercise. It's gonna be handy to have a script like this around. I wasn't kidding about the swipe (on the active image) by the way, that wouldn't need too much code. But maybe I'll open a GitHub account (haven't yet) and see if I can contribute a bit further there. Cheers.
type: Comment
comment on: http://stackoverflow.com/a/29722078

http://stackoverflow.com/comment/47598205
comment on: http://stackoverflow.com/a/29732466
has text: Uncaught TypeError: MyIFrameDoc.getElementsByTagName(...).submit is not a function
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47600250
type: QuestionComment
comment on: http://stackoverflow.com/q/29733445
has text: There's a problem when (control-)clicking the fiddle: `TypeError: intersectionArray[0] is undefined`. Do I understand correctly: are you trying to define a surface area on the globe delineated by a polygon?
score: 0
type: Comment

http://stackoverflow.com/a/29733505
has comment: http://stackoverflow.com/comment/47600396
answers question: http://stackoverflow.com/q/29733456
score: 1
has comment: http://stackoverflow.com/comment/47600363
type: Answer
has comment: http://stackoverflow.com/comment/47988469
upvote count: 1
has comment: http://stackoverflow.com/comment/47600718
downvote count: 0
has body: Why not just use a shorthand? It looks better while still keeping your current structure true. objResponse = arrResponse.length &gt; 2 ? { type: evl_ResponseType[arrResponse[0]].name, partition: evl_Partition_Status_Code[arrResponse[1]].description, icons: iconLED(bin(arrResponse[2]).result), numeric: arrResponse[3], beeps: BEEP_field[arrResponse[4]], msg: arrResponse[5].replace('$', '').trim() } : { type: evl_ResponseType[arrResponse[0]].name; } return objResponse;

http://stackoverflow.com/comment/47605600
score: 4
comment on: http://stackoverflow.com/q/29736212
type: Comment
type: QuestionComment
has text: Please do include your code. Links die over time, and it loses the context of your question.

http://stackoverflow.com/q/29773108
downvote count: 0
has answer: http://stackoverflow.com/a/29773281
score: 1
has answer: http://stackoverflow.com/a/29773404
accepted answer: http://stackoverflow.com/a/29773404
type: Question
has body: A menu opens when a specific button is clicked #btn. I would like to have the menu close, by also clicking outside the button. Here is the FIDDLE: https://jsfiddle.net/maryisdead/rkapkoLu/ Is this possible? Here is the javascript: (function() { var btn = $('#btn'); menu = $('nav ul'); menuHeight = menu.height(); $(btn).on('click', function(e) { e.preventDefault(); menu.slideToggle(); }); $(window).resize(function(){ var w = $(window).width(); if(w &gt; 320 &amp;&amp; menu.is(':hidden')) { menu.removeAttr('style'); } }); });
has answer: http://stackoverflow.com/a/29773544
tagged with: javascript
has comment: http://stackoverflow.com/comment/47676676
tagged with: jquery
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29773255
favorite count: 0
has title: How to close a menu by clicking outside the area of the open button?
answer count: 5
has answer: http://stackoverflow.com/a/29773204
has comment: http://stackoverflow.com/comment/47676721
tagged with: css
possible better answer: http://stackoverflow.com/a/29773281
type: AnsweredQuestion

http://stackoverflow.com/a/29716018
has body: If your stages depend only on completion of (not data from) the previous stage, and the three filter-handlers differ only in : a particular boolean state, the elements acted on, the asycn function to be applied to each element, then you could write a generalized handleFilter() function as simple as : function handleFilter(selected, asyncFn) { // return an aggregated promise or null. return selected ? $.when.apply(null, $.map(this, asyncFn)) : null; } As written, handleFilter() must be called with .bind(), .apply() or .call() in order to establish the value of this. You would then use handleFilter.bind() to make three executables, one for each filter, and pass them to a chain of .then()s for serial execution. $.when() .then(handleFilter.bind(elements_1, firstFilterSelected, asyncFn_1)) .then(handleFilter.bind(elements_2, secondFilterSelected, asyncFn_2)) .then(handleFilter.bind(elements_3, thirdFilterSelected, asyncFn_3)) .then(function() { //everything complete }); Each stage will wait for the previous one to complete.
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/47567894
score: 2
answers question: http://stackoverflow.com/q/29713678
downvote count: 0
has comment: http://stackoverflow.com/comment/47567700

http://stackoverflow.com/a/29816308
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29814900
has body: May this help you show and hide div elements based on the selection of radio buttons. Select File or Link File Link Press Release link Press Release File For live demo click here
has comment: http://stackoverflow.com/comment/47760653

http://stackoverflow.com/a/29798067
type: Answer
downvote count: 0
type: AcceptedAnswer
upvote count: 6
answers question: http://stackoverflow.com/q/29774238
has body: I found myself my problem. I create a specific plugin only for that after. You just needed to : webView.sendJavascript("javascript:document.getElementById(\"combi\").innerHTML=\"decroche\";"); And getActivity().getApplicationContext().registerReceiver(broadcastReceiver_hook, filter_hook); Here's my final plugin : public class Hook extends CordovaPlugin { @Override public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { initHookEvent(); return false; } /** * Use to get the current Cordova Activity * @return your Cordova activity */ private Activity getActivity() { return this.cordova.getActivity();} /** * Initializing GXV 3275 Hook Event * You ABSOLUTELY need to precise getActivity().getApplicationContext() * before registerReceiver() otherwise it won't get the good context. */ public void initHookEvent() { IntentFilter filter_hook = new IntentFilter("com.base.module.phone.HOOKEVENT"); getActivity().getApplicationContext().registerReceiver(broadcastReceiver_hook, filter_hook); } /** * BroadcastReceiver is also needed with GXV 3275 Hook Event * Just sendJavascript for each cases * /!\ webView /!\ * Is natively created by extending CordovaPlugin */ public BroadcastReceiver broadcastReceiver_hook = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if ( intent.getBooleanExtra("hookoff", false)){ webView.sendJavascript("javascript:document.getElementById(\"combi\").innerHTML=\"decroche\";"); webView.sendJavascript("javascript:document.getElementById(\"combi\").style.opacity = 1;"); } else{ webView.sendJavascript("javascript:document.getElementById(\"combi\").innerHTML=\"raccroche\";"); webView.sendJavascript("javascript:document.getElementById(\"combi\").style.opacity = 1;"); } } }; }
accepted answer of: http://stackoverflow.com/q/29774238
score: 6

http://stackoverflow.com/q/29721709
has body: I have a spring boot project with some entities, in specific, I have a Student Class with a DesiredCourses list which should be a Set&lt;>. When I use: @OneToMany(mappedBy = "student", cascade = CascadeType.ALL) public List&lt;StudentDesiredCourseEntity&gt; getStudentDesiredCourses() { return studentDesiredCourses; } public void setStudentDesiredCourses(List&lt;StudentDesiredCourseEntity&gt; studentDesiredCourses) { this.studentDesiredCourses = studentDesiredCourses; } Everything works fine but when I use @OneToMany(mappedBy = "student", cascade = CascadeType.ALL) public Set&lt;StudentDesiredCourseEntity&gt; getStudentDesiredCourses() { return studentDesiredCourses; } public void setStudentDesiredCourses(Set&lt;StudentDesiredCourseEntity&gt; studentDesiredCourses) { this.studentDesiredCourses = studentDesiredCourses; } I get org.springframework.http.converter.HttpMessageNotReadableException", "message":"Could not read JSON: (was java.lang.NullPointerException) (through reference chain: edu.cs6310.project4.entities.StudentEntity[\"studentDesiredCourses\"]-&gt;java.util.HashSet[0]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: edu.cs6310.project4.entities.StudentEntity[\"studentDesiredCourses\"]-&gt;java.util.HashSet[0]) Is there something I am missing or something extra that needs to be done? As requested, the equals and hashcode @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof StudentDesiredCourseEntity)) return false; StudentDesiredCourseEntity that = (StudentDesiredCourseEntity) o; if (!course.equals(that.course)) return false; if (!priority.equals(that.priority)) return false; if (!student.equals(that.student)) return false; return true; } @Override public int hashCode() { int result = priority.hashCode(); result = 31 * result + course.hashCode(); result = 31 * result + student.hashCode(); return result; }
tagged with: spring
has comment: http://stackoverflow.com/comment/47585688
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29749265
type: Question
possible better answer: http://stackoverflow.com/a/29722121
has answer: http://stackoverflow.com/a/29722121
upvote count: 5
tagged with: java
tagged with: hibernate
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47596250
has comment: http://stackoverflow.com/comment/47596393
accepted answer: http://stackoverflow.com/a/29749265
answer count: 2
score: 5
downvote count: 0
tagged with: javascript
favorite count: 0
has title: JsonMappingException when using a Set instead of a List

http://stackoverflow.com/q/29752653
type: AnsweredQuestion
score: 2
has body: Instead of using the AddDays(180), I'm trying to add 6 months and then set the day to the last day of that month. i.e. CustomDate8 should be 06/30/2015 at the end of the script. //Set CustomDate8 to CustomDate5 + 6 Months function Go(instance) { var vehicle = instance; var CustomDate5 = new Date('12/09/2014'); var CustomDate8 = new Date(); // update vehicle CustomDate5 field if(vehicle.CustomDate5 != null) { vehicle.CustomDate8 = vehicle.CustomDate5.AddDays(180); } if (!vehicle.CustomDate5) { vehicle.CustomDate8 = null; } } I'm relatively new to javascript and appreciate the assistance. Thank you in advance.
upvote count: 2
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29752744
answer count: 1
downvote count: 0
favorite count: 0
has title: Set date variable to last day of month 6 months from now Javascript
accepted answer: http://stackoverflow.com/a/29752744

http://stackoverflow.com/q/29716122
type: Question
downvote count: 0
has title: FileReader.readAsDataURL() errors only when debugging in chrome
tagged with: javascript
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: filereader
tagged with: google-chrome
has body: My code is working as expected in both chrome and IE. It updates a modal placeholder div with the source of a new image selected using an input type file. When debugging in chrome only (debugging in IE works fine) and a breakpoint is placed on the readAsDataURL method it errors and breaks. Can anyone explain why it's producing this error? Error: Uncaught InvalidStateError: Failed to execute 'readAsDataURL' on 'FileReader': The object is already busy reading Blobs.(anonymous function) @ pageName.aspx?id=1234:192m.event.dispatch @ jquery.min.js:3r.handle @ jquery.min.js:3 My code: $("#imageInput").change(function () { if (this.files &amp;&amp; this.files[0]) { var reader = new FileReader(); reader.onloadend = function (e) { $("#modalImagePlaceHolder").attr("src", e.target.result); }; reader.readAsDataURL(this.files[0]); } else { $("#modalImagePlaceHolder").attr("src", $("#defaultImage").attr("src")).width(480).height(385); } });
answer count: 0
has comment: http://stackoverflow.com/comment/47567200
score: 1
upvote count: 1

http://stackoverflow.com/comment/47650453
type: QuestionComment
has text: `echo "var foo = 'bar';"`
comment on: http://stackoverflow.com/q/29758791
score: 0
type: Comment

http://stackoverflow.com/comment/47751281
type: AnswerComment
has text: @user1447679 There! Fixed.
type: Comment
comment on: http://stackoverflow.com/a/29808276
score: 0

http://stackoverflow.com/a/29743988
has comment: http://stackoverflow.com/comment/47621444
has comment: http://stackoverflow.com/comment/47621339
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29743932
type: Answer
answers question: http://stackoverflow.com/q/29743932
has body: You can check height using $(window).height() $(function() { //taken from @Vohuman's comment var newClass = window.location.pathname.split('.').shift().slice(1); $('body').addClass(newClass); if($(window).height() &lt; 768) { $("body").addClass("short"); } else { $("body").addClass("tall"); } })
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/q/29812993
has comment: http://stackoverflow.com/comment/47754257
tagged with: javascript
has body: I'm currently adding a section to my website and I want to put together a guide on the page for the people that will be looking at this particular section of my site. I'd like to use Markdown for formatting and presentation. Is there any way to this inside of an HTML file? I've tried using Strapdown but it only supports certain bootstrap themes and I would like to use my own HTML around the markdown text. I haven't been able to find a StackOverflow post that explains how to do this either.
tagged with: markdown
downvote count: 2
has comment: http://stackoverflow.com/comment/47753983
upvote count: 7
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has title: Is There a Way to Include Markdown in HTML/Websites?
has comment: http://stackoverflow.com/comment/47757250
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29813321
accepted answer: http://stackoverflow.com/a/29813321
type: Question
score: 5

http://stackoverflow.com/comment/47577170
score: 0
type: AnswerComment
type: Comment
has text: ie. If comment section is block and it's clicked on, it doesn't fadeout, but if anything outside of it is clicked, it fades out.
comment on: http://stackoverflow.com/a/29721201

http://stackoverflow.com/comment/47804308
type: QuestionComment
comment on: http://stackoverflow.com/q/29838713
has text: @wookie919 so do you think the solution is not dependent on it starting at 1?
score: 0
type: Comment

http://stackoverflow.com/q/29840823
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47807885
tagged with: twitter-bootstrap
type: UnansweredQuestion
has title: Find all external css/js files and file references
has comment: http://stackoverflow.com/comment/47807895
linked to: http://stackoverflow.com/q/16956810
type: Question
has answer: http://stackoverflow.com/a/29841085
answer count: 2
has body: I downloaded a Bootstrap theme. A lot of themes, just like this one, uses links to external resources from CDNs such as fonts.googleapis and MaxCDN. I prefer to have all the files stored on the server, so I don't have to do extra calls to the CDNs, as well as sometimes I work in places with bad or no internet, and inability to access these files breaks the flow of the program. Is there a tool that goes through all css and js files and finds all files that do not use relative path? Or perhaps another solution? I tried using developer tools to check Network, but it outputs all the resources being loaded and the page that calls them, but not the file where they are used. Example header: **General** Remote Address:xxx.xxx.xx.xx:80 Request URL:http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic Request Method:GET Status Code:200 OK **Response Headers** view source Alternate-Protocol:80:quic,p=1 Cache-Control:private, max-age=86400, stale-while-revalidate=604800 Content-Encoding:gzip Content-Length:988 Content-Type:text/css Date:Fri, 24 Apr 2015 06:59:08 GMT Expires:Fri, 24 Apr 2015 06:59:08 GMT Last-Modified:Fri, 24 Apr 2015 06:59:08 GMT Server:GSE Timing-Allow-Origin:* X-Content-Type-Options:nosniff X-Frame-Options:SAMEORIGIN X-XSS-Protection:1; mode=block **Request Headers** view source Accept:text/css,*/*;q=0.1 Accept-Encoding:gzip, deflate, sdch Accept-Language:ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4 Cache-Control:no-cache Connection:keep-alive Host:fonts.googleapis.com Pragma:no-cache Referer:http://mycrm.ru/admin/students User-Agent:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36 X-Client-Data:CJO2yQEIo7bJAQiptskBCMG2yQEI8YjKAQ== **Query String Parameters** view source view URL encoded family:Source Sans Pro:300,400,600,700,300italic,400italic,600italic As you see it only points to the resource as well as the page which uses the file which uses this call, http:…
tagged with: javascript
has answer: http://stackoverflow.com/a/29841047
tagged with: jquery

http://stackoverflow.com/comment/47664936
type: AnswerComment
score: 0
type: Comment
has text: My pleasure.. you may appreciate by accepting the answer
comment on: http://stackoverflow.com/a/29765547

http://stackoverflow.com/a/29840226
upvote count: 0
answers question: http://stackoverflow.com/q/29838829
type: Answer
has body: The .catch() function you are using seems to be used in 'Database synchronization' according to the documentation. Since you already have the err parameter and the callback in your 'then' function, place your console log statement there. Like so: /* ... */ create: function(req, reply) { models.User.create(req.payload) .then(function(err, user) { if (err){ console.log(err); } }) reply('test'); }, /* ... */ The 'then' function is already 'catching' the validation errors if any.
downvote count: 1
score: -1

http://stackoverflow.com/comment/47689626
type: Comment
has text: @scripton not really, if you look to the answer time you will see that I answered 12 mins ago and he answered 8 mins ago. But ok.
comment on: http://stackoverflow.com/a/29779589
score: 0
type: AnswerComment

http://stackoverflow.com/a/29789056
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/29760301
has body: As sails.js is purely backend and Angular.js is purely frontend, they can work together nicely. All you need to do is place your angular files and logic in myapp/assets folder. Assets folder is by default acessible on sails server url. You can access it as http://localhost:1337/assets/file_name. As for the ejs, if you are using any javascript framework like angular.js then it is not a requirement as all JSON api will be made in sails framework and angular will get data in JSON format.
type: Answer
score: 2

http://stackoverflow.com/a/29824369
type: Answer
has body: You have to listen to the resize event of the window. You cannot watch a DOM attribute because changes to it do not initiate an Angular digest. A solution that updates a $rootScope property (but can easilly be tweaked to update anything else) is: app.run(['$window', '$rootScope', function($window, $rootScope) { $rootScope.windowWidth = window.innerWidth; window.addEventListener('resize', function() { $rootScope.$apply(function() { $rootScope.windowWidth = window.innerWidth; }); }); }]); See this fiddle: http://jsfiddle.net/e9hgao61/
has comment: http://stackoverflow.com/comment/47778605
upvote count: 1
answers question: http://stackoverflow.com/q/29823766
score: 1
has comment: http://stackoverflow.com/comment/47778284
downvote count: 0

http://stackoverflow.com/q/29730000
score: 1
possible better answer: http://stackoverflow.com/a/29730090
type: Question
accepted answer: http://stackoverflow.com/a/29730047
answer count: 2
has answer: http://stackoverflow.com/a/29730090
downvote count: 0
tagged with: javascript
tagged with: key
tagged with: callback
favorite count: 0
has body: I'm trying to set timeouts in javascript dynamically. Within the timeout, I rely on variables that are changed outside of the timeout callback-function. This is not a reliable practice, so I want to get rid of the dependency on this variable. This is the excerpt of my code that applies to my question: timeouts["mr"+mI] = setTimeout(function(){ groups["mr"+mI].expired = 1; io.sockets.emit("invite_channel",'{"type":"pullback","mI":"mr'+mI+'"}'); },120000); mI is changed outside of setTimeout, and will be identical to mI in the declaration of timeouts["mr"+mI]. So my question is, how can I obtain the object key from timeouts[] (inside of setTimeout callback function), as a replacement of mI? Thanks in advance! I think both of the answers (by the time of writing) solve my problem. I chose the answer that uses bind() as the accepted answer. That's mostly because I don't (yet) understand how the closed method answer works. I tried to implement it, but did not get it to work. It The other answer was fairly easily implemented. I'd like to thank both of the answerers! :-)
has answer: http://stackoverflow.com/a/29730047
upvote count: 1
tagged with: object
has title: Get object key within function as a value
type: AnsweredQuestion

http://stackoverflow.com/q/29835212
accepted answer: http://stackoverflow.com/a/29835373
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47799088
has answer: http://stackoverflow.com/a/29835373
type: Question
has comment: http://stackoverflow.com/comment/47797241
has comment: http://stackoverflow.com/comment/47797288
has comment: http://stackoverflow.com/comment/47797336
has comment: http://stackoverflow.com/comment/47797394
has body: How do you reset incremented values in JavaScript that is not in a form? I'm trying to create something that is similar to a decision tree, but to keep track of the clicks and then present them with the best answer, based on the highest click. *Bonus How would you display a message, based on the highest increment of clicks? Down below is the fiddle link to the code: HTML: Click me Click me Click me Click me Clicks1: 0 Clicks2: 0 Clicks3: 0 Clicks4: 0 Most click is: Click me JS: var clicks = 0; var clicks2 = 0; var clicks3 = 0; var clicks4 = 0; function clickME() { clicks += 1; clicks2 += 1; clicks3 += 1; clicks4 += 1; document.getElementById("clicks").innerHTML = clicks; document.getElementById("clicks2").innerHTML = clicks2; document.getElementById("clicks3").innerHTML = clicks3; document.getElementById("clicks4").innerHTML = clicks4; } function clickME2() { clicks += 1; clicks2 += 1; document.getElementById("clicks").innerHTML = clicks; document.getElementById("clicks2").innerHTML = clicks2; } function clickME3() { clicks += 1; clicks2 += 1; clicks3 += 1; document.getElementById("clicks").innerHTML = clicks; document.getElementById("clicks2").innerHTML = clicks2; document.getElementById("clicks3").innerHTML = clicks3 } function clickME4() { clicks += 1; document.getElementById("clicks").innerHTML = clicks; } http://jsfiddle.net/z66WF/68/
tagged with: javascript
tagged with: jquery
upvote count: 2
answer count: 1
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47832436
has comment: http://stackoverflow.com/comment/47797429
has title: Resetting increment values in JavaScript / jQuery that are not in a form

http://stackoverflow.com/q/29829134
has body: Here is the minimal working example: Simple Map Try refresh it and very first map is shown with correct 45 degree tilt and then it's automatically within second switched to 0 degree view. Why is this happening? Apparently 45 degree maps for this location are available so why it's not displayed correctly? Somewhere it works as expected, somewhere it's bugged like this.
has title: 45 degree tilt is shown, then it's immediately switched to 0 degree view, it's happening on some locations, why?
type: AnsweredQuestion
score: 0
type: Question
accepted answer: http://stackoverflow.com/a/29835378
tagged with: google-maps
possible better answer: http://stackoverflow.com/a/29834192
tagged with: javascript
has answer: http://stackoverflow.com/a/29834192
has comment: http://stackoverflow.com/comment/47785656
tagged with: google-maps-api-3
answer count: 2
has comment: http://stackoverflow.com/comment/47788096
has answer: http://stackoverflow.com/a/29835378
has comment: http://stackoverflow.com/comment/47785131

http://stackoverflow.com/a/29748267
has body: per request, I'll post other solutions to the problem. I get another error message (wrong indentation) for the script in the original question so I can't answer that. Recursive: eatVar = (batch_Size) -&gt; eatSome = (sheet, start = 0) -&gt; sheet.slice start,batch_Size end = start+batch_Size document.write sheet.slice start, end document.write "&lt;br&gt;" eatSome sheet, end if end &lt; sheet.length As to the last line: it is equivalent to if end &lt; sheet.length eatSome sheet, end But you aren't bound to recursion: eatVar2 = (batch) -&gt; (sheet, start) -&gt; position = 0 for elem in sheet document.write elem document.write if ++position % batch then ', ' else '&lt;br&gt;' (eatVar2 2) sheet Here is a Codepen. I really hope this is some kind of assignment, because I highly discourage you to use document.write. There are better ways to generate HTML like document.body.appendChild document.createTextNode "foobarbaz"
type: Answer
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29703420
has comment: http://stackoverflow.com/comment/47679285
has comment: http://stackoverflow.com/comment/47664421
score: 1

http://stackoverflow.com/comment/47717539
has text: Yup! I believe the values of the variables within diceClick are also not accessible outside? Because if so, then great; I plan on using the same variable through different functions.
comment on: http://stackoverflow.com/a/29794487
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29826413
tagged with: javascript
score: 0
possible better answer: http://stackoverflow.com/a/29826490
answer count: 2
tagged with: jquery
has body: I am trying to figure out this bit of code but I cant. I have tried numerous times to decipher this. Can someone help me out. $('#map').usmap({ &lt;event&gt;State: { 'MD' : function(event, data) { console.log('You interacted with the state of Maryland'); } } }); I would like this to be a click event.
has answer: http://stackoverflow.com/a/29828115
type: AnsweredQuestion
has title: usmaps.js Event binding
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/29826490
accepted answer: http://stackoverflow.com/a/29828115

http://stackoverflow.com/a/29791909
has comment: http://stackoverflow.com/comment/47716090
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47714258
type: Answer
has body: You don't have to use $templateCache manually. If your template is cached, Angular is going to load it automatically. The templateUrl should be the ID of your cached template generated by Grunt. See this Plunker http://plnkr.co/edit/132S5UMLnBzzGGGI85l3 index.html script.js 'use strict'; angular.module('sandbox', [ 'ngRoute' ]). config(['$routeProvider', function($routeProvider) { $routeProvider .when('/login', { templateUrl: 'login.html' }) .otherwise({ redirectTo: '/login' }); }]);
accepted answer of: http://stackoverflow.com/q/29791597
score: 1
answers question: http://stackoverflow.com/q/29791597

http://stackoverflow.com/q/29734464
tagged with: javascript
tagged with: ionic-framework
has body: I am trying to use a Cordova Plugin, I installed with bower, and getting an error in the browser console: GET http://localhost:8100/bower_components/ngCordova/dist/ng-cordova.js this is the file structure and here, this is what I have in my index.html
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29734596
tagged with: angularjs
tagged with: bower
type: AnsweredQuestion
tagged with: cordova
upvote count: 3
has title: On Ionic-Angular, bower components has been ignore
accepted answer: http://stackoverflow.com/a/29734596
type: Question
score: 3

http://stackoverflow.com/comment/47784328
has text: @apsillers, in my example I needed to click them. Definitely related to the enumerable attribute in your answer though. Thanks
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29821843

http://stackoverflow.com/q/29767735
tagged with: flot
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
answer count: 1
upvote count: 2
has title: Access methods to jquery plugins without variable
has answer: http://stackoverflow.com/a/29767904
has body: I will take an example of the thing I can not do using flot chart plugin, but I think it's the same behaviour for all jQuery plugins. Flot chart is a jquery plugin for charts displaying. You invoke it with $('#graph').plot(data); The documentation says you have access to a lot of methods, like this: var plot = $('#graph').plot(data); plot.getAxes(); The thing is I'm in a situation where the plot variable is not defined, so I can no write plot.getAxes(). I tried some dummy methods, like $('#graph').plot().getAxes() (removing all the data) or $('#graph').plot.getAxes() (undefined method). Is there a method to access plot plugins methods through $('#graph') selector ?
tagged with: plugins
has comment: http://stackoverflow.com/comment/47666429
score: 2
type: AnsweredQuestion
tagged with: jquery-plugins
type: Question
accepted answer: http://stackoverflow.com/a/29767904

http://stackoverflow.com/q/29767524
has comment: http://stackoverflow.com/comment/47668866
tagged with: mouseleave
has comment: http://stackoverflow.com/comment/47666111
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47666314
downvote count: 0
has comment: http://stackoverflow.com/comment/47666136
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47666403
favorite count: 0
has answer: http://stackoverflow.com/a/29768108
possible better answer: http://stackoverflow.com/a/29768375
has answer: http://stackoverflow.com/a/29767820
type: Question
has answer: http://stackoverflow.com/a/29768375
has comment: http://stackoverflow.com/comment/47666211
has comment: http://stackoverflow.com/comment/47666619
has comment: http://stackoverflow.com/comment/47666425
has comment: http://stackoverflow.com/comment/47668090
tagged with: mouseenter
has title: mouseleave not firing after mouseenter changes HTML within anchor
has comment: http://stackoverflow.com/comment/47666739
score: 9
has comment: http://stackoverflow.com/comment/47666364
answer count: 3
has comment: http://stackoverflow.com/comment/47666263
accepted answer: http://stackoverflow.com/a/29767820
has comment: http://stackoverflow.com/comment/47667414
has comment: http://stackoverflow.com/comment/47666134
has body: I'm sure I'm overlooking something but I can't seem to get the "mouseleave" event to fire after I replace the html within the anchor tag that triggered the mouseenter. Adding code here but really it's much simpler if you visit the JSFiddle link below and hover over the star icons. $(document).ready(function () { $(document).on('mouseenter', '[id^=star-]', function () { $('[id^=star-]').html('&lt;span class="star star-empty"&gt;&lt;/span&gt;'); }).on('mouseleave', '[id^=star-]', function () { $('[id^=star-]').html('&lt;span class="star star-full"&gt;&lt;/span&gt;'); }); }); Please see JSFiddle here. Simply hover over the star icons and you shall see what I mean.
has comment: http://stackoverflow.com/comment/47666193
upvote count: 9
has comment: http://stackoverflow.com/comment/47666039

http://stackoverflow.com/comment/47576474
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29720885
has text: Only [non-standard let extensions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#Non-standard_let_extensions) ([let block](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#let_block) and [let expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#let_expressions)) will be removed.
type: AnswerComment

http://stackoverflow.com/a/40651444
score: 0
has body: The problem is related to the legacy input model, which is enabled by default for WebBrowser Controls hosted by an application. To get your OpenLayers3 application working you have to disable it in the registry. To do this you have to set FEATURE_NINPUT_LEGACYMODE to 0 for your application. If this key doesn't exist in your FeatureControl branch, you have to create it manually. For more information about the legacy input model read this.
type: Answer
answers question: http://stackoverflow.com/q/29752190

http://stackoverflow.com/comment/47583866
comment on: http://stackoverflow.com/q/29724812
score: 0
type: Comment
type: QuestionComment
has text: What is the / at the end there? You want ; first off.

http://stackoverflow.com/comment/47604577
type: AnswerComment
type: Comment
score: 2
has text: @SMcCrohan very right. I read the question too fast. Edited and added that functionality so the OP can adapt.
comment on: http://stackoverflow.com/a/29735542

http://stackoverflow.com/q/29736442
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
has body: I'm not a JSON god by any stretch of the imagination, but I'm not understanding why this isn't working, and what I need to do to make it work. I've searched around for a while now and most likely my problem is I don't know the right keywords to search for to solve this. I'm wanting to call a function and, within that function, create a JSON object so I can store it in an IndexedDB "table", like so: UpdateSettingsValue("initialized", true); function UpdateSettingsValue(key, value){ var tx = db.transaction(["settings"], "readwrite"); var store = tx.objectStore("settings"); var trans = { key:value } var request = store.add(trans); } This is creating an entry just fine, but it gets written as {key: true}. So my question is how can I make it written as {initialized: true}? Thanks for your help!
has title: function parameter as json key
has answer: http://stackoverflow.com/a/29736933
type: Question
tagged with: javascript
upvote count: 1
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29736933

http://stackoverflow.com/a/29722354
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29710839
type: Answer
has body: Figured it out. The problem was that I wasn't zooming on the correct containing element. Once I set it this way, it worked great. make a &lt;g&gt; inside the main svg put all the map stuff inside that &lt;g&gt; set the zoom function to translate and scale that &lt;g&gt; but set the .call on the svg not the &lt;g&gt;
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29710839

http://stackoverflow.com/comment/47658991
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29763477
has text: To remove a product, just map the position of the product in the session array and remove that product, Take the array length and you'll get the number of products added dynamically.
score: 0

http://stackoverflow.com/comment/47707872
has text: Thanks, I'm realizing JSFiddle isn't always so reliable when it comes to certain things.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29788957
type: Comment

http://stackoverflow.com/comment/47659512
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29763871
type: Comment
has text: http://jsfiddle.net/adeneo/1L9dpj0o/

http://stackoverflow.com/comment/47801280
type: Comment
has text: Why do you need to load it dynamically anyway?
comment on: http://stackoverflow.com/q/29836991
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47513639
comment on: http://stackoverflow.com/a/29688256
score: 0
type: Comment
has text: Oh right now I get it, the 2 problems can now be solved by just removing the brackets. Thanks a lot!
type: AnswerComment

http://stackoverflow.com/comment/47677851
has text: The fact that localStorage isn't appearing seem puzzling. Is it possible that it's been disabled by a group policy or other administrative action? As far as the other browser goes, you're right. I was focusing on localStorage, not ActiveX. Sorry.
type: Comment
comment on: http://stackoverflow.com/a/29757835
score: 0
type: AnswerComment

youtube
tags question: http://stackoverflow.com/q/29705395
tags question: http://stackoverflow.com/q/29753984
tags question: http://stackoverflow.com/q/29731660
tags question: http://stackoverflow.com/q/29748107
type: Tag
tags question: http://stackoverflow.com/q/29807942
tag name: youtube
tags question: http://stackoverflow.com/q/29761107
tags question: http://stackoverflow.com/q/29723112
tags question: http://stackoverflow.com/q/29748961
tags question: http://stackoverflow.com/q/29783976
tags question: http://stackoverflow.com/q/29725424
tags question: http://stackoverflow.com/q/29837395

http://stackoverflow.com/q/29762144
has answer: http://stackoverflow.com/a/29762836
tagged with: javascript
has comment: http://stackoverflow.com/comment/47656330
has body: I am creating a table dynamically in the run time based on some action in UI as follows $(figure.children.data).each(function (i, Column) { if (i != 0) { var callBack = function () { RemoveColumn(figure, Column.figure.id); } var input = $("&lt;input&gt;") .attr("type", "checkbox") .attr("checked", "checked") .on("change", callBack); var tr = $('#tblEntity').append('&lt;tr&gt;'); $("&lt;td&gt;").appendTo(tr).append(input); $("&lt;td&gt;").appendTo(tr).append(Column.figure.text); } }); and the RemoveColumn function is as follows. function RemoveColumn(figureToBeModified,columnID) { $(figureToBeModified.children.data).each(function (i, column) { if (column.figure.id == columnID) { figureToBeModified.hide(column.figure); figureToBeModified.remove(column.figure); } }); } Problem: When i un check the check box for the first time it is working fine(means RemoveColumn function is getting called),but afterwords if i check or un check the checkbox RemoveColumn is not getting called.
answer count: 3
downvote count: 0
tagged with: jquery
favorite count: 0
has title: Checkbox callback function not getting called from second onchange
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/47656530
has answer: http://stackoverflow.com/a/29762612
has answer: http://stackoverflow.com/a/29762738
type: Question

http://stackoverflow.com/a/29817424
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29816982
has comment: http://stackoverflow.com/comment/47762213
has comment: http://stackoverflow.com/comment/47762059
answers question: http://stackoverflow.com/q/29816982
has body: You can use the following regex: \[\!([\s\S]+?)\]\s+([\s\S]+?)\s*\[@\1\] Explanation: \[\! - Match literal [! ([\s\S]+?) - Capture group 1 to match 1 or more characters inside [] (the tag name, we'll need that later on) \]\s+ - Literal ] and 1 or more whitespace symbols ([\s\S]+?) - Capture group 2 to capture (even multiline) description \s*\[@\1\] - Match 0 or more whitespace, followed by a literal [@, then a backreference to the first capture group (the tag name), and then a literal ]. See demo. var re = /\[\!([\s\S]+?)\]\s+([\s\S]+?)\s*\[@\1\]/g; var test_str = '[!Qtextara1] Long Description Wi[th%^&amp;*\n(Abra# $]Cadabra~!~## 1 [@Qtextara1]\n [!Qtextarea2] Description2 [@Qtextarea2]'; while ((m = re.exec(test_str)) !== null) { alert(m[1] + ", " + m[2]) }
has comment: http://stackoverflow.com/comment/47762805
upvote count: 4
score: 4
has comment: http://stackoverflow.com/comment/47762024

http://stackoverflow.com/comment/47824576
type: QuestionComment
has text: If there wouldn't be anything your method would fail, the parsing results in a correct array else it would either fail with a `NullPointerException` (no input) or an `ArrayIndexOutOfBoundsException` due to failed parsing into an array.
score: 0
comment on: http://stackoverflow.com/q/29843473
type: Comment

http://stackoverflow.com/q/29792248
has comment: http://stackoverflow.com/comment/47715509
favorite count: 0
has comment: http://stackoverflow.com/comment/47713269
tagged with: angularjs
has title: how to show or hide list in while typing in text field?
has comment: http://stackoverflow.com/comment/47714056
has answer: http://stackoverflow.com/a/29792503
has comment: http://stackoverflow.com/comment/47713206
type: UnansweredQuestion
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/47713949
has answer: http://stackoverflow.com/a/29792404
tagged with: javascript
has comment: http://stackoverflow.com/comment/47713320
tagged with: angularjs-scope
tagged with: ionic-framework
score: 0
answer count: 2
has body: http://codepen.io/anon/pen/ZGEpMN hello I am trying to make auto complete in ionic using angularjs.I am able to make auto complete but I found some issue .I need to display my filter list when user type on input field .In other words Currently my list is display every time.I need to display my list when I type anything on text field .And when I remove all text from text field it should again hide .could you please tell me how I will achieve this thing here is my code &lt;div class="listcontainer"&gt; &lt;li class="item" ng-repeat="station in data.data | filter:station.stationCode:startsWith"&gt;{{station.stationName+"-("+station.stationCode+")"}}&lt;/li&gt; &lt;/div&gt; http://codepen.io/anon/pen/ZGEpMN secondly : why my list is not scrolling ? when i touch up and touchdown it is not scrolling /? .listcontainer{ border :1px solid blue; height:150px; overflow:auto; } Thanks
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/29828819
answer count: 2
has comment: http://stackoverflow.com/comment/47808309
has comment: http://stackoverflow.com/comment/47784562
has comment: http://stackoverflow.com/comment/47808318
has comment: http://stackoverflow.com/comment/47784957
possible better answer: http://stackoverflow.com/a/29829376
has answer: http://stackoverflow.com/a/29829459
has answer: http://stackoverflow.com/a/29829376
tagged with: html-table
has title: Divided first cell in a table
score: 2
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/14739162
downvote count: 0
has comment: http://stackoverflow.com/comment/47784055
tagged with: javascript
favorite count: 0
has body: Is it possible divide the first cell of a table and add 2 titles to it ? What I would like is something like this : I find several solutions to divide cell horizontally or vertically, but I can't find how to do it diagonally... Anybody know how to do it ? Any technology is ok (html, css, javascript)
type: Question
accepted answer: http://stackoverflow.com/a/29829459
tagged with: css
upvote count: 2

http://stackoverflow.com/q/29831906
tagged with: css
has answer: http://stackoverflow.com/a/29832398
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/29832398
has body: I have a custom directive that shows/hide an element based on the value of another service. I tried creating a test to see if the directive does what is should do. At the beginning I tested agains the ":visible" selector, but it always returned false even when I knew that the element was actually showing. it('Should show element if logged', function () { element = angular.element('<p hc-auth>Some Text '); AuthService.Logged = true; scope = $rootScope.$new(); scope.$apply(function () { $compile(element)(scope); }); expect(element.is(":visible")).toBeTruthy(); }); After some debugging, I realized that during the test execution, the element had a width and height of 0 even if the display was set to block, and therefore the ":visible" selector was always returning false. I changed it to check against the display selector instead and now it correctly tests the element, but this seems to be too dependent on the implementation of how to show an element. it('Should show element if logged', function () { element = angular.element('<p hc-auth>Some Text '); AuthService.Logged = true; scope = $rootScope.$new(); scope.$apply(function () { $compile(element)(scope); }); expect(element.css('display')).toBe('block'); }); What would be the best approach to this situation?
type: Question
answer count: 2
score: 5
tagged with: javascript
has title: Test if custom angular directive shows/hides element
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29833325
accepted answer: http://stackoverflow.com/a/29833325
favorite count: 0
upvote count: 5
tagged with: angularjs

http://stackoverflow.com/comment/47763211
score: 0
has text: I covered that in the question -- it's the pain of making the second copy match the first, but being able to update.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29802833

http://stackoverflow.com/comment/47610935
comment on: http://stackoverflow.com/q/29734467
has text: An example would help to work things out. Can you post a link to your page/code? Looking at the example `csv` file you posted in a previous comment, it doesn't seem to match your code. In the `color.domain` you're filtering out `type` and `date`, but these don't seem to be a part of your `csv` data. Perhaps you haven't completely converted the example you posted to match your dataset? I would guess that you haven't updated the `html` of the page (specifically the `#menu select` element) to match your data either.
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/comment/47527324
type: AnswerComment
score: 0
type: Comment
has text: Yes. That's exactly what I wanted. Thanks a lot!
comment on: http://stackoverflow.com/a/29695303

http://stackoverflow.com/comment/47780653
comment on: http://stackoverflow.com/q/29824627
score: 1
type: QuestionComment
has text: @Jonathan: RobG's correct, the second declaration is ignored. The **assignment**, on the other hand, isn't.
type: Comment

http://stackoverflow.com/q/29762382
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29767010
has body: I have some data that is available in json, in this format "card": { "id": "ybLaK64d", "type": "VISA", "last4": "1881", "expMonth": 11, "expYear": 17, "dateCreated": 1429515587898, "cardEntryMode": "E_COMMERCE" }, "disputed": false, "amount": 1000, "settlementAmount": 1000, "tagPurchase":true, //optional the card object structure is fixed, but there could be up to 10 extra optional fields. I want to render this in an html table dynamically, such that rows with missing fields are marked undefined. my front end is angularjs, pulling in the json via $http. my final table would be something like this card.id card.type . . . card.cardentrymode disputed amount . . . how can I get this done, so that the table is dynamically created, is updated in real time and so that the table headers are created from the record with the most optional fields?
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47671908
has comment: http://stackoverflow.com/comment/47661174
has comment: http://stackoverflow.com/comment/47656892
tagged with: http://stackoverflow.com/tag/json
has title: Dynamically Render Unstrutured JSON Data in an html Table
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/29729554
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47603287
has comment: http://stackoverflow.com/comment/47592997
has comment: http://stackoverflow.com/comment/47592863
type: Answer
has comment: http://stackoverflow.com/comment/47592647
has comment: http://stackoverflow.com/comment/47592769
has comment: http://stackoverflow.com/comment/47592674
has comment: http://stackoverflow.com/comment/47592737
answers question: http://stackoverflow.com/q/29729067
has comment: http://stackoverflow.com/comment/47592889
score: 5
has comment: http://stackoverflow.com/comment/47592845
accepted answer of: http://stackoverflow.com/q/29729067
upvote count: 5
has body: Update: This is indeed a regression between Chrome 41 and Chrome 42. It's being tracked here: http://crbug.com/478522 Chrome 41's output: Chrome 42's output: They've made improvements to syntax highlighting as you type in the dev tools and this probably broke. I've pinged a friend who is deeply involved with the dev tools. Nice find. No. The problem you describe is very real. Objects created with constructors will have their name displayed when logging them and generally better debugging experience in Chrome (and in node/io.js). For this reason - I avoid Object.create for prototypical inheritance in my own code although I prefer it conceptually. I think you understand this - but I still want to clarify for future readers. Note that the inheritance still happens with the Object.create version - the only difference is in how the object is logged and treated in the debugger.

http://stackoverflow.com/comment/47630091
type: Comment
has text: Are you looking for instances created by `new ...()` or just the Constructors that have some special prototype?
comment on: http://stackoverflow.com/q/29748722
score: 0
type: QuestionComment

http://stackoverflow.com/q/29810287
tagged with: sails.js
has answer: http://stackoverflow.com/a/38819560
upvote count: 5
tagged with: javascript
possible better answer: http://stackoverflow.com/a/38819560
accepted answer: http://stackoverflow.com/a/30003470
answer count: 2
score: 5
has title: sails.socket testing with npm test
downvote count: 0
has body: I'm using sails.js v0.11.0 and I am just getting into unit testing. I can test normal controllers through http requests, but I have no idea where to start to test the same calls over a socket requests. If you have a good resource or a sample test using sockets that would be fantastic. var assert = require('assert'); var request = require('supertest'); describe('Auth Controller', function () { describe('#callback()', function () { it ('passport-local authentication should succeed if email and password valid', function (done) { request(sails.hooks.http.app) .post('/auth/local') .send({ identifier: 'existing.user@email.com', password: 'admin1234' }) .expect(200) .end(function(err) { done(err); }); }); it ('passport-local authentication should fail and return error code if email is invalid', function (done) { request(sails.hooks.http.app) .post('/auth/local') .send({ identifier: 'invalid@email.com', password: 'admin1234' }) .expect(403) .end(function(err) { done(err); }); }); it ('passport-local authentication should fail and return error code if password is invalid', function (done) { request(sails.hooks.http.app) .post('/auth/local') .send({ identifier: 'existing.user@email.com', password: 'invalid1235' }) .expect(403) .end(function(err) { done(err); }); }); //Test with Web Sockets from sails.io describe('sails.socket', function () { describe('With default settings', function() { describe('once connected, socket', function () { it ('passport-local authentication via web socket should succeed if email and password valid', function (done) { //Socket version? request(sails.hooks.http.app) .post('/auth/local') .send({ identifier: 'existing.user@email.com', password: 'admin1234' }) .expect(200) .end(function(err) { done(err); }); }); it ('passport-local authentication via web socket should fail and return error code if email is invalid', function (done) { //Socket version? request(sails.hooks.http.app) .post('/auth/local') .send({ identifier: 'invalid@email.com', password:…
favorite count: 0
tagged with: sockets
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/30003470
type: Question
tagged with: testing

http://stackoverflow.com/comment/47674912
has text: Because 60 is not a valid radix value.. from the doc `An integer between 2 and 36 that represents the radix`
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29772229
type: QuestionComment

http://stackoverflow.com/a/29836453
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29836343
downvote count: 0
has body: One of the easiest ways to accomplish this is to create a seperate class in your CSS: .hidden { visibility: hidden; } And then add or remove that class as needed. For example: document.getElementById("special-checkbox").classList.add('hidden'); If you absolutely must use the declaration input[type=radio] eactly as in your problem, then you can override this using the same technique: input[type=radio].shown { visibility: visible; } And you'll use javascript just like above to add the shown class to those items that are being unhidden. Because this qualifier is more specific than your general selector, it will take precedence. Edit Something I missed. If you want all of the radio buttons on a particular page to be hidden or shown, you could attach a class to any common ancestor in the DOM, and then use cascading. For example, you could attach the class show-radio to some DIV tag higher in the hierarchy (using the technique above), and then the following rule would cascade your intentions to all of the radio inputs. show-radio input[type=radio] { visibility: visible; } This is nice because you only have to set a class once, instead of once for each element.

http://stackoverflow.com/q/29801767
type: UnansweredQuestion
type: Question
has title: Javascript code for auto-advance on matrix format in Qualtrics
answer count: 1
tagged with: javascript
score: 0
tagged with: matrix
tagged with: qualtrics
has body: I'm creating a survey on Qualtrics where I'm hoping to auto-advance to the next page after the survey taker makes his/her choice on the last question of a matrix. I have the javascript code to auto-advance after a click on a single-choice question but I need to edit it to auto-advance on the click of the last single-choice question in a matrix table: var that = this; this.questionclick = function(event,element){ if (element.type == 'radio') { that.clickNextButton(); } }
has answer: http://stackoverflow.com/a/30719154

http://stackoverflow.com/comment/48373792
has text: This didn't help me actually, as the service that I'm calling can't queue the requests and can handle requests one after the other.
comment on: http://stackoverflow.com/a/29831877
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47766111
score: 0
type: QuestionComment
type: Comment
has text: Why not have an empty view which opens the popup, and then based on the popup action navigate to the actual view?
comment on: http://stackoverflow.com/q/29819286

http://stackoverflow.com/comment/47740826
score: 0
has text: cool sounds good. Keep me posted with what it was when you find it I'll be interested to hear
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29806066

http://stackoverflow.com/comment/47531993
score: 0
type: AnswerComment
has text: Thanks for the answer, infact it was best one. Please could you tell me or write a function how can i navigate onclick (handling the onclick event).
type: Comment
comment on: http://stackoverflow.com/a/29695077

http://stackoverflow.com/comment/47690799
comment on: http://stackoverflow.com/q/29780108
type: Comment
has text: well currently, the autoloading modal appears by default somewhere on the page (centered near top of the page). What I'd like to do is posiiton it just beside a certain div or span I would manually set. Like a tooltip that stays near a defined point
type: QuestionComment
score: 0

http://stackoverflow.com/a/29705012
has body: As an answer to your first question on why it does happen with computed binds but not with normal observables: Let's consider wholeNumber binding. Every time the value of the input field changes, dom-to-computable binding executes setter write, which in his turn updates cents; because the computed wholeNumber depends on cents observable it is subscribed to all its changes, so the change of cents causes computable-to-dom binding to execute read and update the input (and moves the cursor to the the end of the input field). Here is a slightly updated jsfiddle, with logging of getter/setter calls (https://jsfiddle.net/mdydarfb/) In the case of an ordinary observable, every change of the input field updates only the state of the binded observable without that "chain reaction". As an answer to the second qustion: If I understood the problem properly, "turning the tables" on your original code would be sufficient: just make cents pureComputed and wholeNumber observable and bind them together - http://jsfiddle.net/uvmqk4sd/1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29694098
accepted answer of: http://stackoverflow.com/q/29694098
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/47782692
score: 0
type: AnswerComment
type: Comment
has text: this is working for grade and score, but when i add new element, I want to add changes of that newly added input and select element and put them in watch group.
comment on: http://stackoverflow.com/a/29827897

http://stackoverflow.com/a/29833738
score: 0
has comment: http://stackoverflow.com/comment/47797596
type: Answer
answers question: http://stackoverflow.com/q/29833245
has body: First I suggest to remove unnecessary groups in the regular expression, /\{\{ %(\d)\$. \}\}/g instead of /(\{\{ %(\d)\$(.) \}\})/g. Then, to replace you can use a much shorter approach (and also more clear in my oppinion): var input = "{{ %1$@ }} / {{ %1$@ }} ({{ %2$@ }}) {{ %1$@ }} {{ %1$@ }} {{ %1$d }} {{ %1$@ }} of {{ %2$d }} of {{ %3$d }}"; var output = input.replace(/\{\{ %(\d)\$. \}\}/g, "%@$1"); The final value of output is %@1 / %@1 (%@2) %@1 %@1 %@1 %@1 of %@2 of %@3

http://stackoverflow.com/comment/84406775
type: AnswerComment
score: 0
type: Comment
has text: @PaulS. say there is an array like object `var objSort = {0: 1, 1: 7, 2: 2}`,why it doesnt get sorted by `Array.prototype.sort.call(objSort); ?`
comment on: http://stackoverflow.com/a/29707677

http://stackoverflow.com/q/29784385
downvote count: 0
answer count: 1
tagged with: ghost-blog
favorite count: 0
accepted answer: http://stackoverflow.com/a/29789404
tagged with: rss
upvote count: 2
has body: The Ghost FAQs suggest that my ghost blog's rss feed can be found at 'exampleblog.com/rss'. However my blog throws a 404 when I try to navigate to the '/rss' url. Any suggestions for where I might be going wrong? In case it's helpful, the blog is hosted on github pages. Here are my production settings in config.js: // ### Production // When running Ghost in the wild, use the production environment // Configure your URL and mail settings here production: { url: 'http://markbennett.io', mail: { transport: 'SMTP', options: { service: 'Mailgun', auth: { user: '[removed]', // mailgun username pass: '[removed]' // mailgun password } } }, database: { client: 'sqlite3', connection: { filename: path.join(__dirname, '/content/data/ghost.db') }, debug: false }, server: { // Host to be passed to node's `net.Server#listen()` host: '127.0.0.1', // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT` port: '2368' } }
score: 2
type: AnsweredQuestion
has title: Ghost blog not creating RSS feed
type: Question
has answer: http://stackoverflow.com/a/29789404
tagged with: javascript
has comment: http://stackoverflow.com/comment/47702382

http://stackoverflow.com/comment/47703573
has text: Add a fiddle of your code: www.jsfiddle.net
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29721430

http://stackoverflow.com/comment/47562252
has text: I will do that. But I think the code isn't perfect yet. How can I avoid that the array will be created every second if it already exists? This is the code now: http://pastebin.com/0w93D4mt
score: 0
comment on: http://stackoverflow.com/a/29705414
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/47672388
type: Comment
type: QuestionComment
has text: where are you getting the obj variable for use in your $.each function?
comment on: http://stackoverflow.com/q/29770893
score: 0

http://stackoverflow.com/comment/47634123
score: 0
type: AnswerComment
has text: You can omit the file extension when requiring.
comment on: http://stackoverflow.com/a/29750844
type: Comment

http://stackoverflow.com/a/29820261
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/47767951
type: AcceptedAnswer
has body: You have an angular error. Use track by in your ng-repeat. Reference https://docs.angularjs.org/api/ng/directive/ngRepeat#tracking-and-duplicates By default, ngRepeat does not allow duplicate items in arrays. This is because when there are duplicates, it is not possible to maintain a one-to-one mapping between collection items and DOM elements. If you do need to repeat duplicate items, you can substitute the default tracking behavior with your own using the track by expression.
has comment: http://stackoverflow.com/comment/47767272
has comment: http://stackoverflow.com/comment/47767718
accepted answer of: http://stackoverflow.com/q/29820164
type: Answer
answers question: http://stackoverflow.com/q/29820164
score: 2

http://stackoverflow.com/comment/47712073
has text: Use the right type `decimal`: `bool myBoolean = .6m + .3m + .1m == .1m + .3m + .6m;`
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29791538

http://stackoverflow.com/comment/47681394
has text: @redbmk That would be useful.
comment on: http://stackoverflow.com/q/29773250
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29784431
tagged with: http://stackoverflow.com/tag/html
has body: so my on click event to scroll down to the hashtag element class worked fine but i noticed if i requested from another page it did not scroll so i added window load which works lovely but now with both bits of code together the on load scrolls if a hashtag url is present but click no longer works... does anyone have a better solution for these to both work? JS // Scroll To # Links $('a[href^="#"]').on('click', function(e) { if (!$(this).hasClass("menu-button")) { e.preventDefault(); var target = this.hash; target = target.replace('#', ''); var $target = $('.' + target); $('html, body').stop().animate({ 'scrollTop': $target.offset().top }, 700, 'swing', function() { window.location.hash = '#' + target; }); } }); // Scroll on load if #hashtag set in URL $(window).load(function(e){ // Remove the # from the hash, as different browsers may or may not include it var loadTarget = location.hash.replace('#',''); if(loadTarget != ''){ e.preventDefault(); // Clear the hash in the URL // location.hash = ''; // delete front "//" if you want to change the address bar var $loadTarget = $('.' + loadTarget); $('html, body').stop().animate({ 'scrollTop': $loadTarget.offset().top }, 700, 'swing', function() { window.location.hash = '#' + loadTarget; }); } }); HTML: test link testing content
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29785995
type: Question
has title: jQuery scroll to element on click but also page load if present
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/29785564
answers question: http://stackoverflow.com/q/29785294
has body: var startTime = '15:10:10'; var endTime = '22:30:00'; currentDate = new Date() startDate = new Date(currentDate.getTime()); startDate.setHours(startTime.split(":")[0]); startDate.setMinutes(startTime.split(":")[1]); startDate.setSeconds(startTime.split(":")[2]); endDate = new Date(currentDate.getTime()); endDate.setHours(endTime.split(":")[0]); endDate.setMinutes(endTime.split(":")[1]); endDate.setSeconds(endTime.split(":")[2]); valid = startDate &lt; currentDate &amp;&amp; endDate &gt; currentDate
has comment: http://stackoverflow.com/comment/115343785
upvote count: 22
downvote count: 0
has comment: http://stackoverflow.com/comment/47701056
score: 22
type: Answer
has comment: http://stackoverflow.com/comment/115312109
has comment: http://stackoverflow.com/comment/47701048

http://stackoverflow.com/q/29829160
has answer: http://stackoverflow.com/a/29829897
tagged with: http://stackoverflow.com/tag/html
answer count: 4
tagged with: attributes
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29829231
accepted answer: http://stackoverflow.com/a/29829341
has answer: http://stackoverflow.com/a/29830877
type: Question
has answer: http://stackoverflow.com/a/29829341
tagged with: javascript
has answer: http://stackoverflow.com/a/29829231
score: 0
has title: check if an element has any attribute from a given array
has body: If I have an attribute disabled, and I want to check if an element has this attribute before running a function, I can use if element.hasAttribute('disabled') If I have several attributes that relate to the same function, such as attributes = [disabled, something, another] How can I use if element.hasAttribute('attribute') to check for any of the attributes in the array? Update: I actually only have two items in my array, so I did if el.hasAttribute('noink') || el.hasAttribute('disabled') The responses below are also viable and I would use them if I had a larger array.

http://stackoverflow.com/a/29813305
has body: The first one is simple object literal with defined properties and methods. See: Object Literals The second one is Immediately-Invoked Function Expression (IIFE) returning an object literal with it's properties and methods. It is meter of current situation when you would like to use one the other but the second one enables you to have private "stuff" and is used for Revealing Module Pattern.
answers question: http://stackoverflow.com/q/29813182
score: 0
type: Answer

http://stackoverflow.com/comment/47559542
comment on: http://stackoverflow.com/q/29711487
has text: Here's a Fiddle to illustrate the problem https://jsfiddle.net/f85vp6g4/1/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47744147
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29806691
type: Comment
has text: @elvinl. Also, you need to know that `window.location.href` will return the full URL, so comparing it to "Game2.html" probably won't work.

http://stackoverflow.com/comment/47695778
comment on: http://stackoverflow.com/q/29782817
has text: I updated the example to my actual code, I was just using another example before to cut down on the useless parts but now that I see it's working in the fiddles I would like to see if I made an error in mine.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47758939
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29815843
has text: what duplication u want to avoid?

http://stackoverflow.com/comment/47550156
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/29707214
type: Comment
has text: Ok, sorry, I missed you want to change hash part of URL! I know it may looks hacky and ugly, but replacing `iframe` with new one, with updated URL, should work out of the box.

http://stackoverflow.com/a/29766705
has comment: http://stackoverflow.com/comment/47664941
type: Answer
has comment: http://stackoverflow.com/comment/47666237
has body: The validation functions you've quoted don't reveal any information that it seems like you need to keep secret (quite the opposite, actually, telling people what is and isn't required is useful and could make its way to the UI). So they're "safe" in that they don't reveal anything confidential. If you have validation functions that use information or techniques that you want to keep secret, you'll need to move them to the server, as they wouldn't be "safe" as they'd be revealing confidential information. You can make it harder for people to understand your client-side validation functions by using an aggressive minifier/obfuscator, such as Google Closure Compiler in advanced mode. But you can't make it impossible: If the browser can read the code, people using the browser can read the code. And just because we're talking about client-side validation, the usual warning: Even though you're validating client-side, you still have to validate server-side. Users can bypass your client-side code and send in invalid information.
upvote count: 7
has comment: http://stackoverflow.com/comment/47665058
answers question: http://stackoverflow.com/q/29766626
score: 7
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29766626

http://stackoverflow.com/comment/47580172
has text: One more thing! How can I also do something like this? `$(document).mousedown(function(event) { var commentSection = $('div[name="comments"]'); if(!$(commentSection).is($(event.target)) && !$(event.target).closest($(commentSection)).length) $(commentSection).hide(); $(".the-content p .inline-comments-highlight-text").contents().unwrap(); }); ` the .unwrap(); happens even clicking inside the container?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29721201

http://stackoverflow.com/a/29810802
has body: If $.post() is working even with the Access-Control-Allow-Origin error, the culprit is likely to be the type of data that is being sent. According to the MDN article on CORS, a simple cross site request with POST requires the content-type of the data to be either application/x-www-form-urlencoded, multipart/form-data, or text/plain. Currently, your XMLHttpRequest() sends JSON with a content-type of text/html. Let's fix that. Knowing this, below is what you can try by setting the content-type request header to be application/x-www-form-urlencoded and sending encoded data. --EDIT-- Changed my previous xhr.send(encodeURIComponent(JSON.stringify(gformData))); to Barmar's solution with my own twist to avoid the use of an array. var gformUrl = 'https://docs.google.com/forms/d/abcdefg1234567890/formResponse'; var gformData = { 'entry.1405357202': 'text #1', 'entry.2112718259': 'text #2', 'entry.1657451952': 'text #3', 'entry.737451165': 'text #4' }; var xhr = new XMLHttpRequest(); xhr.open('POST', gformUrl, true); xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded; charset=UTF-8'); var formData = ''; for (var key in gformData) { formData += encodeURIComponent(key) + '=' + encodeURIComponent(gformData[key]) + '&amp;'; } xhr.send(formData.substr(0, formData.length-1));
answers question: http://stackoverflow.com/q/29810100
accepted answer of: http://stackoverflow.com/q/29810100
has comment: http://stackoverflow.com/comment/47770934
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/comment/47663904
has text: Can you show your html, at least the elements with .itemCount class?
comment on: http://stackoverflow.com/q/29766364
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47775827
score: 0
has text: @Nivin can you accept this as the accepted answer, if it was ? Thank you.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29822318

d3.js
tags question: http://stackoverflow.com/q/29782832
tags question: http://stackoverflow.com/q/29827378
tags question: http://stackoverflow.com/q/29724936
tags question: http://stackoverflow.com/q/29734397
tags question: http://stackoverflow.com/q/29708521
tags question: http://stackoverflow.com/q/29694070
tags question: http://stackoverflow.com/q/29725385
tags question: http://stackoverflow.com/q/29704388
tags question: http://stackoverflow.com/q/29728037
tags question: http://stackoverflow.com/q/29716607
tags question: http://stackoverflow.com/q/29710839
tags question: http://stackoverflow.com/q/29807102
tags question: http://stackoverflow.com/q/29796894
tags question: http://stackoverflow.com/q/29821233
tags question: http://stackoverflow.com/q/29705499
tags question: http://stackoverflow.com/q/29734467
tags question: http://stackoverflow.com/q/29792646
tags question: http://stackoverflow.com/q/29831390
tags question: http://stackoverflow.com/q/29741416
tags question: http://stackoverflow.com/q/29812837
tags question: http://stackoverflow.com/q/29784294
tags question: http://stackoverflow.com/q/29704936
tags question: http://stackoverflow.com/q/29725205
tags question: http://stackoverflow.com/q/29801562
tags question: http://stackoverflow.com/q/29747474
tags question: http://stackoverflow.com/q/29787205
tags question: http://stackoverflow.com/q/29734852
tags question: http://stackoverflow.com/q/29815149
tags question: http://stackoverflow.com/q/29824385
tags question: http://stackoverflow.com/q/29828727
tags question: http://stackoverflow.com/q/29736026
tags question: http://stackoverflow.com/q/29805098
type: Tag
tags question: http://stackoverflow.com/q/29828408
tags question: http://stackoverflow.com/q/29719477
tags question: http://stackoverflow.com/q/29727668
tags question: http://stackoverflow.com/q/29802994
tags question: http://stackoverflow.com/q/29817787
tags question: http://stackoverflow.com/q/29773768
tags question: http://stackoverflow.com/q/29825508
tags question: http://stackoverflow.com/q/29689178
tags question: http://stackoverflow.com/q/29704104
tags question: http://stackoverflow.com/q/29817614
tags question: http://stackoverflow.com/q/29747373
tags question: http://stackoverflow.com/q/29723379
tags question: http://stackoverflow.com/q/29780779
tags question: http://stackoverflow.com/q/29736630
tags question: http://stackoverflow.com/q/29835408
tags question: http://stackoverflow.com/q/29812287
tags question: http://stackoverflow.com/q/29703231
tags question: http://stackoverflow.com/q/29809065
tags question: http://stackoverflow.com/q/29715082
tags question: http://stackoverflow.com/q/29774848
tags question: http://stackoverflow.com/q/29755271
tags question: http://stackoverflow.com/q/29803962
tags question: http://stackoverflow.com/q/29840214
tags question: http://stackoverflow.com/q/29745819
tag name: d3.js
tags question: http://stackoverflow.com/q/29828782
tags question: http://stackoverflow.com/q/29746472
tags question: http://stackoverflow.com/q/29840281
tags question: http://stackoverflow.com/q/29759171
tags question: http://stackoverflow.com/q/29799253
tags question: http://stackoverflow.com/q/29798182
tags question: http://stackoverflow.com/q/29702838
tags question: http://stackoverflow.com/q/29693945
tags question: http://stackoverflow.com/q/29745730
tags question: http://stackoverflow.com/q/29730592
tags question: http://stackoverflow.com/q/29832994
tags question: http://stackoverflow.com/q/29708487
tags question: http://stackoverflow.com/q/29707458
tags question: http://stackoverflow.com/q/29725377
tags question: http://stackoverflow.com/q/29701689
tags question: http://stackoverflow.com/q/29785238
tags question: http://stackoverflow.com/q/29808417
tags question: http://stackoverflow.com/q/29712540
tags question: http://stackoverflow.com/q/29805832
tags question: http://stackoverflow.com/q/29711219
tags question: http://stackoverflow.com/q/29739610
tags question: http://stackoverflow.com/q/29786154

http://stackoverflow.com/comment/47798296
comment on: http://stackoverflow.com/a/29835754
type: AnswerComment
has text: How do you know what his `getCookie` function returns?
type: Comment
score: 1

file
type: Tag
tags question: http://stackoverflow.com/q/29702758
tags question: http://stackoverflow.com/q/29776426
tags question: http://stackoverflow.com/q/29713343
tag name: file
tags question: http://stackoverflow.com/q/29699379

http://stackoverflow.com/comment/47808763
score: 0
type: Comment
type: QuestionComment
has text: @Mischievous I have tried that `$image.cropper('getCroppedCanvas', {width: 650,height: 481});` for tablet but its not working
comment on: http://stackoverflow.com/q/29839942

http://stackoverflow.com/q/29705951
has comment: http://stackoverflow.com/comment/130987027
tagged with: javascript
tagged with: dom-events
has body: In my Socket.Io / Node.Js / Express app - before I added chat room – I used to emit events like this for everyone (including the sender): io.emit('chat message', msg); Now I added rooms and try to do the same thing using socket.broadcast.to(socket.room).emit('chat message', msg); or socket.to(socket.room).emit('chat message', msg); but both only send the message to receivers, but not to the sender. What should I do so that this message also goes to the sender, who's in the chat room as well?
has title: Socket.IO - how to emit event to everybody in the room, including sender?
favorite count: 0
tagged with: socket.io-redis
tagged with: node.js
downvote count: 0
type: UnansweredQuestion
tagged with: socket.io
linked to: http://stackoverflow.com/q/25144517
has answer: http://stackoverflow.com/a/29706225
score: 7
has answer: http://stackoverflow.com/a/77827129
type: Question
answer count: 2
upvote count: 7

http://stackoverflow.com/comment/47761836
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29817390
type: Comment
has text: Where would you implement this? And what is tblVisible? Is it an object in the model?

http://stackoverflow.com/comment/47747115
score: 0
has text: you want to play with the `shadowBias`
comment on: http://stackoverflow.com/q/29808476
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29769606
has answer: http://stackoverflow.com/a/29772488
has comment: http://stackoverflow.com/comment/47674819
has body: I am using Leaflet to place a wms tileLayer to the map. The images in the tiles do not have a xyz coordinates. After loading the images I would like the images to be converted into a canvas. I tried several things. Adding the wms tileLayer to the map and on load running a script to create the canvas. However, of course, this runst the script way too much. Besides that, my map is fully loaded with the images in stead of only there where the wms layer is on the map. it looks a bit like this: this.currentPhoto = L.tileLayer.wms(geoURL), { layers: layerName, format: 'image/png', opacity: 1, styles: '', transparent: true, attribution: "", version: "2.0.0", srs: "EPSG:4326" }).addTo(map).bringToFront(); this.currentPhoto.on('tileload', function(e) { setCanvasTiles(e); }); setCanvasTiles: function(e) { var that = this; var url = e.url; var tiles = HKV.satPhotoView.currentPhoto._tiles; this.canvasTiles = new L.TileLayer.Canvas({ minZoom: 4, maxZoom: 14, attribution: '', tms: true, opacity: 0.8, noWrap: true, unloadInvisibleTiles: true, reuseTiles: false, transparent: true }); this.canvasTiles.drawTile = function(canvas, tilePoint, zoom) { that.drawCanvasTile(canvas, tilePoint, zoom, url); }; this.canvasTiles.addTo(this.mapInfo).bringToFront(); }, drawCanvasTile: function(canvas, tilePoint, zoom, url) { var that = this; var ctx = canvas.getContext("2d"); var img = new Image(); img.onload = function(){ var height = 256; var width = 256; ctx.drawImage(img,0,0); imageData = ctx.getImageData(0, 0, 256, 256); $(canvas).data("origImgData",imageData); //color the pixels of the canvas }; img.src = url; }, Like I said, this script runs to much, so I think it is best to build an object with the URL of the image and the tilePoints so I can match these to the tilePoints of the Canvas TileLayer. Is there anybody out there who did this before, or can help me out? I am using Backbone, require and jquery next to leaflet
type: AnsweredQuestion
tagged with: leaflet
has comment: http://stackoverflow.com/comment/47673251
accepted answer: http://stackoverflow.com/a/29772488
tagged with: javascript
type: Question
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47672373
tagged with: jquery
has title: How to convert WMS TileLayer to Canvas TileLayer
tagged with: backbone.js

http://stackoverflow.com/a/29804387
has body: Your best bet is to use a service or a factory you can find more information on them and the differences here: when to use a service instead of a factory
score: 0
upvote count: 1
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/29804181

http://stackoverflow.com/a/29835754
type: Answer
has comment: http://stackoverflow.com/comment/47798296
answers question: http://stackoverflow.com/q/29835679
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47798609
has comment: http://stackoverflow.com/comment/47798600
has body: It looks like your getCookie method returns null if the cookie isn't found. In JS null and "" are not the same thing. You should check if(src !=== null). Depending on your getCookie function, you may have to check for null, undefined, and/or "".
score: 0
has comment: http://stackoverflow.com/comment/47798701

http://stackoverflow.com/q/29834509
tagged with: htmlunit
answer count: 1
has answer: http://stackoverflow.com/a/29835684
has comment: http://stackoverflow.com/comment/47826796
has title: How htmlUnit deal with unperfected javascript?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29835684
type: Question
has comment: http://stackoverflow.com/comment/47796634
tagged with: javascript
has body: I know when we use HTMLUnit, they want exactly perfect javascript running on its Web client. But how do we handle when javascript code like document.createNodeIterator(root,NodeFilter.SHOW_ALL,null,false); It complains "Cannot find function createNodeIterator in object" which on document.createNodeIterator works fine on browser. Here is stack trace: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function createNodeIterator in object [object HTMLDocument]. (https://cdn01.icims.com/platform_14.2.150421.78248/erac.icims.com/icims2/servlet/icims2?module=AppInert&amp;action=bundleJavascript&amp;scripts=%2Fportal%2Fjquery-1.8.0.js%2C%2Flib%2Fdomreplacement%2FdomReplacement.js%2C%2Fcommon%2Ficims.js%2C%2Fportal%2Futils.js%2C%2Fportal%2FshowMoreTextAbstract.js%2C%2Fportal%2Ffield.js%2C%2Fportal%2Flogin.js%2C%2Ffield%2Fvalidate.js%2C%2Fcommon%2FicimsTrickle.js%2C%2Fcommon%2FicimsDropdown.js%2C&amp;a=1429647520000#21) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:705) [htmlunit-2.15.jar:2.15] at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) [htmlunit-core-js-2.15.jar:na] at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) [htmlunit-core-js-2.15.jar:na] at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:637) [htmlunit-2.15.jar:2.15] at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:612) [htmlunit-2.15.jar:2.15] at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:1001) [htmlunit-2.15.jar:2.15] at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:179) [htmlunit-2.15.jar:2.15] at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:239) [htmlunit-2.15.jar:2…
score: 0

http://stackoverflow.com/a/29790036
type: Answer
has body: You can use select event and eventRender A callback that will fire after a selection is made. Then you can use unselect method to programmatically clearing the current selection. Code example select: function (start, endDate) { var minDate = moment(); if (minDate &gt;= endDate) { $("#calendar").fullCalendar('unselect'); return; } }, eventRender: function (event, element) { var minDate = moment(); if (minDate &gt;= event.end) { $(element).addClass('fc-state-disabled'); return; } }
accepted answer of: http://stackoverflow.com/q/29789854
score: 0
answers question: http://stackoverflow.com/q/29789854
has comment: http://stackoverflow.com/comment/47710071
has comment: http://stackoverflow.com/comment/47713293
type: AcceptedAnswer

http://stackoverflow.com/comment/47761560
comment on: http://stackoverflow.com/a/29815930
has text: @jackrose Ah, sorry, I removed that when testing and forgot to put it back, edited above
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/120377103
has text: In 2015, `var that = this;` was a [common way around losing the `this` context](https://stackoverflow.com/q/20279484/1218980) within callback functions.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/67663491

http://stackoverflow.com/comment/47699532
type: Comment
has text: @EricH You and I are on the same page. I'm going to hold off on any more comments until the OP chimes in.
score: 1
comment on: http://stackoverflow.com/a/29784416
type: AnswerComment

http://stackoverflow.com/q/29691166
tagged with: polymer
has comment: http://stackoverflow.com/comment/47519092
downvote count: 0
has answer: http://stackoverflow.com/a/29692915
linked to: http://stackoverflow.com/q/28374352
tagged with: javascript
linked to: http://stackoverflow.com/q/29629492
linked to: http://stackoverflow.com/q/20982489
possible better answer: http://stackoverflow.com/a/29701457
has body: I'm converting Sample Polymer Tutorial App to Dart.Polymer. The app tutorial is here [https://www.polymer-project.org/0.5/docs/start/tutorial/intro.html] The problem I'm facing is with paper-tabs event listening. The js version of Polymer is: All Favorites This is index file. My Dart version looks something like this: All Favorites How do I listen to paper-tabs core-select event to update my tab content in Dart under script tag? I tried this but didn't work. var tabs = document.querySelector('paper-tabs'); var list = document.querySelector('post-list'); tabs.addEventListener('core-select', (e) { list.show = tabs.selected; });
has title: Polymer.Dart Event Listening
tagged with: dart
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29701457
tagged with: events
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29692915
type: Question
answer count: 2
upvote count: 1
linked to: http://stackoverflow.com/q/13897091
has comment: http://stackoverflow.com/comment/47521440
tagged with: dart-polymer

instagram-api
tags question: http://stackoverflow.com/q/29818457
type: Tag
tag name: instagram-api

http://stackoverflow.com/a/29790808
type: Answer
answers question: http://stackoverflow.com/q/29790765
score: 1
upvote count: 1
has body: In javascript, January is represented by 0, December by 11. You need to add 1 to the value returned by getMonth. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMonth
downvote count: 0

http://stackoverflow.com/q/29756635
has comment: http://stackoverflow.com/comment/47645504
type: UnansweredQuestion
upvote count: 1
downvote count: 1
type: Question
tagged with: http://stackoverflow.com/tag/json
has title: Highcharts not Drawing point on setInterval
tagged with: highcharts
answer count: 1
has body: I have data being put on an api every 30 seconds on a backend. On the frontend I am using highcharts to visualize the data and a setInterval setup to retrieve the new data every 30 seconds. My problem is that on that setInterval, the line graph disappears or does not draw to the next new dot. Does anyone now why this is? fiddle: http://jsfiddle.net/b8tf281n/3/ code: chart1 = { yAxisMin: 40, yAxisMax: 100 }; // empty objects for our data and to create chart seriesData = []; BPM = []; time1 = []; // console.log(chart1.data.series); $(function () { $(document).ready(function () { Highcharts.setOptions({ global: { useUTC: false } }); var url = 'http://msbandhealth.azurewebsites.net/odata/PulsesAPI/'; $.ajax({ url: url, dataType: 'json', context: seriesData, success: function (data) { // structure our data for (var i = 0; i &lt; data.value.length; i++) { bpm = data.value[i].BPM; time = data.value[i].Time; BPM.push({ x: moment(time), y: bpm }); // console.log(BPM); time1.push(time); } console.log((new Date).getTime()); console.log(moment(time, "DD.MM.YYYY hh:mm:ss")); console.log(BPM); console.log(BPM[BPM.length - 1]); // console.log(seriesData); // set our data series and create new chart chart1.data.series[0].data = BPM; chart = new Highcharts.Chart(chart1.data); $('#container').css({ height: '400px' }); // console.log(sortedBPM); // console.log(time1); } }); // give highcharts something to render to var container = document.getElementById("container"); chart1.data = { chart: { renderTo: container, type: 'spline', animation: Highcharts.svg, // don't animate in old IE marginRight: 10, events: { load: function () { setInterval(function () { // find last data points var test = BPM[BPM.length - 1]; var x = (new Date).getTime(), y = test.y; console.log(x); shift = chart.series[0].data.length &lt; 30; chart.series[0].addPoint([x, y], true, true); }, 30000); } } }, title: { text: 'Microsoft Band: Real Time Pulse Analysis' }, xAxis: { type: 'datetime', tickPixelInterval: 150, d…
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47645671
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/29767578
has comment: http://stackoverflow.com/comment/47645915
has comment: http://stackoverflow.com/comment/47645862

http://stackoverflow.com/q/29808511
score: 1
type: Question
tagged with: case
has comment: http://stackoverflow.com/comment/47745465
tagged with: javascript
tagged with: prototype
has comment: http://stackoverflow.com/comment/47746368
accepted answer: http://stackoverflow.com/a/29808763
has body: I am having some issues with a class project. Every thing was working fine and dandy up until the current part we are on. Basically, we had to add prototypes and cases to move to each location. Now my code will not work, and the teacher is about as helpful as a pet rock. I have two parts to my code, the html (which has part of the code including items and such) and the .js file that includes the locations. I have created a repository on Github so it is easily accessible to all who want to help. At this point it is too late to submit to my professor, but I am curious on what I did wrong. https://github.com/EmeraldX/Project-Help/tree/master The main and directions.js are the files that I am currently working with. Thanks! Update: Okay, so it's still not working, and when I use Chrome's console it just tells me that: function updateDisplay( message ) { var textArea = document.getElementById("introduction"); textArea.value = message + "\n\n" + textArea.value; Cannot read property 'value' of null
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/47745495
has title: Why are my locations undefined and display not updating?
favorite count: 0
has answer: http://stackoverflow.com/a/29808763
has comment: http://stackoverflow.com/comment/47746096
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47745559
has comment: http://stackoverflow.com/comment/47746263
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/47719428
has text: Can you provide sample JSON and a code snippet (a [Minimal, Complete, Tested and Readable example](http://stackoverflow.com/help/mcve)) that works (or at least demonstrates the issue) without javascript errors
type: Comment
comment on: http://stackoverflow.com/q/29795320
score: 0
type: QuestionComment

http://stackoverflow.com/a/29737075
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29733445
has body: I was able to find the create a mesh with many vertices by decreasing the maximum edge length parameter passed to THREE.TessellateModifier and increasing the number of applications. I didn't need the subdivision modifier afterall. Final code is below: var tessellateModifier = new THREE.TessellateModifier(.01); //subdivisionModifier.modify(polyGeometry); // Apply the modifier to our cloned geometry. for(var x=0; x&lt;25; x++) { tessellateModifier.modify(polyGeometry); } Additionally, there's not need to resort to a vertex shader to distort the mesh. Using the setLength() function of each vertex lets you displace them to create a curved polygon that is just above the surface of the globe. //push each vertex to just above the surface of the globe for(var i = 0; i &lt; this.polyMesh.geometry.vertices.length; i++){ this.polyMesh.geometry.vertices[i] = this.polyMesh.geometry.vertices[i].setLength(this.surfaceDisplacement); }
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/29733445

http://stackoverflow.com/comment/47657765
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29763020
has text: This means all the ruby methods with a constant values can be called but we can't process a dynamic value with a ruby function. right!
type: AnswerComment

http://stackoverflow.com/comment/47818881
score: 0
type: AnswerComment
has text: It looks like there is a confusion with the meaning of `index`. Index is the integer number of times you have to `skip` when starting from `initial`. The closest point you get is not `index` is `start + index * skip` (aindex in my notation.)
type: Comment
comment on: http://stackoverflow.com/a/29837508

http://stackoverflow.com/comment/48001536
comment on: http://stackoverflow.com/a/29848183
score: 0
type: Comment
has text: I'm not able to get anything from confirmation page, However, it's working on rest of pages. I'm trying it on live site with domain name as site name.
type: AnswerComment

http://stackoverflow.com/q/29839755
tagged with: meteor
has body: I have all my image files served from a different domain, and I put that host name as a variable into Meteor.settings. Then, how can I access this variable within a Meteor template? For example, in this template, what's the best practice to replace img.example.com with a variable defined in Meteor.settings or some other global variables? I don't think it's a good idea to pass it to every template by using helpers. &lt;template name="products"&gt; {{#each items}} &lt;img src="http://img.example.com/{{id}}.png"&gt; {{/each}} &lt;/template&gt;
favorite count: 0
answer count: 5
has answer: http://stackoverflow.com/a/29841491
score: 6
has answer: http://stackoverflow.com/a/29845874
upvote count: 6
type: AnsweredQuestion
tagged with: spacebars
has answer: http://stackoverflow.com/a/42120884
type: Question
possible better answer: http://stackoverflow.com/a/29839864
accepted answer: http://stackoverflow.com/a/29841491
has answer: http://stackoverflow.com/a/29839864
has answer: http://stackoverflow.com/a/47810314
downvote count: 0
tagged with: javascript
has title: How to access global variables in Meteor template without using a helper?

http://stackoverflow.com/q/29746473
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29746697
tagged with: javascript
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/29746709
has title: if code returns an error do not run query
tagged with: stripe-payments
has answer: http://stackoverflow.com/a/29746697
tagged with: mysqli
tagged with: php
has answer: http://stackoverflow.com/a/29746709
has body: I have the following code: <?php require_once('./config.php'); include("includes/db.php"); $token = $_POST["token"]; $userId = $_POST["userId"]; $email = $_POST["userEmail"]; $courseProvider = $_POST["courseProvider"]; $amount = $_POST["priceFinal"]; $courseTitle = $_POST["courseTitle"]; $amount = $amount * 100; $customer = \Stripe\Customer::create(array( 'email' => $email, 'card' => $token )); $charge = \Stripe\Charge::create(array( 'customer' => $customer->id, 'amount' => $amount, 'currency' => 'cad' )); $amountDisplay = $amount / 100; $course_paid = "Yes"; $course_paid_date = date("Y-m-d"); $insert_c = "insert into order_complete (course_title, course_price, course_buyer, course_provider, course_paid_date) values ('$courseTitle','$amount','$email','$courseProvider','$course_paid_date')"; $run_c = mysqli_query($con, $insert_c); $insert_c2 = "Update orders SET course_paid = '$course_paid' where course_id = '$userId'"; $run_c2 = mysqli_query($con, $insert_c2); echo " Successfully charged $$amountDisplay to $email "; ?> where I would only want the queries to be executed if the following runs succesfully (no errors is returned) $charge = \Stripe\Charge::create(array( 'customer' => $customer->id, 'amount' => $amount, 'currency' => 'cad' )); The reason for that is that I do not want to record in the database that the payment was successful when stripe was not able to finalize the transaction before of a error.
tagged with: mysql
type: Question

http://stackoverflow.com/q/29827169
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47780683
tagged with: javascript
tagged with: jquery
has body: I have an array of functions that return jQuery deferred AJAX objects called phoneAjaxCalls. My code pushes multiple calls to a function called newPhone that accepts two arguments. function newPhone(tlcPhone, studentsdcid) { //Create new email return $j.ajax({ type: 'POST', url: '/admin/changesrecorded.white.html', data: tlcPhone }); } I try to add calls to newPhone to phoneAjaxCalls with this code, phoneAjaxCalls.push(newPhone(tlcPhone, stagingFormPhone.studentsdcid)); Then later in my code, I use $.when.apply($j, phoneAjaxCalls).done(function () { //all phoneAjaxCalls MUST be complete before this code runs //Redirect to a different page by changing window.location }); to resolve the array of jQuery deferreds. By using breakpoints in DevTools, I have found that instead of calling newPhone when $.when is called, but when .push is called. How can I add calls to newPhone to the phoneAjaxCalls array without it being called immediately? The bug I'm seeing is that the page is getting redirected before all of the calls in phoneAjaxCalls can be completed. If you'd like to see my entire codebase, it can be seen here. It's horribly messy, since it was a rushed project. Any other feedback is welcome as well, here or on Github. The file in question can be found here.
favorite count: 0
tagged with: ajax
tagged with: promise
has comment: http://stackoverflow.com/comment/47781115
has answer: http://stackoverflow.com/a/29827182
has comment: http://stackoverflow.com/comment/47786371
has comment: http://stackoverflow.com/comment/47781288
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47781293
has comment: http://stackoverflow.com/comment/47780828
has comment: http://stackoverflow.com/comment/47782395
has comment: http://stackoverflow.com/comment/47781139
has comment: http://stackoverflow.com/comment/47782592
has comment: http://stackoverflow.com/comment/47781147
has comment: http://stackoverflow.com/comment/47781896
upvote count: 1
has comment: http://stackoverflow.com/comment/47781846
type: Question
has comment: http://stackoverflow.com/comment/47781200
has title: How can I add this function to an array without it being called immediately?
has comment: http://stackoverflow.com/comment/47781439
score: 1
has comment: http://stackoverflow.com/comment/47782488
has comment: http://stackoverflow.com/comment/47781005

http://stackoverflow.com/a/29790952
type: Answer
answers question: http://stackoverflow.com/q/29764873
score: 0
has body: I think you want something like this. You can specify the other parameter as {} in the key. So that the key becomes ["user1", {}] or [{}, "user1"]. You can use the start key, endkey concept of couchdb for your case.

http://stackoverflow.com/comment/47592700
type: Comment
has text: The Map function works on an object "data". It iterates over the object and returns the new format like illustrated above. You have to be careful and use promises or callbacks. Node is an asynchronous language so operation moves on. Make sure your nesting is correct or you use something like bluebird
comment on: http://stackoverflow.com/a/29729443
type: AnswerComment
score: 0

http://stackoverflow.com/q/29729674
answer count: 1
has body: Here is an example of using getContent to display Dojo tooltip based on the element the mouse hovers over: require(["dijit/Tooltip", "dojo/query!css2", "dojo/domReady!"], function(Tooltip){ new Tooltip({ connectId: "myTable", selector: "tr", getContent: function(matchedNode){ return matchedNode.getAttribute("tooltipText"); // What if we want to load this asynchronously??? } }); }); However this doesn't work if you try to load data asynchronously via getContent(). Does anyonw knows how this can be solved?
tagged with: dojo
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29743537
type: Question
has title: Loading data asynchronously to Dojo Tooltip's getContent()
tagged with: tooltip
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29743537

http://stackoverflow.com/q/29751397
tagged with: regex
upvote count: 6
possible better answer: http://stackoverflow.com/a/29751480
has comment: http://stackoverflow.com/comment/47635198
has comment: http://stackoverflow.com/comment/47634969
has answer: http://stackoverflow.com/a/29751480
accepted answer: http://stackoverflow.com/a/29751543
tagged with: non-ascii-characters
score: 5
tagged with: utf
downvote count: 1
has title: JavaScript - match non-ascii symbols using regex
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47635206
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47635666
has answer: http://stackoverflow.com/a/29751543
has body: I want to match all mentioned users in comment. Example: var comment = '@Agneš, @Petar, please take a look at this'; var mentionedUsers = comment.match(/@\w+/g); console.log(mentionedUsers) I'm expecting ["@Agneš", "@Petar"] but getting ["@Agne", "@Petar"]. As you can see š symbol is not matched. How can I match all letter symbols include non-ascii?
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47635041

http://stackoverflow.com/a/29822000
accepted answer of: http://stackoverflow.com/q/29821903
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47774588
downvote count: 0
has body: Hi innerHTML is a javascript or percisesly DOM property not jquery. you can use innerHTML when you do below document.getElementById('contract_details'); So when you are using jquery we should use Jquery methods. For your case you can use html or text method. So just give a try to below code instead of using $('#contract_details').innerHTMLlb = 'abc'; what possibly will work for you is $('#contract_details').text('new text'); $('#contract_details').html('new text'); with jquery only jquery methods with work?? Yes.. Actually its important to know what you get in return when you select the DOM element using JQuery and Javascript.. $('#contract_details').innerHTML; will always give you undefined value. And document.getElementById('contract_details'); will give you DOM object with property of innerHTML.. Also a small magic which should not be used is $('#contract_details')[0].innerHTML == document.getElementById('contract_details').innerHTML return true ..
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47777624
has comment: http://stackoverflow.com/comment/47774666
answers question: http://stackoverflow.com/q/29821903

http://stackoverflow.com/a/29718458
score: 0
answers question: http://stackoverflow.com/q/29713939
type: Answer
has body: First of all dataModel is a string. Since you defined multiple the model would be an array. What's more important is that the uiSelectdirective creates a new scope. That means that ng-model="ngModel" does no longer point to dataModel. You effectively destroy the binding. In your controller make dataModel an object: $scope.dataModel = {}; In your directive let the selected values be bound to a property: return '&lt;ui-select multiple ng-model="ngModel.selection" Now the the selected values will be bound to dataModel.selection. If you don't use the ngModelController you shouldn't use ng-model with your directive.

http://stackoverflow.com/q/29795409
tagged with: javascript
has answer: http://stackoverflow.com/a/29795869
answer count: 2
has title: Angular-Chart not rendering anything
has comment: http://stackoverflow.com/comment/47719383
has body: I'm building an app using AngularJS. In this app I want to show a line-chart with some data. I got a page with two 'tabs'. I used my own implementation for this: Two buttons at the top, $scope.graph.visible boolean which is being set by clicking those buttons. This is the chart in the HTML: In the controller I got this: $scope.graph.data = [1, 2, 3, 4, 5, 6, 7, 8]; $scope.graph.labels = ['hoi', 'doei', 'hallo', 'hee', 'hoi', 'doei', 'hallo', 'hee',]; $scope.graph.options = { animation: false }; $scope.graph.legend = true; In the source of the page I see this (when the graph should be visible): EDIT// I wonder why it has the class ng-hide EDIT2// When I manually remove the ng-hide class I can see a white block with web inspector. Otherwise I can''t even find that. EDIT3// Also, when I add class="" in the HTML-file, it doesn't remove the ng-hide class. EDIT4// http://plnkr.co/edit/2Wr3HvMzcwfQG2tmsJgX?p=preview
has comment: http://stackoverflow.com/comment/47721336
downvote count: 0
has comment: http://stackoverflow.com/comment/47732659
score: 8
favorite count: 0
tagged with: angularjs
upvote count: 8
has comment: http://stackoverflow.com/comment/47719650
accepted answer: http://stackoverflow.com/a/29795869
has comment: http://stackoverflow.com/comment/47721221
has answer: http://stackoverflow.com/a/53361017
type: AnsweredQuestion
tagged with: chart.js
has comment: http://stackoverflow.com/comment/47772050
has comment: http://stackoverflow.com/comment/47720339
possible better answer: http://stackoverflow.com/a/53361017
type: Question
linked to: http://stackoverflow.com/q/29819173

http://stackoverflow.com/comment/47717284
has text: Ahh thank you! This really helped me with understanding anonymous functions. I was thinking about whether or not naming an anonymous function was correct earlier...thanks again!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29794487
type: AnswerComment

http://stackoverflow.com/a/70484806
type: Answer
answers question: http://stackoverflow.com/q/29752565
score: 0
has body: We did it with ReactJS(front) and ASP.Net core(back) So the best way to do it is using FormData, We use an object like below that contains an array of objects, each object includes an array of images too, { CommodityID:xxxxx, TotalWeight:xxxx, CostOfCommodity:xxxx, Prerequisites:[{ ProductId: xxxx, DeliveryWeight: xxxxx, ReleasedImagesUrl: [ multiple images file ] },{ ProductId: xxxx, DeliveryWeight: xxxxx, ReleasedImagesUrl: [ multiple images file ] }] } Actually, we send each item of the array separately like Prerequisites[0].DeliveryWeight and this is the point. please pay attention to the letters that in our case first characters of items were capital (this is important too) const formData = new FormData(); formData.append("CommodityID", this.state.commodityId); formData.append("TotalWeight", this.state.totalWeight); formData.append("CostOfCommodity",this.state.costOfCommodity); for (let i = 0; i < this.state.prerequisitesListTemp.length; i++) { formData.append( `Prerequisites[${i}].ProductId`, this.state.prerequisitesListTemp[i].productId ); formData.append( `Prerequisites[${i}].DeliveryWeight`, this.state.prerequisitesListTemp[i].deliveryWeight ); for ( let j = 0;j < this.state.prerequisitesListTemp[i].releasedImagesUrl.length;j++ ) { formData.append( `Prerequisites[${i}].ReleasedImagesUrl`, this.state.prerequisitesListTemp[i].releasedImagesUrl[j] ); } }

http://stackoverflow.com/comment/47686491
comment on: http://stackoverflow.com/q/29777915
has text: @brouxhaha I use selectize's textbox functionality elsewhere (for other elements) so alas switching out from selectize (and having two select replacements) isn't practical.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47637844
comment on: http://stackoverflow.com/q/29752565
type: Comment
type: QuestionComment
has text: You can send images and text and anything else in one ajax request, as long as it's sent as a [***formData***](https://developer.mozilla.org/en-US/docs/Web/Guide/Using_FormData_Objects) object !
score: 0

http://stackoverflow.com/comment/58251669
type: Comment
comment on: http://stackoverflow.com/a/29798770
has text: Thank you for this very concise and well-written answer, particularly the point about optimisation.
score: 1
type: AnswerComment

http://stackoverflow.com/comment/47765148
has text: Not arguing with that (I prefer using window as well), just discussing in general (getting 'warned' to not do so in the comments though, lol). Would be better if OP clarified his expectations.
type: Comment
comment on: http://stackoverflow.com/a/29816933
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47650849
has text: Was it just the spelling mistake on AcceptRules then?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29759268

http://stackoverflow.com/q/29720665
type: UnansweredQuestion
has body: For my website, I'm creating an array that randomly displays an image and associated text each time. I've gotten the array to work, but the first line of text starts on the bottom right corner or the image. How do I get the image to flush left and the text to start on the top with the image? var r_text = new Array (); r_text[0] = "Adrian's online program is totally unique and his approach is founded on the principle that your career should really just be another way to express yourself. I am deeply grateful to have found a more fitting career in brand management and I hope to start a business down the road. Matt, San Francisco"; r_text[1] = "I can tell you that after 3+ months using this career pathfinding program that my career outlook has never been better! I am currently going through a complete career change that I would have never dreamed about before I started this program. Conrad, San Francisco"; var random_img = new Array(); random_img[0] = ' '; random_img[1] = ' '; var total_testimonials = 2; var random_number = Math.floor((Math.random()*total_testimonials)); document.write(random_img[random_number]); document.write(r_text[random_number]);
has title: Javascript image and text arrays formatting
has comment: http://stackoverflow.com/comment/47575889
has answer: http://stackoverflow.com/a/29720890
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47575940
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47575955
downvote count: 0
has comment: http://stackoverflow.com/comment/47575884
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/47748359
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29797589
score: 0
has text: The goal is exactly as stated: "access the raw JSX, modify it to return something else, then transpile so the changes could be seen?" That is the end goal.

http://stackoverflow.com/a/29751654
answers question: http://stackoverflow.com/q/29751502
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47635663
score: 1
has body: You should read up on Media Queries. Media Queries are used to "activate" or "deactivate" CSS Rules. You are trying to create different div sizes, but your CSS rules are not all "activating." https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries The CSS below should accomplish what you are trying to do. CSS: img { max-width:100%; } .box1 { width: 480px; padding-bottom: 10%; } .box2 { width: 650px; padding-bottom: 10%; } .box3 { width: 1050px; padding-bottom: 10%; } .box4 { width: 1290px; padding-bottom: 10%; } DEMO: http://jsfiddle.net/p5nxox41/3/
has comment: http://stackoverflow.com/comment/47635725
downvote count: 0

http://stackoverflow.com/a/29842091
answers question: http://stackoverflow.com/q/29841867
has body: str_replace doesn't work with regular expression. While preg_match find the regex '/background-color:blue;/' in the file, you should pass to str_replace only the string background-color:blue; or use preg_replace &lt;?php $fichier='texte.css'; $backgroundcolor='background-color:yellow;'; $background='/background-color:blue;/'; $text=fopen($fichier,'r+') or die("File missing"); $contenu=file_get_contents($fichier); $lines = file($fichier); foreach ($lines as $lineNumber =&gt; $lineContent) { echo ("$lineNumber $lineContent&lt;br/&gt;"); contenuMod = preg_replace(background , backgroundcolor, $lineContent); fwrite($text,$contenuMod); } fclose($text); ?&gt;
has comment: http://stackoverflow.com/comment/47810392
has comment: http://stackoverflow.com/comment/47810721
score: 0
type: Answer

http://stackoverflow.com/a/29750525
has comment: http://stackoverflow.com/comment/47644960
has comment: http://stackoverflow.com/comment/47644686
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/47643745
score: 2
has comment: http://stackoverflow.com/comment/47640087
has body: Just include it in the URL of the API call: https://gdata.youtube.com/feeds/api/users/albpower2/events?key=YOUR_API_KEY From the docs.
answers question: http://stackoverflow.com/q/29748961
downvote count: 0

http://stackoverflow.com/comment/47781787
type: Comment
score: 1
has text: That won't help me learn how this works though....
comment on: http://stackoverflow.com/q/29827443
type: QuestionComment

http://stackoverflow.com/q/29766654
favorite count: 0
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
tagged with: rickshaw
has comment: http://stackoverflow.com/comment/48128894
score: 2
downvote count: 0
has title: Rickshaw realtime chart in AngularJS becomes unresponsive after a few seconds of running
type: Question
upvote count: 2
tagged with: javascript
has body: I update the random values to simulate a realtime chart, using an $interval. After a few seconds the screen gets unresponsive. Here's my code. I'm using angular-rickshaw directive from https://github.com/ngyewch/angular-rickshaw var seriesData = [ [], [], [] ]; var random = new Rickshaw.Fixtures.RandomData(50); for (var i = 0; i &lt; 50; i++) { random.addData(seriesData); } $scope.rickshaw_realtime_options = { renderer: 'area', height: 500, padding: { top: 0.5 } }; $scope.rickshaw_realtime_series = [{ data: seriesData[0], color: 'red', name: 'DB Server' }, { data: seriesData[1], color: 'blue', name: 'Web Server' }]; $scope.rickshaw_realtime_features = { yAxis: { orientation: 'right', tickFormat: Rickshaw.Fixtures.Number.formatKMBT, }, hover: true, } // Update the graph with realtime data. var timer = $interval(function() { random.removeData(seriesData); random.addData(seriesData); }, 1000); $scope.$on('$destroy', function() { if (angular.isDefined(timer)) { $interval.cancel(timer); timer = undefined; } });

http://stackoverflow.com/comment/47593687
score: 0
type: Comment
has text: Great, I have one more issue, I should send data or values of variables using "POST" to every pages, that mean for every page I should send different values and variables name?
comment on: http://stackoverflow.com/a/29729970
type: AnswerComment

http://stackoverflow.com/a/29812373
has comment: http://stackoverflow.com/comment/47752973
has comment: http://stackoverflow.com/comment/47753379
type: Answer
has comment: http://stackoverflow.com/comment/47753009
downvote count: 0
answers question: http://stackoverflow.com/q/29812021
score: 1
has body: Proposed solution (alternative to DocumentFragment): you could search for the desired element with a loop. JSFiddle (look at Console output). The loop looks like this: var elem_obj_containers = elem_obj.children[0].children; // All &lt;div&gt;s with those “container-” IDs var container1_element=null; // The result or null for(var i=0;i&lt;=elem_obj_containers.length;i++){ if(elem_obj_containers[i].id=='container-1'){ // Checking for ID container1_element=elem_obj_containers[i]; // Assigning result console.log(elem_obj_containers[i]); // Verify result break; // Show’s over! } } So if the ID is found, the element is assigned to container1_element, otherwise the variable remains null (like the real document.getElementById). It should work all the way back to IE6 as of MDN’s page for children. IE 6, 7 and 8 just include HTML comment nodes in children as well. This shouldn’t be a big deal.
has comment: http://stackoverflow.com/comment/47753117
upvote count: 1
has comment: http://stackoverflow.com/comment/47752836

http://stackoverflow.com/q/29708227
downvote count: 1
type: AnsweredQuestion
tagged with: javascript
score: -1
type: Question
upvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/29708286
has title: Jquery getting all the matching current html data
tagged with: jquery
favorite count: 0
has body: In the below html 'return_fly26' is repeated 2 times. So i want the matching html with class 'return_fly26' ssss ssss 01 h : 30 m ssss ssss 01 h : 30 m Below is how i tried $(".onward_fly").html(""); var owner = $('.return_fly'+flight_id).html(); console.log(owner); If i console it i am getting one one div matching matching with .return_fly26. Can any one suggest this !!!!!! Expected output should be same as above using jquery. O/p: ssss ssss 01 h : 30 m ssss ssss 01 h : 30 m
accepted answer: http://stackoverflow.com/a/29708286

http://stackoverflow.com/a/29787729
upvote count: 2
answers question: http://stackoverflow.com/q/29787515
type: Answer
score: 2
downvote count: 0
has body: There are many ways to create infinite loops in Javascript. Here are some of them: 1.) You can simply say: while (true) { //your code } True is always going to be true. 2.) As long as another condition is true. (this may be helpful if you intend to terminate the loop at some point. var obj1 = {number:"1"}; while (obj1==obj1) { document.write( '1++'); } 3.) You can set a "timer" within a function: function loopFunction(){ setInterval(function () {loopFunction();}, 3000);}

http://stackoverflow.com/a/29841767
upvote count: 0
has comment: http://stackoverflow.com/comment/47815250
score: -1
downvote count: 1
answers question: http://stackoverflow.com/q/29841162
type: Answer
has body: focus your input if there isn't any val in your input after click the button $('#my-button').on('click', function() { var $input = $('input[type=email]'); if ($input.val()) { $form.valid(); } else { $input.focus(); } });

http://stackoverflow.com/q/29743724
type: AnsweredQuestion
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29743778
has comment: http://stackoverflow.com/comment/47620250
has title: Delete a textbox using jQuery
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/29743778
possible better answer: http://stackoverflow.com/a/29744199
has answer: http://stackoverflow.com/a/29744199
answer count: 2
upvote count: 0
tagged with: jquery
tagged with: textbox
has body: $(document).ready(function() { var textBoxCount = 0; $('body').append('&lt;input type="button" id="add" value="add"&gt;'); $('#add').click(function() { textBoxCount++; $('body').append('&lt;br&gt;&lt;input type="text" id="textBox-'+textBoxCount+'"&gt;&lt;input type="button" class="deleteTextBox" id="deleteTextBox-'+textBoxCount+'" value="x"&gt;'); }); $('.deleteTextBox').click(function() { $(this).prev().remove(); }); }); I don't get the TextBoxes deleted !
favorite count: 0
linked to: http://stackoverflow.com/q/29728254

http://stackoverflow.com/comment/47799348
score: 0
comment on: http://stackoverflow.com/a/29833827
type: Comment
has text: ok, well, thats because objects have no method 'push'... Either use an array instead or explictly set a key/value on the object: `config['user3624610'] = {name: 'bob', code: 'abc'}`
type: AnswerComment

http://stackoverflow.com/a/29879027
has comment: http://stackoverflow.com/comment/48543099
has body: There was a WebView update over the weekend and now the problem has disappeared for our two apps. dariosalvi may find that the charts are working fine now too. (A new feature of Android 5 is that the WebView is updated independently of the OS.)
upvote count: 1
has comment: http://stackoverflow.com/comment/47906594
has comment: http://stackoverflow.com/comment/48628547
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29754737
type: Answer

http://stackoverflow.com/q/29802912
has body: noob alert This is weird - trying to create a custom directive in AngularJS, when I write this code: myModule.directive('myTab', function(){ console.log('--Inside TAB directive--'); return { template: ' Hello World ' }; }); It throws the exception: TypeError: Cannot read property 'compile' of undefined However, this code runs fine: myModule.directive('myTab', function(){ console.log('--Inside TAB directive--'); return { template: ' Hello World ' }; }); The only difference is the opening curly brace is on the next line in the first code. Is this behaviour normal?
has comment: http://stackoverflow.com/comment/47734011
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29803002
has comment: http://stackoverflow.com/comment/47733926
linked to: http://stackoverflow.com/q/2846283
has comment: http://stackoverflow.com/comment/47733806
type: Question
has comment: http://stackoverflow.com/comment/47733953
tagged with: angularjs-directive
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29803002
score: 0
tagged with: syntax-error
answer count: 1
has title: Directive syntax error on enter/return
tagged with: angularjs

http://stackoverflow.com/q/29795031
favorite count: 0
tagged with: php
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29795418
upvote count: 3
accepted answer: http://stackoverflow.com/a/29795418
type: Question
has title: Grammar checker for html text area
has comment: http://stackoverflow.com/comment/129804663
tagged with: textarea
downvote count: 0
tagged with: javascript
has body: In my HTML and PHP code, I have a textarea in which I want to be able to see if the text has any spelling or grammar errors. I am ready to use Python or Javascript to make this possible too! Looking for help.
has comment: http://stackoverflow.com/comment/47718333
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: python

http://stackoverflow.com/comment/47696105
has text: Still not how `if` statements work, still using `“”` instead of `""`.
comment on: http://stackoverflow.com/a/29783033
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/q/29757869
type: UnansweredQuestion
tagged with: jquery-ui
tagged with: date
tagged with: jquery-ui-datepicker
has comment: http://stackoverflow.com/comment/47648066
type: Question
answer count: 3
has body: I am unable to set the current date in an input box in JS. I've tried the below code, but it still defaults just to "MM/DD/YYYY" as a placeholder. How can I set the date to the current date? HTML: Start Date: JavaScript: var currdate = new Date(); var currdate = (currdate.getMonth() + 1) + '/' + currdate.getDate() + '/' + currdate.getFullYear(); $('#dteStartDate').datetimepicker({dateFormat: 'mm-dd-yy'}) .datetimepicker("setDate", currdate);
tagged with: javascript
tagged with: jquery
score: 4
has comment: http://stackoverflow.com/comment/47648115
favorite count: 0
has answer: http://stackoverflow.com/a/29757967
linked to: http://stackoverflow.com/q/4802190
has answer: http://stackoverflow.com/a/29757968
has title: trying to get the today's date in a JS input boxc
upvote count: 4
has answer: http://stackoverflow.com/a/29758054
downvote count: 0

http://stackoverflow.com/q/29772609
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29776887
favorite count: 0
tagged with: angularjs
upvote count: 2
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47675905
type: Question
has comment: http://stackoverflow.com/comment/47675937
tagged with: javascript
tagged with: jquery
has body: I want to create a pop-up modal within my angular page. I found the code on this site, and it is working fine. However, I also have a button for http request on the same angular page, and after the http request preforms, the angularjs modal no longer works. I receive the following error in my conolse: GET http://localhost:8080/SampleApp/myModalContent.html 404 (Not Found)
has title: After $http request AngularJS bootstrap modal not working
score: 2

http://stackoverflow.com/a/29770413
has comment: http://stackoverflow.com/comment/47672991
has body: Take a look at the section on defining releationships in the guide http://guides.emberjs.com/v1.11.0/models/defining-models/ When you use DS.hasMany you need a corresponding DS.belongsTo on the other model. Another thing to watch out for would be making sure you either include all the corresponding user models in your organisation response payload, or mark the relationship with {async: true} so ember knows to retrieve those records separately if it needs them.
answers question: http://stackoverflow.com/q/29766025
has comment: http://stackoverflow.com/comment/47677379
has comment: http://stackoverflow.com/comment/47672851
has comment: http://stackoverflow.com/comment/47672611
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47671552
has comment: http://stackoverflow.com/comment/47671977
type: Answer
has comment: http://stackoverflow.com/comment/47672504
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47671683
has comment: http://stackoverflow.com/comment/47672553
accepted answer of: http://stackoverflow.com/q/29766025

http://stackoverflow.com/q/29841112
score: 0
accepted answer: http://stackoverflow.com/a/29841582
answer count: 1
has comment: http://stackoverflow.com/comment/47810237
tagged with: jsp
tagged with: ajax
has title: Dynamically pass value in jQuery.ajax() data attribute
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47808504
has answer: http://stackoverflow.com/a/29841582
type: Question
has body: I am making an AJAX call to subscribe a user and want to pass a value dynamically in data attribute. How do I do that? function submitFormWithAction(value, isSubscribedPortal) { //value and isSubscribedPortal is passed using jsp checkSelection(); brand = ${userDataBean.profileConfiguration.profileData.profileFields['AutomobileBrand']} if (value == 'subscribe') { document.browseForm.action = "subscription.wfv"; document.browseForm.method = "POST"; } else if (value == 'addProfile') { document.browseForm.action = "addProfile.wfv?isSendAlert=false"; document.browseForm.method = "POST"; } else if (value == 'editProfile') { document.browseForm.action = "saveProfile.wfv?isSendAlert=false"; document.browseForm.method = "POST"; } if (isSubscribedPortal) { $.ajax({ type: "POST", url: "saveViewData.wfv", beforeSend: function (xhr) { xhr.setRequestHeader('X-CSRF-Token', $('meta[name="_csrf"]').attr('content')); }, // viewData is a Map&lt;String,String&gt; in UserDataBean.java // brand will be set after form is submitted, so how can I dynamically pass brand data:"viewData[message]= Your Profile for" + brand + "has been saved", success: function (msg){ document.browseForm.submit(); }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("some error"); } }); } else { alert('Subscribing to portal'); $.when( $.ajax({ type: "POST", url: "subscription.wfv", beforeSend: function (xhr) { xhr.setRequestHeader('X-CSRF-Token', $('meta[name="_csrf"]').attr('content')); }, data: "nextView=dummy&amp;currentVertical=portal&amp;isSendAlert=false", }), $.ajax({ type: "POST", url: "saveViewData.wfv", beforeSend: function (xhr) { xhr.setRequestHeader('X-CSRF-Token', $('meta[name="_csrf"]').attr('content')); }, // data: "viewData[message]=Your Search Profile is saved", }) ).then(function (msg) { document.browseForm.submit(); }); } }
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29716807
tagged with: angularjs
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29719328
possible better answer: http://stackoverflow.com/a/29717091
upvote count: 3
has answer: http://stackoverflow.com/a/29717091
type: Question
has comment: http://stackoverflow.com/comment/47568586
has comment: http://stackoverflow.com/comment/47572765
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29719328
has answer: http://stackoverflow.com/a/29717249
answer count: 3
has comment: http://stackoverflow.com/comment/47568574
favorite count: 0
has title: When using the ngResource module, my model is not updating properly
has body: I have a small problem with Angular. I am using the $ngResource module to resolve "comments" from my server: var app = angular.module('app', ['ngResource']); app.factory('comment', function($resource) { return $resource('/comments'); }); app.controller('commentsController', function($scope, comment) { $scope.comments = comment.query(); }); I use the ngRepeat directive to show all comments: &lt;li ng-repeat="comment in comments"&gt; {{ comment.comment }} &lt;/li&gt; So far, so good. I want to make it so that, when a comment is submitted to the server, the $scope.comments property is updated, updating the view. I updated the commentsController $scope to have a method: submitComment which is invoked from an ngSubmit directive: app.controller('commentsController', function($scope, comment) { $scope.comments = comment.query(); $scope.submitComment = function() { var commentToSave = new comment(); angular.copy($scope.comment, commentToSave); commentToSave.$save(function() { $scope.comments.push(commentToSave); }); }; }); When this method is invoked, the "comment" is successfully sent to the server however, the view is not updated properly. Recall that my ngRepeat directive is defined on a li. When I submit a "comment", a new li is created (i.e. a new bullet point is rendered), but the body is empty. What am I doing wrong? Update: I noticed that, if I call $scope.comments.push(commentToSave); outside the $save callback, the view is updated correctly. I think commentToSave is being changed when I call $save, something like that anyway.

tdd
tags question: http://stackoverflow.com/q/29703353
type: Tag
tag name: tdd

http://stackoverflow.com/a/29787035
answers question: http://stackoverflow.com/q/29786671
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29786671
has comment: http://stackoverflow.com/comment/47741293
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/47741333
has body: Node processes POST data in chunks. Your function needs to receive the chunks of data and build a complete body. There are frameworks such as Express which will handle this for you, but the following is an example of how to do this yourself: router.post('/tasks/addTime', auth, function(req, res, next) { var body = &quot;&quot;; req.on('data', function (chunk) { body += chunk; }); req.on('end', function () { console.log('POSTed: ' + body); }); }); It is important to note, when listening for POST data, that the req object is also an Event Emitter. req, therefore, will emit a 'data' event whenever a chunk of incoming data is received; when there is no more incoming data, the 'end' event is emitted. So, in our case, we listen for 'data' events. Once all the data is recieved, we log the data to the console. Using Express, you should also have an extra object, req.params. req.params An object containing properties mapped to the named route “parameters”. For example, if you have the route /user/:name, then the “name” property is available as req.params.name. This object defaults to {}. You can also use req.body with the help of an Express middleware: req.body Contains key-value pairs of data submitted in the request body. By default, it is undefined, and is populated when you use body-parsing middleware such as body-parser and multer.

http://stackoverflow.com/a/29811285
type: Answer
has body: refreshToken: function (token, callback) { obj.decodeToken(token, function (err, decoded) { callback(err, obj.encodeToken()); }); }, you can refer your object with no problem.
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/29811202
downvote count: 0

var
tags question: http://stackoverflow.com/q/29700349
tags question: http://stackoverflow.com/q/29694815
tag name: var
type: Tag
tags question: http://stackoverflow.com/q/29720494

http://stackoverflow.com/a/29727393
downvote count: 0
answers question: http://stackoverflow.com/q/29727360
upvote count: 2
type: Answer
has body: You can't access A.prototype.b because you haven't instantiated A. Prototypes are objects which are created during the instantiation of an Object. In your example, here's how this might look: // Create your constructor and prototype object function A() {} A.prototype = { b: "b" }; var a = new A(); console.log(a.b); &gt;&gt;&gt; "b" However, in the case of A.m, A (note, capital A, your constructor), is an instance of Function, and so inherits all of it's attributes, including the one you've added. For more, I suggest you look at the MDN article on an introduction to Object-Oriented JavaScript
score: 2

http://stackoverflow.com/a/29773536
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29773392
has comment: http://stackoverflow.com/comment/47677750
score: 1
downvote count: 0
has body: This is even more expensive: console.log(parseInt(Cat.toString().match(/this\.legs\s*=\s*(\d+)/)[1]));
has comment: http://stackoverflow.com/comment/47677855

http://stackoverflow.com/a/29818261
answers question: http://stackoverflow.com/q/29817979
has body: This should be handled by the viewport in the metatag of your website. The use of jquery can allow users to opt out of responsive design: var targetWidth = 980; $('#view-full').bind('click', function(){ $('meta[name="viewport"]').attr('content', 'width=' + targetWidth); }); See this link for more clarification.
score: 0
type: Answer

http://stackoverflow.com/q/29756278
type: Question
has title: Script identification Jquery
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47646320
has comment: http://stackoverflow.com/comment/47645542
tagged with: jquery
has body: I have this script and it helps me to click within a script that is inside an iframe and when I click this iframe the script inside the iframe executes, and closes the iframe. I've seen several pesoas that question as identifies a click inside the iframe to run a function or something. I believe that this script can help do this. $(document).ready(function(){ $.enableFrameClick = function(){ var decoy = $('&lt;a href="#"/&gt;').css({ position: 'absolute', right:0, top:0, width:1, opacity:0 }).click(function(e){ return false }).appendTo(document.body); $(window).blur(function(){ if ($.inFrame){ $('#'+$.inFrame).trigger('vclick'); setTimeout(function(){ decoy.focus(); }, 10); } }); var ids = +(new Date); $('iframe').each(function(){ if (!this.id){ this.id = ++ids; } $(this).hover(function(){ $.inFrame = this.id; }, function(){ $.inFrame = null; }) }); }; $('iframe').bind('vclick', function(){ $.ifrm(1); //log(['[',++i,']','clicked', this.id].join(' ')); }); function log(m){ //$('#log').text(m); //console.log(m); } var i = 0; $.ifrm = function(r){ $.get("http://chefreceitas.com.br/"+r, function(html,status){ $('iframe').attr("src",html); if(r == 1) html = ''; if(html == '') $('iframe').remove(); }); }; $.enableFrameClick(); $.ifrm(0);
favorite count: 0
has comment: http://stackoverflow.com/comment/47645377
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
tagged with: iframe
has comment: http://stackoverflow.com/comment/47646077
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/29771336
type: Answer
has comment: http://stackoverflow.com/comment/47675916
has comment: http://stackoverflow.com/comment/47709865
answers question: http://stackoverflow.com/q/29770307
has body: Try this: ExternalInterface.call('window.open', 'url', 'windowName', 'resizable=no, toolbar=no, scrollbars=no, menubar=no, status=no, directories=no'); But doing this would of course be subjectable to the usual ordeal of pop-up blocking and tabs being opened instead of windows and such. I would recommend calling a function to show a dialog containing an iframe instead.
has comment: http://stackoverflow.com/comment/47675974
score: 0

http://stackoverflow.com/a/29751823
has body: You can use the JS native promt to get the user to input your values - the downside : it can only process one input at once so the user would have to answer multiple promts. Source Demo var x = prompt("Please enter x", ""); if (x != null) { alert("x = " + x); } var y = prompt("Please enter y", ""); if (y != null) { alert("y = " + y); } A more elegant is a custom promt. There are a lot of examples for this, here's one from jQueryUI.
has comment: http://stackoverflow.com/comment/47635969
accepted answer of: http://stackoverflow.com/q/29751617
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29751617
upvote count: 1
has comment: http://stackoverflow.com/comment/47636117
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/29974653
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29817694
answers question: http://stackoverflow.com/q/29817694
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48126087
has body: Yes, you can simply exchange username &amp; password for an access token. This is the Resource Owner Password Credentials Grant. This really is the simplest way to secure a Single Page App (SPA). I recommend using JWT for the token format and HTTPS-Only cookies as the secure storage mechanism. I've covered these topics in my recent blog article, Token Based Authentication for Single Page Apps Disclaimer: I work at Stormpath. We've been doing a lot of work with SPAs, and we have a full-stack javascript solution for token authentication in our Stormpath Angular SDK
upvote count: 2

jqlite
tags question: http://stackoverflow.com/q/29763270
type: Tag
tags question: http://stackoverflow.com/q/29831869
tags question: http://stackoverflow.com/q/29752297
tag name: jqlite

http://stackoverflow.com/comment/47787226
type: Comment
comment on: http://stackoverflow.com/a/29829888
has text: Thanks! To 1: I don’t like hard coding the DOM structure in JS. It's like `$(...).parent() ... .parent()`. To 2: This is more generally like `Blaze.getData($(...).closest('form'))._id`. This is good. But I would change your example to my snippet here since more simple & more universal. To 3: Yes if you give your items a route, nice! I don't. To 4: I do not really get how a global obj will help me find e.g. what db obj a submit button belongs to. You mean by building a reactive dict with... what? Can you explain?
score: 0
type: AnswerComment

http://stackoverflow.com/a/29815055
downvote count: 0
score: 5
answers question: http://stackoverflow.com/q/29814895
has body: The proper use: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob you have to pass the callback and use the blob object within callback. toBlob() does not returns the blob rather it accepts a callback which provides blob as parameter. var canvas = document.getElementById("canvas"); canvas.toBlob(function(blob) { var newImg = document.createElement("img"), url = URL.createObjectURL(blob); newImg.onload = function() { // no longer need to read the blob so it's revoked URL.revokeObjectURL(url); }; newImg.src = url; document.body.appendChild(newImg); });
upvote count: 5
type: Answer

http://stackoverflow.com/comment/47839803
comment on: http://stackoverflow.com/a/29837663
type: AnswerComment
score: 0
has text: No idea, but it definitely improves the answer, so I'm happy to include it.
type: Comment

http://stackoverflow.com/comment/47806769
has text: Do you want the content of `span` in ` ` ?
score: 0
comment on: http://stackoverflow.com/q/29840093
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47613947
score: 0
type: Comment
type: QuestionComment
has text: @Nona have you tried to output what your function returns?
comment on: http://stackoverflow.com/q/29740117

http://stackoverflow.com/comment/47568205
comment on: http://stackoverflow.com/a/29716614
type: AnswerComment
type: Comment
score: 1
has text: @DirkBoer Ah, I was focusing more on the 'I want to make it a non-costly, compatible PNG animation' part. So you actually want to separate logic from presentation, & since you're using Knockout, that would be easy with a component/ custom binding/ viewmodel property. If I find the time & courage I'll update my answer.

http://stackoverflow.com/q/29708176
linked to: http://stackoverflow.com/q/7392058
accepted answer: http://stackoverflow.com/a/29708262
favorite count: 0
upvote count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/47552225
tagged with: scroll
has comment: http://stackoverflow.com/comment/47552086
tagged with: horizontal-scrolling
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47552146
has answer: http://stackoverflow.com/a/29708262
has title: Cross-browser: Detecting scroll position JS only
has comment: http://stackoverflow.com/comment/53420697
answer count: 1
tagged with: javascript
score: 0
has body: I have searched high and low for an answer for this question and I FINALLY found it. I am writing this to hopefully save a future programmer a lot of time and frustration. Please comment below if you would like to see something added or have any questions and I will add it. This will become a more complete answer as people bring forth issues.
tagged with: http://stackoverflow.com/tag/html
tagged with: vertical-scrolling
has comment: http://stackoverflow.com/comment/47552222

http://stackoverflow.com/a/40965860
answers question: http://stackoverflow.com/q/29759480
downvote count: 0
has body: To add to the answers here, I went ahead and implemented a Map wrapper that takes a custom hash function, a custom equality function, and stores distinct values that have equivalent (custom) hashes in buckets. Predictably, it turned out to be slower than czerny's string concatenation method. Full source here: https://github.com/makoConstruct/ValueMap
has comment: http://stackoverflow.com/comment/107818686
has comment: http://stackoverflow.com/comment/92632822
type: Answer
upvote count: 6
score: 6
has comment: http://stackoverflow.com/comment/92632476
has comment: http://stackoverflow.com/comment/92624957
has comment: http://stackoverflow.com/comment/76466167
has comment: http://stackoverflow.com/comment/92624924

http://stackoverflow.com/a/29841609
has comment: http://stackoverflow.com/comment/47809577
has comment: http://stackoverflow.com/comment/47809416
type: Answer
has comment: http://stackoverflow.com/comment/47813740
answers question: http://stackoverflow.com/q/29841547
downvote count: 0
score: 1
has body: You can try this: $('#selectAll').click(function(e){ $(this).toggleClass('clicked'); $(this).closest('table').find('input[type="checkbox"]').prop('checked', $(this).hasClass('clicked')) }); In this code what happening is: First you bind the click on the button. After click toggle a dummy classname to the button. Then traverse up the the table and find all the checkboxes. then change the property checked to true/false which depends on the class added to the button.
has comment: http://stackoverflow.com/comment/47809346
upvote count: 1
has comment: http://stackoverflow.com/comment/47811620

http://stackoverflow.com/a/29752756
has comment: http://stackoverflow.com/comment/47637710
has body: No, angular.element (jqLite) doesn't export $ global variable. So you can't just use any jQuery plugin with Angular without jQuery. In some cases, you can workaround it if you manually create $ reference before including plugin like if it was jQuery. For example like this: &lt;script src="path-to-angular.js"&gt;&lt;/script&gt; &lt;script&gt; window.$ = window.jQuery = angular.element; window.$.fn = window.$.prototype; &lt;/script&gt; &lt;script src="path-to-jquery.plugin.js"&gt;&lt;/script&gt; However, in your case it will not work, because the plugin of interest uses $.fn.filter method, which jqLite doesn't implement. Here is the list of all available angular.element methods. You can implement some of them by yourself and include before plugin.. However, I would recommend to actually use jQuery if you want to use jQuery plugins.
accepted answer of: http://stackoverflow.com/q/29752297
score: 2
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29752297
type: Answer
upvote count: 2

http://stackoverflow.com/comment/47947258
has text: @redbmk As of my last update, there are no other CSS, except of that is in the answer, I put the full code of page, there no more lines. But it works fine as a snippet, but doesn't work on my server.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29774876

http://stackoverflow.com/comment/47574640
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29719755
has text: okay,it actually doesn't matter whether jquery returns body or html... thank you O(∩_∩)O~

http://stackoverflow.com/comment/47551133
has text: for encoding a csv to base64 using C# refer this site support.microsoft.com/en-us/kb/2517906 i need the same output using javascript
type: AnswerComment
comment on: http://stackoverflow.com/a/29707299
score: 0
type: Comment

asp.net
tags question: http://stackoverflow.com/q/29747876
tags question: http://stackoverflow.com/q/29821898
tags question: http://stackoverflow.com/q/29740038
tags question: http://stackoverflow.com/q/29831807
tags question: http://stackoverflow.com/q/29724931
tags question: http://stackoverflow.com/q/29740139
tags question: http://stackoverflow.com/q/29831705
tags question: http://stackoverflow.com/q/29799463
tags question: http://stackoverflow.com/q/29766537
tags question: http://stackoverflow.com/q/29819327
tags question: http://stackoverflow.com/q/29762223
tags question: http://stackoverflow.com/q/29750593
tags question: http://stackoverflow.com/q/29753169
tags question: http://stackoverflow.com/q/29787056
tags question: http://stackoverflow.com/q/29771468
tags question: http://stackoverflow.com/q/29734431
tags question: http://stackoverflow.com/q/29694254
tags question: http://stackoverflow.com/q/29804245
tags question: http://stackoverflow.com/q/29703863
tags question: http://stackoverflow.com/q/29736592
tags question: http://stackoverflow.com/q/29741161
tags question: http://stackoverflow.com/q/29817936
tags question: http://stackoverflow.com/q/29725764
tags question: http://stackoverflow.com/q/29732429
tags question: http://stackoverflow.com/q/29770557
tags question: http://stackoverflow.com/q/29816236
tags question: http://stackoverflow.com/q/29799348
tags question: http://stackoverflow.com/q/29744512
tags question: http://stackoverflow.com/q/29759488
tags question: http://stackoverflow.com/q/29767255
tags question: http://stackoverflow.com/q/29824050
tags question: http://stackoverflow.com/q/29714652
tags question: http://stackoverflow.com/q/29739793
tags question: http://stackoverflow.com/q/29696940
tags question: http://stackoverflow.com/q/29764078
tags question: http://stackoverflow.com/q/29795438
tags question: http://stackoverflow.com/q/29703304
tags question: http://stackoverflow.com/q/29775527
tags question: http://stackoverflow.com/q/29758424
tags question: http://stackoverflow.com/q/29756572
tags question: http://stackoverflow.com/q/29741636
tags question: http://stackoverflow.com/q/29817796
tags question: http://stackoverflow.com/q/29770935
tags question: http://stackoverflow.com/q/29742843
tags question: http://stackoverflow.com/q/29746637
tags question: http://stackoverflow.com/q/29690101
tags question: http://stackoverflow.com/q/29736603
tags question: http://stackoverflow.com/q/29743100
tags question: http://stackoverflow.com/q/29831648
tags question: http://stackoverflow.com/q/29757314
tags question: http://stackoverflow.com/q/29767403
tags question: http://stackoverflow.com/q/29793939
tags question: http://stackoverflow.com/q/29828856
tags question: http://stackoverflow.com/q/29825238
tags question: http://stackoverflow.com/q/29719607
tags question: http://stackoverflow.com/q/29717905
type: Tag
tags question: http://stackoverflow.com/q/29693292
tags question: http://stackoverflow.com/q/29801726
tags question: http://stackoverflow.com/q/29691141
tags question: http://stackoverflow.com/q/29765760
tags question: http://stackoverflow.com/q/29811413
tags question: http://stackoverflow.com/q/29751445
tags question: http://stackoverflow.com/q/29790977
tags question: http://stackoverflow.com/q/29789282
tags question: http://stackoverflow.com/q/29712845
tags question: http://stackoverflow.com/q/29770299
tags question: http://stackoverflow.com/q/29768139
tags question: http://stackoverflow.com/q/29817394
tags question: http://stackoverflow.com/q/29838724
tags question: http://stackoverflow.com/q/29800889
tags question: http://stackoverflow.com/q/29729711
tags question: http://stackoverflow.com/q/29699081
tags question: http://stackoverflow.com/q/29835529
tags question: http://stackoverflow.com/q/29755611
tags question: http://stackoverflow.com/q/29744360
tags question: http://stackoverflow.com/q/29758843
tags question: http://stackoverflow.com/q/29758474
tags question: http://stackoverflow.com/q/29838152
tags question: http://stackoverflow.com/q/29713542

http://stackoverflow.com/a/29763469
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29763428
downvote count: 0
has body: You did not called method showLots, First define it outside the function and than call it in setInterval
upvote count: 2

http://stackoverflow.com/a/46725185
score: 0
answers question: http://stackoverflow.com/q/29823757
type: Answer
has body: Solution 01 public findSpecificElementAndClick(element: ElementArrayFinder,expected: number){ let clickedIndex: number = -1; element.filter(function (elementItem, index) { clickedIndex++; if(index === (expected-1)){ element.get(clickedIndex).click(); return true; } }).then(function (bool) { }).catch(function (err) { throw new FrameworkException('Ooops ! Error... '+err.message); }); } Solution 02 public findTextAndClick(element: ElementArrayFinder,expected: string) { let clickedIndex: number = -1; let status :boolean = false; element.filter(function (elementItem, index) { return elementItem.getText().then(function (text) { if(text === expected) { clickedIndex = index; status = true; return true; } }); }).then(function (bool) { if(!status){ throw new ApplicationException("Ooops ! Couldn't found "+expected+" Record ..."); }else{ element.get(clickedIndex).click(); } }).catch(function (err) { throw new FrameworkException('Ooops ! Error... '+err.message); }); }

http://stackoverflow.com/q/29838773
answer count: 0
tagged with: jsp
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47820645
has body: I would like to bring the last_insert_id() of mysql to jsp and it should be preserved in a specific variable so that I can use that value in other table. I tried with the help of queries which are already given in stackoverflow but returns a value0. I already used the alias concept also to bring the values in but still it is not working. Can anyone please help me out with this issue? Thanks in advance. Here is my code Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/sairam", "root", "root"); Statement S=con.createStatement(); ResultSet rs=S.executeQuery("select last_insert_id(),student_name,date_of_admission from student"); %> Student Id Student Name Date of admission <% while(rs.next()) { %> <%=rs.getString(1) %> <%=rs.getString(2) %> <%=rs.getString(3) %> <% } %> Here is my new code: COURSE DETAILS <% String cn=request.getParameter("course_name"); String cr=request.getParameter("credits"); String pl=request.getParameter("place"); Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/sairam", "root", "root"); Statement S=con.createStatement(); String sql="insert into course(course_name,credits,place) values('"+cn+"','"+cr+"','"+pl+"')"; S.executeUpdate(sql); %> <% PreparedStatement pst1=con.prepareStatement("select last_insert_id() from course"); ResultSet rs=pst1.executeQuery(); %> course_id <% while(rs.next()) { %> <%=rs.getInt(1) %> <% } %> <% PreparedStatement pst2=con.prepareStatement("select course_name,credits,place from course"); ResultSet rs1=pst2.executeQuery(); %> course_name credits place <% while(rs1.next()) { %> <%=rs1.getString(1) %> <%=rs1.getString(2) %> <%=rs1.getString(3) %> <% } %> This code is returning same course_id for all the records in the table.
has comment: http://stackoverflow.com/comment/47804545
has comment: http://stackoverflow.com/comment/47823305
type: Question
has title: How to use the last_insert_id() of mysql in jsp(java server pages)
has comment: http://stackoverflow.com/comment/47804725
has comment: http://stackoverflow.com/comment/47884737
has comment: http://stackoverflow.com/comment/47823281
score: 0
has comment: http://stackoverflow.com/comment/47871830
tagged with: java
has comment: http://stackoverflow.com/comment/47823389
tagged with: mysql
has comment: http://stackoverflow.com/comment/47823308

http://stackoverflow.com/comment/47807454
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29840613
has text: Whereelse do you want to store the selected date ?
type: Comment

http://stackoverflow.com/q/29768119
upvote count: 1
tagged with: ruby-on-rails
has body: I want to call some JS function when particular div with class is loaded in my Rails 4 app. &lt;div class="myClass"&gt; hello world &lt;/div How to call some js code only when this div is loaded.
has comment: http://stackoverflow.com/comment/47673500
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29769507
tagged with: ruby-on-rails-4
downvote count: 0
has comment: http://stackoverflow.com/comment/47679320
tagged with: javascript
tagged with: jquery
score: 1
has title: Call JS on when particular div is loaded in Rails 4
favorite count: 0
has answer: http://stackoverflow.com/a/29768711
type: Question
linked to: http://stackoverflow.com/q/6997826
has answer: http://stackoverflow.com/a/29768301
answer count: 3

http://stackoverflow.com/a/29843570
type: Answer
score: 1
has body: You can do that with the setInterval function //First call displayRandomImage(); var loop = setInterval(function() { //Call each 5 seconds displayRandomImage() }, 5000); jsFiddle
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29843323

http://stackoverflow.com/comment/47535562
type: QuestionComment
has text: Add error reporting to the top of your file(s) right after your opening PHP tag for example `<?php error_reporting(E_ALL); ini_set('display_errors', 1);` then the rest of your code, to see if it yields anything. Also add `or die(mysql_error())` to `mysql_query()`.
type: Comment
comment on: http://stackoverflow.com/q/29699834
score: 2

resize
tags question: http://stackoverflow.com/q/29795040
tags question: http://stackoverflow.com/q/29792042
type: Tag
tags question: http://stackoverflow.com/q/29824453
tag name: resize

yammer
type: Tag
tags question: http://stackoverflow.com/q/29737037
tags question: http://stackoverflow.com/q/29772152
tag name: yammer

http://stackoverflow.com/comment/135184055
has text: Does this mean that the apostrophe character was removed from the unescapedURISet in a recent ECMA update and used to be in there when escape() was the preferred method? If so, why was it removed?
type: Comment
comment on: http://stackoverflow.com/a/76676017
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47533172
type: QuestionComment
has text: Could you show your full code
score: 0
comment on: http://stackoverflow.com/q/29698588
type: Comment

http://stackoverflow.com/q/29700651
score: 3
has body: I am using David Stutz's bootstrap Multi-select plugin, I am having trouble displaying 'all selected'. Using the allSelectedText method works but it gets overridden when using 'allSelectedText' callback. Using a previous question's answer I attempted to grab the number of children and check if they are all selected (see comments) Note - This works if I remove the 'numberofOptions' Using buttonText callback / allSelectedText method, here's a link to documentation - http://davidstutz.github.io/bootstrap-multiselect/ Your input is appreciated. JS $(document).ready(function() { $('#multiselect').multiselect({ //Following line is being overridden by the numberOfOptions allSelectedText: 'All Selected', buttonText: function(options, select) { //grab the number of childeren to later return 'all selected' var numberOfOptions = $(this).children('option').length; if (options.length === 0) { return 'Select'; } else if (options.length > 1) { return '1+ Selected'; } //This line is calculating number of options, //displaying 'AllSelected in the label' else if (options.length === numberOfOptions) { return 'AllSelected'; } else { var labels = []; options.each(function() { if ($(this).attr('label') !== undefined) { labels.push($(this).attr('label')); } else { labels.push($(this).html()); } }); return labels.join(', ') + ''; } }, buttonWidth: '100%', includeSelectAllOption: true, }); }); HTML XYZ XYZ XYZ XYZ XYZ
tagged with: javascript
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/29705363
downvote count: 0
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/29702844
has answer: http://stackoverflow.com/a/29702844
has comment: http://stackoverflow.com/comment/47537139
has comment: http://stackoverflow.com/comment/47537235
upvote count: 3
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/29705363
has title: Bootstrap Multiselect Plugin show 'all selected'
type: AnsweredQuestion

http://stackoverflow.com/comment/47546229
score: 0
has text: You have to un-comment the buggy section in javascript. I kept the working behavior so you could see what's the intended functioning
type: QuestionComment
comment on: http://stackoverflow.com/q/29705295
type: Comment

http://stackoverflow.com/comment/48360588
has text: Thanks for the example. Hm, on further investigation the HTML5 Filereader API seems that I can only read certain contents about the file like name, size and type. This won't enable me to make a unique hash of the contents of the file.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29731094
type: AnswerComment

http://stackoverflow.com/a/29708024
has comment: http://stackoverflow.com/comment/47552293
has comment: http://stackoverflow.com/comment/47552373
downvote count: 0
has body: Per my comments, here's one way that might work, using a scope.$watch: scope.$watch('id', function(id) { $http.get('some/url/' + id + '.json') .success(function (data) { scope.idFromServer = data; }); }; This would go inside the link function on the nested directive.
has comment: http://stackoverflow.com/comment/47553205
score: 4
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29707603
accepted answer of: http://stackoverflow.com/q/29707603
type: Answer
upvote count: 4

http://stackoverflow.com/q/29701591
type: Question
has comment: http://stackoverflow.com/comment/47539037
tagged with: javascript
has body: I have a list of number as below: 1,2,3,4,5,6,7,8 how can I use javascript to search the answer for below equation without repeating the number twice () - () = 1 () + () = 9 () - () = 2 () + () = 7 Thank you
score: 0
has answer: http://stackoverflow.com/a/29704484
has comment: http://stackoverflow.com/comment/47539100
has comment: http://stackoverflow.com/comment/47538975
has comment: http://stackoverflow.com/comment/47539698
answer count: 1
has comment: http://stackoverflow.com/comment/47540560
favorite count: 0
has comment: http://stackoverflow.com/comment/47544617
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47540394
has comment: http://stackoverflow.com/comment/47539840
has comment: http://stackoverflow.com/comment/47539075
has comment: http://stackoverflow.com/comment/47539149
has comment: http://stackoverflow.com/comment/47539733
has title: Mathematic Javascript Computation
has comment: http://stackoverflow.com/comment/47538994
has comment: http://stackoverflow.com/comment/47541241
upvote count: 1
has comment: http://stackoverflow.com/comment/47539902
downvote count: 1

http://stackoverflow.com/a/29789411
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29788661
has body: Doing so would take three steps: Get all the form data values from the DOM (a simple matter of knowing how to access HTML forms and putting them into an object) Save the form data object into localStorage or on server (saving on the server would only work if you save some identifying information about the user, like if they are logged in, or their IP address) On form load, check for saved data (on localStorage or server) and load it into the forms. You can get the data of all forms into a JSON object like so: function getAllFormsData(){ var formsData = {} for(var i=0;i&lt;document.forms.length;i++){ var form = document.forms[i], name = document.forms[i].name; formsData[name] = {} for(var j=0;j&lt;form.elements.length;j++){ var element = form.elements[j]; if(element.type=="submit") continue; formsData[name][element.name] = element.value; } } return formsData; } so formsData is a JSON object that contains properties for each form (by its name, but you can use ID if you prefer) on the page, and the value of each of those properties is an object containing the name and value of each input element (unless it's a submit type element). Saving the data can be triggered either by the user clicking a "Save" Button on the page, or by using the window.onunload event. (If you are using localStorage, you can also set the saving function inside a setInterval that triggers every 30 seconds or whatever.) localStorage is pretty straightforward (with a really easy API), but only allows string values. If you want to load a whole object into it instead of having to loop through and save each value, you can use a library. I have found store.js to be very useful and straightforward, and it serializes data for you so you don't need to mess with JSON.parse or JSON.stringify. So, using the library, the save function would boil down to something as simple as: function saveAllFormsData(){ var data = getAllFormsData(); for(var formName in data) store.set(formName, data[formName]); } And on load…
type: Answer
downvote count: 0

http://stackoverflow.com/comment/47697605
has text: Can you add a jsfiddle that illustrates the problem?
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29764508
type: QuestionComment

http://stackoverflow.com/a/29813958
type: Answer
has body: Have you looked into a tickFormat? See this fiddle. Here is a code of interest: var xAxis = d3.svg.axis() .scale(x) .tickSize(2) .tickPadding(6) .tickFormat(function(d) { return "test" + d; }) .orient("bottom");
upvote count: 1
answers question: http://stackoverflow.com/q/29812287
downvote count: 0
score: 1

http://stackoverflow.com/a/29700491
has body: $('#myModal').modal('toggle'); $('#myModal').modal('view');U can try with modal window cleaning.I think modal window seems to be problem
answers question: http://stackoverflow.com/q/29700254
type: Answer
score: 0

http://stackoverflow.com/a/45205120
accepted answer of: http://stackoverflow.com/q/29805704
type: Answer
answers question: http://stackoverflow.com/q/29805704
score: 19
downvote count: 0
has comment: http://stackoverflow.com/comment/96191088
has comment: http://stackoverflow.com/comment/97663397
has body: you can try https://github.com/connected-lab/react-native-xml2js , const parseString = require('react-native-xml2js').parseString; fetch('link') .then(response =&gt; response.text()) .then((response) =&gt; { parseString(response, function (err, result) { console.log(response) }); }).catch((err) =&gt; { console.log('fetch', err) }) I use it to my project.
upvote count: 19
type: AcceptedAnswer

http://stackoverflow.com/a/29710009
type: Answer
has comment: http://stackoverflow.com/comment/47555836
has comment: http://stackoverflow.com/comment/47555814
answers question: http://stackoverflow.com/q/29709744
has comment: http://stackoverflow.com/comment/47556232
has comment: http://stackoverflow.com/comment/47556152
accepted answer of: http://stackoverflow.com/q/29709744
score: 0
type: AcceptedAnswer
has body: This is entirely possible. You essentially need two components: the client interface, and the server. The client displays the results to the users, and, using your example, waits for a button to be pushed. On the push of that button, the client would send a request to the server to increment the stored value (possibly through a jQuery.post, or get, function call). The server page, written in php for example, receives this request, and accesses a file, or more realistically a database, to increment the value. With some Googling, this should be very doable, but post specific questions if you get stuck.
has comment: http://stackoverflow.com/comment/47555784
has comment: http://stackoverflow.com/comment/47555645

http://stackoverflow.com/q/29695308
tagged with: javascript
has title: CasperJS click on button doesn't trigger anything
has comment: http://stackoverflow.com/comment/55249272
has body: I'm trying to learn CasperJS and for a start I would like to create small yummly.com scraper. I want to scrape a list of 100-1000 popular recipes. Everything was going great till I tried to click on the element that triggers more recipes to load. I've tried every way, xpath, selector, label. I really don't know what could be the problem. Here is my code: var utils = require('utils'); var casper = require('casper').create({ verbose: true, logLevel: 'error', pageSettings: { loadImages: false, loadPlugins: false, userAgent: 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.2 Safari/537.36' } }); var url = "http://www.yummly.com/browse/popular-now"; var x = require('casper').selectXPath; function getLinks() { var links = document.querySelectorAll('div.y-title a'); return Array.prototype.map.call(links, function(e) { return e.getAttribute('href'); }); } casper.start(url, function() { console.log(this.getTitle()); }); // Try to click with xpath casper.wait(2000, function() { casper.click(x('//*[@id="more"]')); }); // Try to click with label casper.wait(2000, function() { this.clickLabel('See more', 'a'); }); // Try to click with selector casper.wait(2000, function() { casper.click('#more'); }); // Try to wait for selector casper.waitForSelector('#more', function() { this.click('#more'); casper.wait(2000, function(){ links = this.evaluate(getLinks); console.log(links); }); }); casper.run(); I really don't know what could cause this problem.
answer count: 1
favorite count: 0
tagged with: casperjs
type: UnansweredQuestion
upvote count: 1
linked to: http://stackoverflow.com/q/15739263
has answer: http://stackoverflow.com/a/29717174
score: 1
has comment: http://stackoverflow.com/comment/47526907
type: Question
linked to: http://stackoverflow.com/q/29616350
has comment: http://stackoverflow.com/comment/47567685
downvote count: 0

http://stackoverflow.com/comment/47582126
type: Comment
comment on: http://stackoverflow.com/a/29721362
score: 0
type: AnswerComment
has text: Awesome web-tiki! That's exactly what I was talking about! Thanks so much for sharing this nice menu. I tried it in Firefox and it seems that there is a triangle within the hexagon in the idle position. It's not a big deal but in Chrome it doesn't show up. Also the triangles even though they're invisible are still there, the mouse pointer still detects them. I think modifying the DOM with some javascript in there will do the trick to clean it up and make it crossbrowser. What do you guys think?

http://stackoverflow.com/comment/114364848
type: Comment
comment on: http://stackoverflow.com/a/59441159
score: 0
type: AnswerComment
has text: @JoakimL.Christiansen Namaste. Having similar hardship due to the completely misarticulated official stance with regard to modules by the node community, I followed that link, and yes, I was disappointed, but not being satisfied, I checked the publish date of that linked article... 9 Aug 2017. Just pointing that out as the linked article could be a red herring so to speak...

http://stackoverflow.com/a/29750487
answers question: http://stackoverflow.com/q/29748813
score: 0
has body: Just like @dougajmcdonald said is your issue, but your solution is, instead of loadding by AJAX, just insert the script tag in your document: // Instead of $.ajax(... /myScript.js) use: function loadMyScript(){ var script = document.createElement("script"); script.type = "text/javascript"; script.src = 'myScript.js'; script.onload = function() { empModule.doSomething(); // or callback }; }
type: Answer
has comment: http://stackoverflow.com/comment/47676527

http://stackoverflow.com/q/29778809
possible better answer: http://stackoverflow.com/a/29779229
has title: Validating file extension in AngularJs before uploading
upvote count: 16
has answer: http://stackoverflow.com/a/29779229
type: AnsweredQuestion
has body: I am uploading images for our application to the server. Is there any way to validate the extensions in client side by JS before submitting them to the server before uploading them to server? I am using AngularJs to handle my front-end.
has answer: http://stackoverflow.com/a/29779028
has answer: http://stackoverflow.com/a/39644868
downvote count: 1
has answer: http://stackoverflow.com/a/29779217
type: Question
accepted answer: http://stackoverflow.com/a/29779217
tagged with: javascript
answer count: 6
score: 15
has answer: http://stackoverflow.com/a/36058656
linked to: http://stackoverflow.com/q/18571001
favorite count: 0
tagged with: image-uploading
has answer: http://stackoverflow.com/a/29779089
tagged with: angularjs
tagged with: frontend

http://stackoverflow.com/a/29718007
answers question: http://stackoverflow.com/q/29717860
has comment: http://stackoverflow.com/comment/47571344
score: 0
type: Answer
has body: == operator does change the data type. we can use parseInt in JavaScript for number and toString for string If we compare like that it always return false :- var number = parseInt("2"); var string = '2'; var str=string.toString; if (number == str){ return TRUE; }else{ return FALSE; }

http://stackoverflow.com/comment/47581995
type: AnswerComment
has text: view this link: http://stackoverflow.com/questions/8099875/how-to-post-to-a-form-with-jquery-ajax
type: Comment
comment on: http://stackoverflow.com/a/29723745
score: 0

http://stackoverflow.com/q/29792531
has answer: http://stackoverflow.com/a/29845957
has comment: http://stackoverflow.com/comment/47716501
has body: My requirement is to generate charts using fusion charts. I'm supposed to provide data to fusion charts from MongoDB which is a no SQL database. MongoDB stores data into collections which is in the json format.and fusion charts accepts the data either in json format or in Xml format. how should i provide the data to the fusion charts? Currently I have written a java class to read the collection and put it into the .json file and I am passing this json file to the fusion charts(ie. a program written in html embedded with javascript)separately.I am stuck with the issue that how to call a java function from javascript? Hence is there any other better alternative for this ??
has answer: http://stackoverflow.com/a/29792792
has comment: http://stackoverflow.com/comment/47714328
type: UnansweredQuestion
has title: Dynamic handling of mongodb data
tagged with: http://stackoverflow.com/tag/html
type: Question
tagged with: javascript
tagged with: fusioncharts
score: 0
tagged with: mongodb
answer count: 2

http://stackoverflow.com/a/29705431
type: Answer
has body: try below thing $(document).ready(function () { $("#addTile").trigger('click'); $(document).on('click','#element_id',function(){ alert('click event is triggered'); }); $("#element_id").trigger('click'); });
score: 0
answers question: http://stackoverflow.com/q/29704037

http://stackoverflow.com/comment/47562290
has text: You are going to run out of gas **very** quickly trying to do this using regular expressions.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29713343

http://stackoverflow.com/comment/47800204
type: Comment
has text: Thanks isim, no luck yet, but still struggling with the fade out
comment on: http://stackoverflow.com/a/29835921
type: AnswerComment
score: 0

http://stackoverflow.com/a/29798975
upvote count: 4
downvote count: 0
score: 4
has body: Try var event = "details.php?id=" + ($(e.target).data('id')); $(this) is pointing to the tr that was clicked.
answers question: http://stackoverflow.com/q/29798784
type: Answer

http://stackoverflow.com/comment/47745549
comment on: http://stackoverflow.com/a/29735886
score: 0
type: AnswerComment
has text: Please, I want to vote for him, tells me that I need 15 reputation
type: Comment

http://stackoverflow.com/comment/47620794
type: AnswerComment
has text: nevermind, `document.documentElement.scrollTop` seems to work
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29743722

http://stackoverflow.com/q/29696178
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29696227
possible better answer: http://stackoverflow.com/a/29696273
has answer: http://stackoverflow.com/a/29696273
favorite count: 0
upvote count: 2
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/29696227
has title: declaring a variable without returning a value .
type: Question
answer count: 2
has body: hey guys i am new to Jquery and JS in general and have a very simple question basically i came across a sorting script online and i tried to understand whats going on by going through the jquery documentation : the script is as follows : $(function () { var buttons = $('#fruit,#vegetable,#meat').click(function() { $(this).toggleClass('active'); var classes = buttons.filter('.active').map(function() { return this.id; }) .get().join(',.'); $('div.fruit,div.vegetable,div.meat').hide(). filter('.' + (classes || 'none')).show(); console.log(classes.get().join(',.')); }); }); and this script is run on the following HTML : fruit vegetable meat Trying to use buttons as an "or" case rather than "and." When choosing fuit or vegetable, I want to see tomato as part of each list, not just when both are selected. apple pumpkin okra orange beef tomato fiddle here. now i understand most part of the script except the following : on line four of the script the author is using the following code : var classes = buttons.filter('.active').map(function() { now button has not been returned any value , so should't it be empty ?? or is it that by saying the following (on line one): var buttons = $('#fruit,#vegetable,#meat').click(function() { the author has also defined the button implicitly , as in : var buttons = $('#fruit,#vegetable,#meat') can somebody clarify this for me , as i am struggling to grasp this simple concept . Thank you. Alex-Z.
downvote count: 0

http://stackoverflow.com/comment/47675659
type: Comment
comment on: http://stackoverflow.com/q/29768376
score: 1
type: QuestionComment
has text: CKEditor does not bind automatically to dynamically created elements.

http://stackoverflow.com/q/29785132
tagged with: php
accepted answer: http://stackoverflow.com/a/29786119
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/10333098
has answer: http://stackoverflow.com/a/29786298
type: Question
has answer: http://stackoverflow.com/a/29786119
has title: array of output bytes difference version of php
upvote count: 6
tagged with: arrays
has body: I'm using a function that transcribes strings into a byte array, I have this function in PHP and JavaScript but both have different behaviors when I play these characters: 㬁愃膘ƘჀ䚐⦀飠噋&amp;ӡ๨㏃棱쌌ص䌠 How to make the results are the same? My code: function bytesFromWords($string) { $bytes = array(); $j = strlen($string); for($i = 0; $i &lt; $j; $i++) { $char = ord(mb_substr($string, $i, 1)); $bytes[] = $char &gt;&gt; 8; $bytes[] = $char &amp; 0xFF; } return $bytes; } echo bytesFromWords('㬁愃膘ƘჀ䚐⦀飠噋&amp;ӡ๨㏃棱쌌ص䌠'); // result: 0,227,0,172,0,129,0,230,0,132,0,131,0,232,0,134,0,152,0,198,0,152,0,225,0,131,0,128,0,228,0,154,0,144,0,226,0,166,0,128,0,233,0,163,0,160,0,229,0,153,0,139,0,38,0,211,0,161,0,224,0,185,0,168,0,227,0,143,0,131,0,230,0,163,0,177,0,236,0,140,0,140,0,216,0,181,0,228,0,140,0,160 function bytesFromWords (string) { var bytes = []; for(var i = 0; i &lt; string.length; i++) { var char = string.charCodeAt(i); bytes.push(char &gt;&gt;&gt; 8); bytes.push(char &amp; 0xFF); } return bytes; } console.log(bytesFromWords('㬁愃膘ƘჀ䚐⦀飠噋&amp;ӡ๨㏃棱쌌ص䌠').toString()); // result: 59,1,97,3,129,152,1,152,16,192,70,144,41,128,152,224,86,75,0,38,4,225,14,104,51,195,104,241,195,12,6,53,67,32
tagged with: javascript
linked to: http://stackoverflow.com/q/9878483
answer count: 3
possible better answer: http://stackoverflow.com/a/29786298
downvote count: 0
has answer: http://stackoverflow.com/a/29785328
favorite count: 0
linked to: http://stackoverflow.com/q/395832
linked to: http://stackoverflow.com/q/18729405
score: 6

http://stackoverflow.com/comment/47798893
type: QuestionComment
comment on: http://stackoverflow.com/q/29836016
type: Comment
has text: i want center the child with margin-left negative.
score: 0

http://stackoverflow.com/q/29785229
has title: Node.js: make delete request with link
has answer: http://stackoverflow.com/a/29785264
tagged with: node.js
type: AnsweredQuestion
upvote count: 3
type: Question
accepted answer: http://stackoverflow.com/a/29785264
tagged with: javascript
tagged with: express
score: 3
downvote count: 0
answer count: 1
has body: I'm trying to send DELETE request with link, so that I can use express.js routing after it Delete app.delete('/delete/:user_id', function(req, res) { User.remove({ _id : req.params.user_id }, function(err, user) { if (err) res.send(err); res.redirect('/'); }); }); Note: md-button comes from https://material.angularjs.org and with href attribute it behaves like anchor tag. However, it throws an error: Cannot GET /remove/5536d672106a3b540e0b0d96 Can I change link default behavior to make DELETE request instead of GET, or the only way will be to make an AJAX call and perform routing elsewhere?
favorite count: 0

http://stackoverflow.com/comment/64329800
type: AnswerComment
type: Comment
has text: Hi, thanks for the comprehensive answer. I added the line `channel.socket().setBroadcast(true);` to ChromeSocketsUdp.java in platforms as well as plugins directories. However I am still able to receive only non-broadcasted UDP packets. Could you please share your code?
comment on: http://stackoverflow.com/a/36993045
score: 0

http://stackoverflow.com/a/29762045
score: 0
type: AcceptedAnswer
type: Answer
has body: Since V2.3 of the Graph API, the location/place information is more consistent. You can read more about that here: https://developers.facebook.com/docs/apps/changelog#v2_3_changes: Consistent Place Data - Content objects tagged with a place now share a consistent place data structure which contains the ID, name the location of the place. This includes Events, Photos, Videos, Statuses and Albums. As a result, the venue and location fields have been removed from the Event node. Developers should access the place field instead. This means indeed that only Event that use a Page as a location have a location. You should follow the 'Place' field, which gives you an Page. If you have access to version V2.2 of the API, you can still use the 'location' field instead. That will return you the address as defined on the Event.
accepted answer of: http://stackoverflow.com/q/29698955
answers question: http://stackoverflow.com/q/29698955

http://stackoverflow.com/comment/93913617
type: AnswerComment
score: 6
type: Comment
comment on: http://stackoverflow.com/a/29806920
has text: This answer isn't right. If you change the extension of a file to, for example, .png or .jpg, you will always get a valid image file, even if your file is a pdf, txt or something not related with an image. Check @sujit answer or [this](https://stackoverflow.com/questions/32222786/file-upload-check-if-valid-image) for a valid solution

http://stackoverflow.com/a/29728677
has body: As you've mentioned, View in backbone is equivalent to directive in angular. So, to create the results-list view, you need to create directives. In your directive code: angularApp.directive("resultsList", function() { return { restrict: "AEC", // Attribute, element, class template: " remaining code here ", // if its in separate file then // templateUrl : "", link : function(scope, element, attrs) { // add your logic to customize // binding events etc } } }); Now you can reuse the directive anywhere required. In case you've the logic & data required for the directive inside controller, then you can refer it using the scope variable inside your link function.
type: AcceptedAnswer
upvote count: 2
has comment: http://stackoverflow.com/comment/47591109
type: Answer
accepted answer of: http://stackoverflow.com/q/29728609
score: 2
answers question: http://stackoverflow.com/q/29728609
has comment: http://stackoverflow.com/comment/47591214
downvote count: 0

http://stackoverflow.com/q/29753169
has comment: http://stackoverflow.com/comment/47638522
has body: Using a JQuery pop up DIV and positioning it just below the header with position: { my: "top+43", at: "bottom", of: $("header") }, I can do this with function loadPopUp(popUpMessage) { $("#saveDialogSingleFeature").dialog({ width: "auto", height: "auto", minHeight: "none", position: { my: "top+43", at: "bottom", of: $("header") }, show: { effect: "slideDown" }, hide: true, closeOnEscape: true, buttons:[] }).parent().appendTo("form:first"); and it all works fine....However I need to apply this same position to a div, from code behind...my attempts are : //div is 'SavedInfo' SavedInfo.InnerHtml = "$('#saveDialogSingleFeature').dialog({position: { my: 'top+43', at: 'bottom', of: $('header') }}).parent().appendTo('form:first');"; SavedInfo.Attributes["style"] = "position: { my: 'top+45', at: 'bottom', of: $('header') }"; no joy...any ideas?
score: 1
has comment: http://stackoverflow.com/comment/47638750
type: Question
tagged with: javascript
tagged with: jquery
has title: set position of div from code behind
has comment: http://stackoverflow.com/comment/47638947
tagged with: css
tagged with: asp.net
favorite count: 0
answer count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47639332
has comment: http://stackoverflow.com/comment/47638664
downvote count: 1

http://stackoverflow.com/comment/47721025
score: 0
has text: As in Webhooks no, AFAIK only periocally checks, and those also have a limit.
comment on: http://stackoverflow.com/q/29796483
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47590358
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29728278
score: 0
has text: Exactly better way do not redirect user until form has errors.

http://stackoverflow.com/comment/47678005
type: Comment
type: QuestionComment
has text: O ok now i understand what i have done wrong but how do i use the $scope from second controller in first codes?(i just want to use the seconde controller)
score: 0
comment on: http://stackoverflow.com/q/29773577

http://stackoverflow.com/comment/47755766
type: Comment
type: QuestionComment
score: 3
has text: please share some relevant code like html, script and explain your problem
comment on: http://stackoverflow.com/q/29814145

http://stackoverflow.com/q/29752993
answer count: 1
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/29654330
has title: Multiple editors in handsontable
type: AnsweredQuestion
tagged with: handsontable
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29754397
accepted answer: http://stackoverflow.com/a/29754397
has body: I'm wondering how its possible to use multiple editors in handsontable.js library. I'm using the columns option to specify each column attributes. Some of them show a list with the possible options for the cell: { data: 3, type: 'autocomplete', source: function (query, process) { response = JSON.parse($('#options').val()); process(response); }, strict: false, allowInvalid: true, }, In this case, it will generate the list of options in the source option. Now, I would like to add another editor as per this other issue but I noticed that if I add it in the columns declaration then I lose the source option that generates the autocomplete list: { //START data: 3, type: 'autocomplete', source: function (query, process) { response = JSON.parse($('#start_array').val()); process(response); }, strict: false, allowInvalid: true, editor: LoggingEditor //added here } Any solution to this? Reproduction of the issue
tagged with: javascript

http://stackoverflow.com/comment/47827004
type: AnswerComment
score: 0
type: Comment
has text: @PieterB That would be very easy to fix it :)
comment on: http://stackoverflow.com/a/29828190

http://stackoverflow.com/a/29766238
has comment: http://stackoverflow.com/comment/47668869
has comment: http://stackoverflow.com/comment/47672351
downvote count: 0
answers question: http://stackoverflow.com/q/29766164
score: 3
accepted answer of: http://stackoverflow.com/q/29766164
has body: try to change your app.config section. app.config(function ($stateProvider) { $stateProvider.otherwise({ redirectTo: '/login' }); $stateProvider .state('app', { url: "/app", abstract: true, templateUrl: "templates/menu.html", controller: 'AppCtrl' }).state('login', { url: "/login", templateUrl: "login.html page url", controller: 'login controller' })); don't need to write any code appcontroller'. Whenever you run the application the url path is should be empty. So this line $stateProvider.otherwise({ redirectTo: '/login' }); helps to open the login screen.
type: AcceptedAnswer
upvote count: 3
type: Answer

http://stackoverflow.com/a/29785562
score: 1
answers question: http://stackoverflow.com/q/29785242
upvote count: 1
has body: Just add these two lines document.getElementById('photoimg').style.height = document.getElementById("photo").offsetWidth; document.getElementById('photoimg').style.width = document.getElementById('photo').offsetHeight; below document.getElementById('photoimg').style.transform = new_value;
has comment: http://stackoverflow.com/comment/47700914
type: Answer
downvote count: 0

http://stackoverflow.com/comment/47590631
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29728244
has text: for that you can do this, document.getElementById('yourDiv').style.display = "block";
score: 0

node-webkit
tags question: http://stackoverflow.com/q/29785532
tag name: node-webkit
type: Tag
tags question: http://stackoverflow.com/q/29705135
tags question: http://stackoverflow.com/q/29837476

http://stackoverflow.com/a/29807964
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29807849
type: Answer
score: 1
has body: You can catch links that don't start with an = nor a quote before the http/s: str.match(/[^=\"](http[^\s]+)/i)

http://stackoverflow.com/comment/47789792
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29831406
has text: This looks like an culture problem. Please ensure that the data send to the server can be parsed on the server side. You should have a look with fiddler what is actually transferred. In all cases you should try to send the information in a neutral format (i.e. yyyy-MM-dd HH:mm:ss)

http://stackoverflow.com/comment/47733566
has text: Is there a way to also make it check all of the sub nodes?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29802656
score: 0

http://stackoverflow.com/a/40366048
score: 0
has body: The answer by Keval didn't work for me because he's resetting the value of the model, which puts the toggle button to its original position. So the proper answer would be to create a toggle like the following. Test toggle And then write the controller as follows. .controller('ContactCtrl', function($scope, $interval) { $scope.value = false; $scope.toggleChange = function() { console.log('testToggle changed to ' + $scope.value); }; }
answers question: http://stackoverflow.com/q/29790767
type: Answer

http://stackoverflow.com/q/29822849
tagged with: parse-platform
has title: parse.com bind this to success block
accepted answer: http://stackoverflow.com/a/29823161
type: Question
type: AnsweredQuestion
has body: I have a simple nested query but I can't figure out how to bind the "this" variable to the success block. I'm including a few extra lines of code to give a little more context. initialize: function() { _.bindAll(this, 'addAll', 'addOne', 'logOut', 'newJob', 'showDetail'); this.$el.html(_.template($("#manage-jobs-template").html())); this.jobs = new JobList; this.requests = new RequestList; this.jobs.query = new Parse.Query(Job); this.jobs.query.equalTo('jobPostedBy', Parse.User.current()); this.jobs.fetch({ success: function (jobs) { //This is undefined here. this.requests.query = new Parse.Query(Request); this.requests.query.containsAll("job", jobs); this.requests.fetch(); } });
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29823161

http://stackoverflow.com/a/29813078
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: The problem was that my dataAPI method getIndex was using an external library (q) to resolve the request, rather than leaving it up to angular's $http and $q. So I needed to call $scope.$apply() after setting the scope variable to alert angular of the change. Or just use angular's built in $q or work with the promise returned by $http.
answers question: http://stackoverflow.com/q/29812728

http://stackoverflow.com/comment/47658793
score: 0
has text: Arrays and Objects are exceptions. They share same reference. You need to learn about those :)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29763603

http://stackoverflow.com/a/29818336
answers question: http://stackoverflow.com/q/29817384
score: 0
has body: I've had this before with dynamic controls. Creating multiple items with the same object reference seems to mess things up. Try creating a class that inherits from LinkButton and use that in your read loop. public class myButton : LinkButton { public myButton(SqlCommand sqlCmd) { var myReader = (SqlDataReader) sqlCmd.ExecuteReader(); var training = myReader["ServiceCenter"].ToString() + " - " + myReader["Description"].ToString(); ID =myReader["ID"].ToString(); ForeColor = Color.FromArgb(64, 64, 64); BackColor = Color.FromArgb(192, 192, 192); Attributes.Add("onclick", "return getItems();"); Click += new EventHandler(lnk_Click); Text = training + "&lt;br/&gt;&lt;br/&gt;"; Style.Add("cursor", "pointer"); } }
type: Answer

http://stackoverflow.com/comment/47722755
type: AnswerComment
comment on: http://stackoverflow.com/a/29796666
score: 0
type: Comment
has text: Are you aware this doesn't work? I would recommend testing your answers before submitting them.

http://stackoverflow.com/comment/47534928
type: QuestionComment
has text: may be I get an string from myalgorithm $a and I do some function with user email and this string and I get a true or false which says user exist in table or not.
comment on: http://stackoverflow.com/q/29698769
score: 0
type: Comment

http://stackoverflow.com/comment/47601369
type: Comment
has text: > Consider what happens with rejections - they will block your whole queue. You might want to .catch them for the queuing promise. Am I not catching them with the error handler? > See here for a more complete example. The example is not WinJS unfortunately.
type: AnswerComment
comment on: http://stackoverflow.com/a/29700110
score: 0

http://stackoverflow.com/a/29724605
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29723994
type: Answer
answers question: http://stackoverflow.com/q/29723994
has comment: http://stackoverflow.com/comment/47590037
has body: Drawing charts inside hidden divs breaks the dimension detection algorithms in the Visualization API. This is why when the div is exposed via hover everything works fine, but when it's hidden it all goes to hell. The simplest solution is to explicitly set the chart height and width options to pixel values rather than percentages. related: resizable-google-visualization-inside-jquery-accordion
score: 0

http://stackoverflow.com/a/29775407
has body: Because the values are not an array. Remove the quotes around the strings that look like an array. { 'OriginalColorHex': ["#000000","#006565","#cccc99"],'ModifiedColorHex':["#3366CC","#cc5500","#3366cc"],'OriginalColorRGB': ["rgb(0,0,0)","rgb(0,101,101)","rgb(204,204,153)"],'ModifiedColorRGB':["rgb(51, 102, 204)","rgb(204, 85, 0)","rgb(51, 102, 204)"],'fileName':'179.svg' }
upvote count: 4
answers question: http://stackoverflow.com/q/29775348
downvote count: 0
score: 4
type: Answer

http://stackoverflow.com/comment/47589779
has text: Sorry, I do not know.Can I teach me this.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29727981
score: 0

http://stackoverflow.com/q/29767122
has comment: http://stackoverflow.com/comment/47669956
has body: I'm trying to get some JSON data from a REST API, but when I call it cia an AJAX request with dataType param as jsonp it gives me an error that the jQuery 'callback was not called'. This is the error message: Error: Status: parsererror Message: Error: jQuery2130732580496231094_1429605569499 was not called So, if I try to make this request without jsonp, using JSON as the dataType, it gives me another error about the CORS: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. I know this is an idiot question, but I've read about CORS and just don't get where to put it's params to enable it. For me, the right is to use the first method that I've used, but after looking for an answer for that problem, I just don't understand anything. If someday I could understand where to put the CORS I should be use to make the request as another way. So they are my questions, here is my code: $.ajax({ url: 'eztvapi.re/shows/1';, type: 'GET', dataType: 'jsonp', crossDomain: true, success: function(data) { //data = JSON.parse(data); console.log(data); }, error: function(jqXHR, textStatus, errorThrown) { console.log("Error: Status: " + textStatus + " Message: " + errorThrown); } }); This are my headers request from the console: Remote Address:216.58.222.12:443 Request URL:http://eztvapi.re/shows/1?callback=jQuery213010618196451105177_1429606458524&amp;_=1429606458525 Request Method:GET Status Code:200 OK Response Headers cache-control:private content-encoding:gzip content-type:application/json; charset=utf-8 date:Tue, 21 Apr 2015 08:54:22 GMT etag:W/"0hnqCn40L98JLmwY2UfUlg==" server:nginx status:200 vary:Accept-Encoding via:1.1 Chrome-Compression-Proxy x-powered-by:Express x-response-time:32ms x-served-by:us-la3 Request Headers :authority:eztvapi.re :method:GET :path:/shows/1?callback=jQuery213010618196451105177_1429606458524&amp;_=1429606458525 :scheme:http accept:*/* accept-encoding:gzip, deflate, sdch accept-lang…
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29767341
has comment: http://stackoverflow.com/comment/47665500
has comment: http://stackoverflow.com/comment/47665274
has comment: http://stackoverflow.com/comment/47665348
downvote count: 0
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29767407
type: Question
has comment: http://stackoverflow.com/comment/47665295
upvote count: 1
has title: can't get json data, giving Cors or callback error
tagged with: http://stackoverflow.com/tag/json
answer count: 3
has answer: http://stackoverflow.com/a/29788859
tagged with: cors

http://stackoverflow.com/comment/47707628
type: QuestionComment
comment on: http://stackoverflow.com/q/29789202
score: 0
has text: You can attach events through `addEventListener` in JavaScript or in much cleaner way using jQuery.
type: Comment

http://stackoverflow.com/q/29802508
type: Question
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29802698
tagged with: arrays
tagged with: javascript
tagged with: php
has title: Store bidimensional array from Javascript in Cookie
has comment: http://stackoverflow.com/comment/47734235
possible better answer: http://stackoverflow.com/a/29802698
has answer: http://stackoverflow.com/a/29802593
tagged with: store
accepted answer: http://stackoverflow.com/a/29802593
type: AnsweredQuestion
tagged with: cookies
has body: First of all, thanks to everyone that's reading that and trying to help me! I got an online shop and i have a bi-dimensional array with the products like that: 1. $arrayProducts[id][0] -&gt; id 2. $arrayProducts[id][1] -&gt; product name 3. $arrayProducts[id][2] -&gt; price etc.. I know isn't the best way to do the system, but it's done like that. Now, I want to store that bi-dimensional array in a cookie, because what I want to do is to store the cart from the user if they go away from my page, and load that again when they come back. I think the best way to do it is with cookie, but I don't know if I should do a json_encode and json_decode with that bi-dimensional array, or what is the best way to fix my problem.

http://stackoverflow.com/comment/47596750
comment on: http://stackoverflow.com/a/29729832
has text: @mohamedrias can u give in code example please, I just can't find the way out!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47676166
comment on: http://stackoverflow.com/q/29772701
score: 0
type: Comment
type: QuestionComment
has text: `$(this).parent().append(divCache);` should work.

http://stackoverflow.com/comment/47778256
score: 0
type: QuestionComment
type: Comment
has text: Also how can i call the functions multiple times one after another using .then()....and also expect the browser not to become unresponsive
comment on: http://stackoverflow.com/q/29825652

http://stackoverflow.com/q/29807548
has answer: http://stackoverflow.com/a/29835740
type: Question
accepted answer: http://stackoverflow.com/a/29835740
has title: Allow first-time creation of data in Firebase, then restrict access
answer count: 1
downvote count: 0
tagged with: javascript
has body: I'm looking for a solution to allow first-time creation of data in Firebase and then subsequently restricting access to the owner of that data (or an administrator). Essentially, I've created a signup process for a business, which creates both a user in Firebase as well as an associated user for that business. Unfortunately, with my current schema and security rules, I'm getting permission_denied errors. Here's my current schema, which was generated by EmberFire using a hasMany &lt;--> belongsTo relationship between the business and employee model: + businesses + business_id (generated by EmberFire) - name + employees - employee_id - employee_id + employees + employee_id (generated by Firebase's auth system) - first name - last name - business_id - role (ex: 99 for admin) And here are my security rules: { "rules": { "businesses": { // allows only administrators of the business to read and write business data "$business_id": { ".read": "root.child('employees/' + auth.uid + '/business').val() === $business_id &amp;&amp; root.child('employees/' + auth.uid + '/role').val() === 99", ".write": "root.child('employees/' + auth.uid + '/business').val() === $business_id &amp;&amp; root.child('employees/' + auth.uid + '/role').val() === 99" } }, "employees": { // only allow employees to read/write their own data or the admin of the business they belong to "$employee_id": { ".read": "auth.uid === $employee_id || (root.child('employees/' + auth.uid + '/role').val() === 99 &amp;&amp; root.child('businesses/' + (root.child('employees/' + auth.uid + '/business').val()) + '/employees/' + $employee_id).exists())", ".write": "auth.uid === $employee_id || (root.child('employees/' + auth.uid + '/role').val() === 99 &amp;&amp; root.child('businesses/' + (root.child('employees/' + auth.uid + '/business').val()) + '/employees/' + $employee_id).exists())" } } } } Can anyone recommend an updated set of security rules/schema that would allow for data to be initially created during signup and …
has comment: http://stackoverflow.com/comment/47745053
tagged with: emberfire
favorite count: 0
tagged with: firebase-security
upvote count: 2
has comment: http://stackoverflow.com/comment/47746306
tagged with: firebase
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/47748757

http://stackoverflow.com/comment/47800694
score: 0
comment on: http://stackoverflow.com/a/29834332
type: Comment
has text: @Markus - You need the path to your own module in this: `var io = require("path to your module").getIO();`. My answer had a typo there which I have now fixed. FYI, relative paths are tricky to get right for node modules. So, you will need to make sure all modules are being found properly. Also, I wonder why you took the useful Error messages out and replaced them with just ERR. That won't tell someone using this what they did wrong or where the error even came from.
type: AnswerComment

http://stackoverflow.com/comment/47628679
type: QuestionComment
comment on: http://stackoverflow.com/q/29748058
score: 0
has text: @dfsq `JSON` is short for `JavaScript Object Notation`. Since this is a JavaScript object it obviously has to do with `JSON`
type: Comment

http://stackoverflow.com/comment/47617252
score: 0
has text: @jeroen Hi i didnt copy the session ID when pasting here. But it matches as expected. sample.php: b1646cb8ab5190c1c55dc42a4b83f76e array(1) { ["test"]=> string(5) "hello" } hello b1646cb8ab5190c1c55dc42a4b83f76e array(1) { ["test"]=> string(5) "hello" } b1646cb8ab5190c1c55dc42a4b83f76e array(0) { }
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29741671

http://stackoverflow.com/q/29716068
has comment: http://stackoverflow.com/comment/47568007
score: 2
answer count: 1
downvote count: 0
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: animation
has body: I've got a GIF animation that I use thoughout my site as a saving/loading icon: Because of edges on different background colors, I'd like to change it to a PNG animation. When I want to show a loader at this moment I only have to make sure the following span is visible: &lt;span class="loader"&gt;&lt;/span&gt; There are several ways how this span be inserted in the document: through knockout visible binding, through JS, only by stylesheets etc. Problem I don't want my animation code to be aware of how this span ended up visible on the document, I just want him to animate it. Of course scanning the whole document every frame (16 fps) for potential new spans with the 'loader' class, just to know which position properties need to be animated is not quite performant. So what would be a good performant way to do a document wide png animation? Note that I do need to support IE8 :(
tagged with: css
tagged with: http://stackoverflow.com/tag/png
has comment: http://stackoverflow.com/comment/47567835
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29716614
has title: Most performant way to do document wide PNG animation

http://stackoverflow.com/q/29768377
tagged with: php
has title: Google Analytics Ecommerce Tracking Data Issue
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/39693970
has answer: http://stackoverflow.com/a/39693970
type: Question
tagged with: google-analytics
tagged with: javascript
has answer: http://stackoverflow.com/a/29768587
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/29768587
has answer: http://stackoverflow.com/a/29820804
has body: The Google Analytics example code for tracking ecommerce in the new analytics.js instead of ga.js gives data in the fields where I have $product['name'] etc. The code below currently doesn't work and I'm not 100% sure it's pulling the correct information onpage as this is what is shown in the page source instead of 'id': '{1455}', it's showing 'id': '{$order_query['order_id']}',. We're using Opencart 1.5.5.1. Is this the correct code? Are the $price, $product['name'] sections correct? &lt;script&gt; (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-21397982-1', 'auto'); ga('send', 'pageview'); ga('require', 'ecommerce', 'ecommerce.js'); ga('ecommerce:addTransaction', { 'id': '{$order_query['order_id']}', 'revenue': '{$price}', }); ga('ecommerce:addItem', { 'id': '$order_query['order_id']', 'name': '{$product['name']}', 'sku': '{$product['model']}', 'price': '{$product['price']}', 'quantity': '{$product['quantity']}', 'currency': 'GBP' }); ga('ecommerce:send'); &lt;/script&gt;

http://stackoverflow.com/a/67560201
type: Answer
has body: Too low rep, can't add comment so I'm adding it as an answer here. In advance, apologies for the wall of text. I like CTS_AE's answer, and wanted to take the same route. However, there is one thing to note, and that is how are arrays put to String. let memory = {}; memory[[1,2,3]] = "123"; console.log(memory[[1,2,3]]); // "123" console.log([1,2,3].toString(); // "1,2,3" console.log(memory["1,2,3"]); // "123" Now this wouldn't be such an issue if you knew what you were putting in are exclusively arrays... or would it? MDN about Array.prototype.toString() says For Array objects, the toString method joins the array and returns one string containing each array element separated by commas. Which brings 2 big issues: indexing via array is the same as indexing via array.toSring() since toString() is recursive, nested arrays end up being stringified into the same format as single-level arrays. let memory = {}; memory[[1,2,3]] = "123"; console.log(memory[[1,2,3]]); // "123" console.log(memory["1,2,3"]); // "123" console.log(memory[[[1],[2],[3]]]); // "123" console.log(memory[[[[1],2],3]]); // "123" ...and the list goes on. It's not hard to see when these issues can really break your project. I encountered such issue just a while ago when I tried memoizing function doSomeStuff(string, sourceIdxs, targetIdxs) { if (memostring, sourceIdxs, targetIdxs) return memostring, sourceIdxs, targetIdxs; // ... } In such case for example ["foo", [1, 3, 5], [6, 10]] and ["foo", [1, 3], [5, 6, 10]] point to the same value, and I ended up overwriting existing values, effectively corrupting the function memory. Now, in the specific case of the ArraySet answer above, the issue persists. While you don't mind if you overwrite existing key with another "same" key, you can end up getting false positives. So how to fix this? Option 1. stringify The easy way out is using JSON.stringify() to write the "exact" string representations of all the key data. let memory = {}; memory[JSON.stringify([…
has comment: http://stackoverflow.com/comment/136436554
upvote count: 7
score: 7
downvote count: 0
answers question: http://stackoverflow.com/q/29760644

http://stackoverflow.com/comment/47808901
comment on: http://stackoverflow.com/q/29840935
score: 0
type: Comment
type: QuestionComment
has text: Ah ok thanks! $('#image').attr('src',''); doesnt work either, i will try to hide it thanks!

http://stackoverflow.com/comment/47720004
score: 0
type: Comment
type: QuestionComment
has text: I would not be able to reproduce it... If I use the browser natively, there are no issues. It only occurs when its in the WebBrowser control. Unless jsfiddle can simulate a c# WebBrowser control.
comment on: http://stackoverflow.com/q/29752190

select
tags question: http://stackoverflow.com/q/29767801
tags question: http://stackoverflow.com/q/29751888
tags question: http://stackoverflow.com/q/29720528
tags question: http://stackoverflow.com/q/29700565
type: Tag
tags question: http://stackoverflow.com/q/29692760
tags question: http://stackoverflow.com/q/29699820
tags question: http://stackoverflow.com/q/29713274
tags question: http://stackoverflow.com/q/29844746
tags question: http://stackoverflow.com/q/29792045
tags question: http://stackoverflow.com/q/29842749
tags question: http://stackoverflow.com/q/29715718
tags question: http://stackoverflow.com/q/29737898
tag name: select

http://stackoverflow.com/a/29777800
score: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29777739
answers question: http://stackoverflow.com/q/29777739
upvote count: 2
type: Answer
has body: You can use filter() to check for select elements where the value is still ''. Try this: var $unchosenSelects = $('.paraquien').filter(function() { return $(this).val() == ''; }); if ($unchosenSelects.length) { // there was at least one select within nothing chosen... } Similarly you could use map() to get all the values in an array, then $.inArray to check for empty strings: var chosenValues = $('.paraquien').map(function() { return $(this).val(); }); if ($.inArray(chosenValues, '') != -1) { // there was at least one select within nothing chosen... }
downvote count: 0

http://stackoverflow.com/q/29712336
tagged with: animation
has comment: http://stackoverflow.com/comment/47561858
tagged with: plugins
answer count: 0
has body: Creating my own jQuery plugin to handle image sequences. Everything works perfectly when there is only one image sequence going on. However, when I have 2 image sequences on the page at once (both with infinite looping), the smaller of the 2 image sequences stops prematurely. It reaches it's 2nd loop and always stops at frame 34 (out of 38). I think this might be an issue where the 2nd sequence is grabbing from the variables of the first, but I'm not sure. Everything works great up to this, so I am not sure. Here is the code below, sorry if it's a lot to take in. (function ( $ ) { $.fn.createSequence = function( sequence ) { var container = this; var dir = sequence.dir; var name = sequence.name; var extension = sequence.extension; var start = sequence.start; var end = sequence.end; var fps = 1000 / sequence.fps; var trailing = sequence.trailing || true; var digits = sequence.digits; var loopType = sequence.loopType || 'none'; var loopAmount = sequence.loopAmount || 'infinite'; this.currentLoop = 0; var zeroes = ''; var reverse = false; // Prepare current frame using starting frame var currentFrame = start; // Function for adding trailing zeroes function calcTrailing(amount){ zeroes = ''; for ( i = 0; i &lt; amount; i++ ) { zeroes = zeroes + '0'; } } // Prepare zeroes variable based on number of digits if (trailing) { calcTrailing(digits); } // Build full source var fullSource = dir + name + zeroes + extension; // Append first frame to container container.append('&lt;img src="' + fullSource + '" /&gt;'); // Put added img element into variable for use var imgElement = container.children('img'); // Change img src function changeSrc(frameNumber) { fullSource = dir + name + zeroes + frameNumber + extension; imgElement.attr('src', fullSource); } // Go to next frame function nextFrame() { if (reverse) { if (currentFrame == start) { ++this.currentLoop; reverse = false; clearInterval(animation); restartAnimation(); } else { --currentFrame; } } else { ++currentFrame; } if ( c…
type: UnansweredQuestion
has title: Custom jQuery Plugin Possible Variable Issue
has comment: http://stackoverflow.com/comment/47561198
has comment: http://stackoverflow.com/comment/47562199
type: Question
has comment: http://stackoverflow.com/comment/47562274
tagged with: javascript
tagged with: variables
tagged with: jquery
has comment: http://stackoverflow.com/comment/47561750
score: 0

http://stackoverflow.com/q/29777189
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29777240
tagged with: jquery
has title: Ajax not working properly when I tried to call it on same page again
score: 6
has answer: http://stackoverflow.com/a/29777240
favorite count: 0
tagged with: ajax
type: Question
has comment: http://stackoverflow.com/comment/47685211
has answer: http://stackoverflow.com/a/29778325
upvote count: 6
accepted answer: http://stackoverflow.com/a/29778325
answer count: 2
has comment: http://stackoverflow.com/comment/47687270
has comment: http://stackoverflow.com/comment/47686696
tagged with: php
has body: I have a PHP page which has two sections (top and bottom). The top section has a table where I have options to Edit the data. Once the Edit button is pressed, the content is loaded at the bottom of page and the user can change the data. Here is part of my PHP page: &lt;div id="product_entry_&lt;?php echo $id?&gt;" class="product_entry_&lt;?php echo $id?&gt;"&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=2px&gt;&lt;?php echo $date?&gt;&lt;/font&gt;&lt;/td&gt; &lt;td&gt;&lt;font size=2px&gt;&lt;?php echo $ProductName?&gt;&lt;/font&gt;&lt;/td&gt; &lt;td&gt;&lt;font size=2px&gt;&lt;?php echo $Category.' / '.$SubCategory?&gt;&lt;/font&gt;&lt;/td&gt; &lt;td&gt;&lt;font size=2px&gt;&lt;?php echo $MRP.' / '.$Price?&gt;&lt;/font&gt;&lt;/td&gt; &lt;td&gt;&lt;button type="submit" class="btn btn-primary btn-xs" style="padding:2px 2px;font-size: 9px;line-height: 10px;" onClick="DirectPromoteSubmit(&lt;?php echo $id?&gt;)"&gt;Promote&lt;/button&gt;&lt;/td&gt; &lt;td&gt;&lt;button type="submit" class="btn btn-primary btn-xs" style="padding:2px 2px;font-size: 9px;line-height: 10px;" onClick="RePromoteSubmit(&lt;?php echo $id?&gt;)"&gt;Edit&lt;/button&gt;&lt;/td&gt; &lt;td&gt;&lt;button type="submit" class="btn btn-primary btn-xs" style="padding:2px 2px;font-size: 9px;line-height: 10px;" onClick="DelPromoteSubmit(&lt;?php echo $id?&gt;)"&gt;X&lt;/button&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/div&gt; &lt;!-- page where data is loaded --&gt; &lt;div class="box box-warning" id="RePromoteReplace"&gt; ....some html content here... &lt;/div&gt; Here is my Javascript: function RePromoteSubmit(id){ //alert('got into Edit Promotions'); var dataString = "id="+ id; alert(dataString); if(dataString=='') { alert('Some Problem Occurred, Please try Again'); } else { //alert('into post'); $.ajax({ type: "POST", url: "SellerPanel/post_repromote.php", data: dataString, cache: false, success: function(html){ //$("#tweet").val(''); //$("#preview").hide(); $("#RePromoteReplace").replaceWith(html); alert('Product Succ…
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/a/29782569
downvote count: 0
has comment: http://stackoverflow.com/comment/47695038
has body: The simple fix is to add a check: if (document.getElementById("a") !== null) { document.getElementById("a").onclick = function () /* .. */ }; } jQuery will never break on missing elements, it just silently fails. You can argue about whether that is good or not. The trick jQuery uses is that it will always return something. $("#id") will return a jQuery wrapper. That wrapper has functions like .on and .load and .html. A selector can match one, more or no elements. For the wrapper it doesn't matter how many elements are matched. It works like this: var elem = get_element("a"); elem.onclick(callback); function get_element(id) { var elem = document.getElementById(id); return { // return a wrapper onclick: function (callback) { if (elem !== null) { elem.onclick = callback; } else { // silently fail } } }; }
type: Answer
has comment: http://stackoverflow.com/comment/99150346
upvote count: 15
accepted answer of: http://stackoverflow.com/q/29782547
type: AcceptedAnswer
score: 15
answers question: http://stackoverflow.com/q/29782547

http://stackoverflow.com/comment/47793161
score: 4
comment on: http://stackoverflow.com/q/29833221
type: QuestionComment
type: Comment
has text: How do you get the commented results ? I'm getting http://jsfiddle.net/seyenaz/gqrafdot/

http://stackoverflow.com/a/29814835
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29814425
has body: This incident as JavaScript Variable hosting issue. for ex: var value = "a"; function test() { var value; alert(value) } test(); the global variable return undefined error. same code as works fine as below var value = 10; function test() { var value ="b"; alert(value); } test(); online reference : http://techslides.com/understanding-javascript-closures-and-scope http://stackoverflow.com/questions/9085839/surprised-that-global-variable-has-undefined-value-in-javascript

http://stackoverflow.com/comment/47701048
comment on: http://stackoverflow.com/a/29785564
has text: You mutate the same reference. So `startDate === endDate`
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29729814
linked to: http://stackoverflow.com/q/29737885
has title: Javascript Edit-Delete Function from a looped Textbox with Values
possible better answer: http://stackoverflow.com/a/29729882
has answer: http://stackoverflow.com/a/29729882
type: AnsweredQuestion
type: Question
has body: I am new to web development and I am trying to add an add/edit/delete function to my displayed form values using Javascript. Well, I cant really find the words to explain but this is what Im trying to accomplish. I have this loop that lists discounts from a database: @foreach (var discount in Model.Discounts) { @discount.Key.DiscountName Remove Edit } Add Discount As you can imagine this will loop into this kind of output: Label1 [Textbox for Label1] Delete Edit Label2 [Textbox for Label2] Delete Edit Label3 [Textbox for Label3] Delete Edit How can I make these commands work using javascript/jquery. Please note that the delete/edit function only applies to the displayed data and not the database. what I meant is if I click Delete, it will delete its corresponding Label and Textbox from the display only and not in the database, also when Edit is clicked, it will only enable the textbox to alter the data inside it. Any help will be greatly appreciated. Thank you so much!! I am using Visual Studio 2013 and developing this using ASP.NET MVC4 Follow up: I was wondering how can I automatically compute the total value of the textboxes and display it in a Total Discount textbox. Please note the Edit and Delete function of my list should affect the total when I edit, or delete a discount. I have tried to search for the solution but all I see have fixed texboxes with class name each unlike mine that has indefinite amount of textboxes looped from a database. Any help will be greatly appreciated!!
tagged with: c#
answer count: 2
has answer: http://stackoverflow.com/a/29729934
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29729934
score: 0

http://stackoverflow.com/q/29737024
tagged with: stringify
tagged with: javascript
answer count: 3
accepted answer: http://stackoverflow.com/a/29737150
has answer: http://stackoverflow.com/a/29737190
has title: JSON.stringify(array) surrounded with square brackets
tagged with: sqlite
downvote count: 0
has answer: http://stackoverflow.com/a/29737303
favorite count: 0
possible better answer: http://stackoverflow.com/a/29737303
has comment: http://stackoverflow.com/comment/47607192
tagged with: node.js
score: 14
type: AnsweredQuestion
upvote count: 14
has answer: http://stackoverflow.com/a/29737150
tagged with: http://stackoverflow.com/tag/json
has body: I'm trying to get an array of data to insert into multiple columns in an sqlite database, I'v got it almost working with this: function InsertData(dbData){ var valueArray = [], dataArray = []; var values = Object.keys(dbData); for(var key in values){ valueArray[valueArray.length] = values[key]; dataArray[dataArray.length] = dbData[values[key]]; } console.log("INSERT INTO "+dbData.table+" ("+valueArray+") VALUES ("+JSON.stringify(dataArray)+")"); dbData.database.serialize(function(){ dbData.database.run("INSERT INTO "+dbData.table+" ("+valueArray+") VALUES ("+JSON.stringify(dataArray)+")"); }); } My data is constructed as so: //app.js function EventData(title, value, other){ this.title = title; this.value = value; this.other = other; } EventData.prototype = new dbtools.DBData(usuevents, 'event'); var thisEventData = new EventData('newData', 4, 2); //dbtools.js DBData = function(database, table){ this.database = database; this.table = table; }; the console.log outputs INSERT INTO event (title,value,other) VALUES (["newData",4,2]) I just need the [] square brackets removed on (["newData",4,2]). How would I do this? Also if there is a better way to insert data into sqlite im open to suggestions. Thanks
type: Question

http://stackoverflow.com/a/78042099
has body: If the time spans over midnight you need to do this: const timeStringToDate = (timeString: string, now: Date) =&gt; { const [hours, minutes] = timeString.split(':'); const date = new Date(now); date.setHours(parseInt(hours, 10), parseInt(minutes, 10), 0, 0); return date; }; export const isDateBetweenTimes = ( date: Date, startTime: string, endTime: string, ) =&gt; { const startDate = timeStringToDate(startTime, date); const endDate = timeStringToDate(endTime, date); // If interval is e.g. 23:00 - 01:00, then we need to add a day to the end date if (startDate.getTime() &gt;= endDate.getTime()) { endDate.setDate(endDate.getDate() + 1); } // Need to compare with tomorrows date if interval is e.g. 23:00 - 01:00 and date is 00:30 // Otherwise the comparison would only be; is today 00:30 between today 23:00 and tomorrow 01:00 const dateTomorrow = new Date(date); dateTomorrow.setDate(date.getDate() + 1); return ( (date.getTime() &gt;= startDate.getTime() &amp;&amp; date.getTime() &lt;= endDate.getTime()) || (dateTomorrow.getTime() &gt;= startDate.getTime() &amp;&amp; dateTomorrow.getTime() &lt;= endDate.getTime()) ); };
score: 0
answers question: http://stackoverflow.com/q/29785294
type: Answer

http://stackoverflow.com/q/29697131
answer count: 3
has answer: http://stackoverflow.com/a/29697322
tagged with: append
favorite count: 0
upvote count: 1
possible better answer: http://stackoverflow.com/a/29697196
tagged with: each
type: AnsweredQuestion
has body: I got code: $.get( nextLink , function( html ) { $( "#item-cont" ).append($(html).find('#item-cont').html()); }); I want to get only div from item-con with class name .post (all div from this class name), now it getting all div in item-cont (i got deffrents div there). How i can do that? I want to use each eg: $( "#item-cont" ).append($(html).each('#item-cont .post').html()); but it's seems not work.
score: 1
type: Question
has comment: http://stackoverflow.com/comment/47531672
has answer: http://stackoverflow.com/a/29697833
has title: Get - Append and find divs with class name
downvote count: 0
accepted answer: http://stackoverflow.com/a/29697833
has answer: http://stackoverflow.com/a/29697196
tagged with: javascript
tagged with: jquery
tagged with: get

charts
tags question: http://stackoverflow.com/q/29736374
tags question: http://stackoverflow.com/q/29728212
tags question: http://stackoverflow.com/q/29823242
tags question: http://stackoverflow.com/q/29771495
tags question: http://stackoverflow.com/q/29726145
tags question: http://stackoverflow.com/q/29845120
tags question: http://stackoverflow.com/q/29693920
tags question: http://stackoverflow.com/q/29825688
tags question: http://stackoverflow.com/q/29722310
tags question: http://stackoverflow.com/q/29732994
tags question: http://stackoverflow.com/q/29824877
tags question: http://stackoverflow.com/q/29695023
type: Tag
tags question: http://stackoverflow.com/q/29725432
tags question: http://stackoverflow.com/q/29721657
tags question: http://stackoverflow.com/q/29696078
tags question: http://stackoverflow.com/q/29695198
tags question: http://stackoverflow.com/q/29793531
tags question: http://stackoverflow.com/q/29729723
tags question: http://stackoverflow.com/q/29782430
tag name: charts
tags question: http://stackoverflow.com/q/29843307
tags question: http://stackoverflow.com/q/29774848
tags question: http://stackoverflow.com/q/29744803
tags question: http://stackoverflow.com/q/29764183
tags question: http://stackoverflow.com/q/29729796
tags question: http://stackoverflow.com/q/29753234

http://stackoverflow.com/q/29759249
tagged with: jquery
favorite count: 0
has title: inserting li element after a selected li by text
has comment: http://stackoverflow.com/comment/47651187
has comment: http://stackoverflow.com/comment/47650885
tagged with: http://stackoverflow.com/tag/html
has body: I have the following list: Item1 SubItem1 SubItem2 SubItem3 Item2 SubItem1 SubItem2 SubItem3 Item3 SubItem1 SubItem2 SubItem3 Add text , after the element I have two text inputs. The first one is where the user is supposed to write the text that he/she wants to insert after the element specified in the second text input box. The problem is that I don't know how to select the correct li based on its text. I've tried the following using jQuery: $('input[type="button"]').on('click',function(){ $item=$(' ',{ html:$('input')[0].value }); $position=$('input')[1]; $('li:contains("'+$position.value+'")').filter(function() { return $(this).text() == $position.value; }).after($item); }); But that doesn't work. I don't know how to select the item where I am going to insert the object .
tagged with: css
score: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29759492
has comment: http://stackoverflow.com/comment/47651043
has comment: http://stackoverflow.com/comment/47651196
type: Question
accepted answer: http://stackoverflow.com/a/29759492
possible better answer: http://stackoverflow.com/a/29759558
has answer: http://stackoverflow.com/a/29759558
tagged with: javascript
has comment: http://stackoverflow.com/comment/47651021
upvote count: 4
answer count: 3
has answer: http://stackoverflow.com/a/29759681
downvote count: 0

http://stackoverflow.com/comment/47784609
type: Comment
comment on: http://stackoverflow.com/q/29829128
score: 0
has text: When you add the `dataType` JSON, jQuery parses it for you. You're parsing it again, this time parsing an object and getting an error
type: QuestionComment

variables
tag name: variables
tags question: http://stackoverflow.com/q/29746659
tags question: http://stackoverflow.com/q/29784751
tags question: http://stackoverflow.com/q/29766364
tags question: http://stackoverflow.com/q/29705373
tags question: http://stackoverflow.com/q/29724142
tags question: http://stackoverflow.com/q/29750008
tags question: http://stackoverflow.com/q/29712336
type: Tag
tags question: http://stackoverflow.com/q/29810170
tags question: http://stackoverflow.com/q/29822746
tags question: http://stackoverflow.com/q/29792437
tags question: http://stackoverflow.com/q/29737563
tags question: http://stackoverflow.com/q/29758780
tags question: http://stackoverflow.com/q/29699149
tags question: http://stackoverflow.com/q/29738869
tags question: http://stackoverflow.com/q/29762145
tags question: http://stackoverflow.com/q/29771748
tags question: http://stackoverflow.com/q/29711839
tags question: http://stackoverflow.com/q/29705217
tags question: http://stackoverflow.com/q/29689937
tags question: http://stackoverflow.com/q/29816525
tags question: http://stackoverflow.com/q/29721792
tags question: http://stackoverflow.com/q/29732219

qualtrics
tags question: http://stackoverflow.com/q/29801767
tags question: http://stackoverflow.com/q/29714767
tags question: http://stackoverflow.com/q/29836343
type: Tag
tag name: qualtrics

http://stackoverflow.com/comment/47978376
has text: **component.picture** is not there anymore
comment on: http://stackoverflow.com/a/29824391
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29743700
accepted answer: http://stackoverflow.com/a/29743716
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/784929
possible better answer: http://stackoverflow.com/a/29743747
has title: Meaning of !! javascript
downvote count: 2
upvote count: 10
type: Question
has body: I found some code about authentication with angular and i can't understand this trick : authService.isAuthenticated = function () { return !!Session.userId; }; What does !! mean 'different of userId' ? whenever true = !!true = !!!!true =&gt;etc, it don't understand this. Somebody can help me? (https://medium.com/opinionated-angularjs/techniques-for-authentication-in-angularjs-applications-7bbf0346acec for the source , part 'The AuthService')
tagged with: javascript
has answer: http://stackoverflow.com/a/29743740
has answer: http://stackoverflow.com/a/29743744
score: 8
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29743716
linked to: http://stackoverflow.com/q/784929
has answer: http://stackoverflow.com/a/29743747
answer count: 4

http://stackoverflow.com/a/29807145
accepted answer of: http://stackoverflow.com/q/29807089
has body: HTML forms can use arrays as input names. For example: &lt;input type="text" name="child[]"&gt;
answers question: http://stackoverflow.com/q/29807089
score: 5
upvote count: 5
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47570393
type: Comment
type: QuestionComment
has text: or you can define `alertMM()` inside your onload function and use the same `myButton` object
comment on: http://stackoverflow.com/q/29717833
score: 0

http://stackoverflow.com/comment/47643964
has text: Are you looking for [`alert()`](http://www.w3schools.com/js/js_popup.asp)?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29755199
score: 0

http://stackoverflow.com/q/29830978
favorite count: 0
has comment: http://stackoverflow.com/comment/47789104
tagged with: angularjs
upvote count: 2
has comment: http://stackoverflow.com/comment/47790182
has comment: http://stackoverflow.com/comment/47788686
type: AnsweredQuestion
score: 2
tagged with: reflection
has title: How to autowrap a shared object to alias existing functionality while adding instant specific private values
has answer: http://stackoverflow.com/a/29831161
has comment: http://stackoverflow.com/comment/47789255
type: Question
accepted answer: http://stackoverflow.com/a/29831161
has body: I want to be able to create a new object that is effectively an alias of an existing object, except with a new method added to the new object that is not added to the original aliased object. I'm new to javascript, so I don't know if something like what I want already exists and/or is easily implimented. To give a simplified example of my use case consider this: So say I have a shared object foo. For Angular types imagine a service or factory. It looks like this: var foo(){ var array: {}, updateArray: function(value){ array.push(value)}, saveFoo: function(parameters){ //save logic } } say I get sick of constantly passing huge arrays of parameters to foo's save method, so I decide to add a wrapper to foo with some extra logic to make my life easier function addSaveableParameters(foo){ var savedParams={} foo.setParam = function(parameter){ savedParams.push(parameter); } foo.save = function(){ foo.save(savedParams); } return foo } foo=addSaveableParameters(foo); now If I save a parameter one at a time to foo by simply calling my little helper function to add the saveParameter method. However, I'm working with a shared object, an angular factory specifically. If I call addSavableParameters I'm modifying the one version of the foo factory everyone has. More importantly if I have two people that are using my foo service and they each call saveParameters they will both save a parameter to the same shared foo object, which will likely cause them both to be confused when they later call save() and find a second parameter they never added exists on foo. One option to handle this would be to clone foo. However, the original shared foo had an array that others could modify. I want to be aware of changes to that array, if someone changes the original foo's array I want to see those changes, and if I change foo I want others to see my changes. By cloning foo I would create a new instance which has a mere copy of foo's array as of the time it was cloned, it doesn't stay up to date…
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47789416
tagged with: wrapper
answer count: 1

http://stackoverflow.com/comment/47706659
comment on: http://stackoverflow.com/a/29726574
has text: just a little disclaimer of myself: sorting implies more computations than parsing sequencially. I update my answer.
type: Comment
type: AnswerComment
score: 0

http://stackoverflow.com/q/29711556
accepted answer: http://stackoverflow.com/a/29715019
possible better answer: http://stackoverflow.com/a/29713015
has answer: http://stackoverflow.com/a/29713015
type: Question
answer count: 2
tagged with: javascript
score: 2
has title: How to impact the HTML rendering priorities with AngularJS?
tagged with: seo
downvote count: 0
has answer: http://stackoverflow.com/a/29715019
favorite count: 0
tagged with: angularjs
upvote count: 2
has body: I'm prerendering my HTML pages for the search engines bots via PhantomJS through Selenium, so that they can see the fully loaded content. Currently, after PhantomJS reached the page, I'm waiting 5 seconds so that I'm sure everything is loaded. Instead of waiting those 5 seconds every time, one solution I contemplate is to wait until an attribute html-ready on the &lt;body /&gt; tag is set to true: &lt;html ng-app&gt; &lt;head&gt;...&lt;/head&gt; &lt;body html-ready="{{htmlReady}}"&gt; ... &lt;/body&gt; &lt;/html&gt; .controller("AnyController", function($scope, $rootScope, AnyService) { $rootScope.htmlReady = false; AnyService.anyLongAction(function(anyData) { $scope.anyData = anyData; $rootScope.htmlReady = true; }); }) The question is: will the html-ready attribute always be set to true after any view update has been done (e.g. displaying the anyData)? In other words, is it possible that during a laps, the html-ready attribute is true while the page is not fully loaded yet? If yes, how can it be handled?
type: AnsweredQuestion

http://stackoverflow.com/q/29839270
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47804967
upvote count: 9
tagged with: javascript
has answer: http://stackoverflow.com/a/29839360
answer count: 3
has body: I am creating a UI which will contain Milestones and I will be using a progress bar to show this. I am trying to come up with the percentage we are from the date the milestone is set to be completed vs today's date. For example if I have a milestone called "Live to Site" that is set to happen on December 1, 2015, and I put the milestone in on Jan 1st, I want to determine the percentage we are from the start date to the end date. Fiddle: http://jsfiddle.net/zz4c16fx/2/ var start = new Date(2015,0,1), // Jan 1, 2015 - The date we put this milestone in end = new Date(2015,7,24), // June 24, 2015 - The date the milestone is due today = new Date(), // April 23, 2015 p = Math.round(100-((end - start) * 100 ) / today) + '%'; // Update the progress bar $('.bar').css( "width", p ).after().append(p); That was my attempt at it but either my math is wrong or I am thinking about this incorrectly. The number its returning is 99%. I feel that number should be lower seeing how we have 1.5 months left from today. My end result is to show a progress bar that show how close we are to the completion date given the start, end and today's date.
score: 8
favorite count: 0
possible better answer: http://stackoverflow.com/a/29839343
has answer: http://stackoverflow.com/a/29839343
has answer: http://stackoverflow.com/a/29839411
accepted answer: http://stackoverflow.com/a/29839360
type: AnsweredQuestion
has title: Percentage between two dates compared to today

http://stackoverflow.com/a/29768794
type: Answer
answers question: http://stackoverflow.com/q/29768709
has body: Have e try with: 'abcd/data/efgh'.replace(/\/[^/]+\//, '/newtest/') Output: abcd/newtest/efgh
score: 0

http://stackoverflow.com/comment/47640553
score: 0
type: AnswerComment
has text: On a more serious note I am still not sure this really solves the problem, since I do need to publish all the user properties, and I can't specify projection fields without losing some of them. This would be true regardless of what collection I published from.
type: Comment
comment on: http://stackoverflow.com/a/29753954

http://stackoverflow.com/comment/50987017
has text: Thanks I found GMAP for C# so I just used it :)
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29811075

http://stackoverflow.com/comment/47571220
comment on: http://stackoverflow.com/q/29718301
score: 0
has text: The element with the `id` you search for is a `label`, not an `img`. Shouldn't you have `id='image1'` in the ` ` tag instead?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47727424
has text: This had worked! Amazing.. it has stopped moving though and confused if I should add a new object for the snake body. or do I just add another image.. they are all in the directory already.
type: Comment
comment on: http://stackoverflow.com/a/29798659
score: 0
type: AnswerComment

http://stackoverflow.com/q/29779076
has title: Why are serving an html page and clicking/running it different?
has comment: http://stackoverflow.com/comment/47688925
tagged with: localhost
has comment: http://stackoverflow.com/comment/47689365
type: UnansweredQuestion
tagged with: mamp
has body: This might be a beginner's question, but I am really curious. I have HTML/CSS/Javascript project that uses several plugins like dataTables.js, jQuery, modernizr.js etc. The question is, when I run it from the filesystem by clicking it, some elements are very different than running it in the local MAMP server. Why is this? I thought since it's just html and JS, they should be the same. What am I wrong about?
answer count: 0
has comment: http://stackoverflow.com/comment/47689561
tagged with: javascript
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 0

http://stackoverflow.com/comment/47639145
has text: Thank you, I do have access to the server code. I will try that.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29752717
score: 0

http://stackoverflow.com/q/29776426
has answer: http://stackoverflow.com/a/29776476
type: UnansweredQuestion
tagged with: file
tagged with: loaded
type: Question
has body: I apologize in advance that this is such a basic question (I'm a newbie), but I haven't been able to find the answer. I'm working on a WordPress membership site that presents a full post when the visitor is a member, but when a non-member tries to view the page, a file loads ("notMember.php") that basically says "Hey, you're not a member". I've been asked to track how many times this notMember.php is being shown on the site. We're using Google Analytics and I want to record each load of the notMember.php as an event. I understand how to track events in Google Analytics, but what I can't come up with is the code that basically amounts to finding out whether or not notMember.php has been loaded. I basically want a script that says: If (notMember.php has been loaded) { // run GA event tracking code } But I don't know how to come up with that conditional. Can anyone help? Thanks.
answer count: 1
tagged with: javascript
tagged with: jquery
has title: How to use jquery (or JS) to check if a conditionally included file has been loaded
score: 0

http://stackoverflow.com/a/29781083
type: Answer
answers question: http://stackoverflow.com/q/29780983
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29780983
upvote count: 2
type: AcceptedAnswer
has body: In createShare this will be bound to window, as it is inside the function. You could change createShare to a method on the component, and React will autobind it to the component, or bind it to what you expect with Function.prototype.bind Another nice solution is ES6 arrow functions which bind this to the scope they are defined in, but that will take a bit of setup

http://stackoverflow.com/a/29700308
upvote count: 3
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29700145
accepted answer of: http://stackoverflow.com/q/29700145
downvote count: 0
has body: don't use javascript for this, but css @media queries: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries
type: Answer
score: 3

http://stackoverflow.com/comment/47640531
type: AnswerComment
comment on: http://stackoverflow.com/a/29751906
score: 0
has text: Thanks brotha, you answered a lot in one go
type: Comment

http://stackoverflow.com/q/29827233
type: UnansweredQuestion
score: 2
linked to: http://stackoverflow.com/q/28118812
upvote count: 2
has answer: http://stackoverflow.com/a/29827949
has title: Dyamically adding values to WatchGroup in angularjs
type: Question
has body: I've a button in my angular app that will add an input element to my app dynamically. I want to attach model to this element and put it to watch group for tracking any changes. If user add multiple input elements, I want to add all those models in watch group and track which element changed its value. How can I do this? Add
has comment: http://stackoverflow.com/comment/47780801
tagged with: javascript
has answer: http://stackoverflow.com/a/29827897
answer count: 2
downvote count: 0
favorite count: 0
tagged with: angularjs-watch
tagged with: angularjs

http://stackoverflow.com/q/29840613
has title: Preventing jQuery's Datepicker from changing value of button
has comment: http://stackoverflow.com/comment/47807420
answer count: 3
has answer: http://stackoverflow.com/a/29840698
accepted answer: http://stackoverflow.com/a/29840698
favorite count: 0
has body: I have a simple button: &lt;input type=button class=datepicker value='Select Date for payroll' /&gt; &lt;input type=button class=datepicker value='Select Date for ?' /&gt; &lt;input type=button class=datepicker value='Select Date for &gt;' /&gt; and I have a jQuery's Datepicker attached to it: $('.datepicker').datepicker(); But the default action is to change the text/value of the button when a date is picked. I want to leave the default value. Is this possible? I have multiple buttons which need to open a datepicker. When the date is selected on the Datepicker, it will fire a function and deal with the value. But I do not want the value choosen to be updated anywhere. It must be fired on a button click.
downvote count: 2
possible better answer: http://stackoverflow.com/a/29840672
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29840934
type: Question
tagged with: jquery-ui
upvote count: 0
score: -2
has answer: http://stackoverflow.com/a/29840672
tagged with: javascript
has comment: http://stackoverflow.com/comment/47807474
tagged with: jquery
has comment: http://stackoverflow.com/comment/47807454

http://stackoverflow.com/a/29818988
type: Answer
score: 2
upvote count: 2
has body: I understand that you want the filtered data as an array when you perform the search. If so, try this. var table = $('#dashboard-user-list-table').dataTable({ --- --- }); $('##dashboard-user-list-table').on('search.dt', function () { var api = table.api(); //uppercase used for case insensitive search var searchTerm = api.search().toUpperCase(); var filteredData = api.data() .filter(function (value, index) { return value.toString().toUpperCase().indexOf(searchTerm) !== -1; }).toArray(); console.log(filteredData); }); Working fiddle: http://jsfiddle.net/codeandcloud/a8b3ttf7/ Disclaimer: There might be a simpler way. I am not that much of a datatables.net expert
has comment: http://stackoverflow.com/comment/47768891
answers question: http://stackoverflow.com/q/29815967
downvote count: 0

http://stackoverflow.com/a/29721567
has comment: http://stackoverflow.com/comment/47577732
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29721526
answers question: http://stackoverflow.com/q/29721526
type: Answer
downvote count: 0
score: 1
has body: x DEMO window.onload but you can also try: x DEMO body.onload window.onload vs body.onload Use window.onload because it is good to separate your structure from the action.

http://stackoverflow.com/comment/47625901
has text: Yep, it did it! I need the plugin way, and its working ... ! Thnx.
type: AnswerComment
comment on: http://stackoverflow.com/a/29746696
type: Comment
score: 1

http://stackoverflow.com/comment/47716879
comment on: http://stackoverflow.com/a/29776055
type: AnswerComment
type: Comment
score: 0
has text: Wow, thanks for your help, I've updated my question with your code and some little modifications, there are also some comments and problems that have appeared. Hope you can help me again. Thanks in advance.

http://stackoverflow.com/a/29718026
has body: serialize() docs The .serialize() method creates a text string in standard URL-encoded notation. It can act on a jQuery object that has selected individual form controls, such as , , and : $( "input, textarea, select" ).serialize(); Buttons can't be serialized. Only the elements with user inputs can be serialized like textbox, radio button, etc If you place an input box inside the div, you will find it in your console.log. &lt;div id='mybuttons'&gt; &lt;input type="submit" class="buttonbig3" name="btn1" value="1" /&gt;&lt;br /&gt; &lt;input type="submit" class="buttonbig3" name="btn2" value="2" /&gt;&lt;br /&gt; &lt;input id="hidden-qid" type="hidden" name="rias" value="hoge" /&gt; &lt;/div&gt; Now if you try submitting the form, you will get that input text inside the div element. So it's not about child elements here.
answers question: http://stackoverflow.com/q/29717930
score: 0
has comment: http://stackoverflow.com/comment/47581373
type: Answer

http://stackoverflow.com/comment/47686591
comment on: http://stackoverflow.com/a/29777785
has text: Yeah, when I was testing it out I noticed that, the updated version is exactly what I was trying to do, I was unaware of unshift, thank you! :)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/133118532
type: AnswerComment
type: Comment
has text: The issue is, `chart.min.js` is actually trying to "import" stuff, while i'm using plain JS there's not "import" in my case ... so it didn't work. the version of `libs/Chart.js/4.2.1/chart.umd.min.js` or `Chart.min.js` works - because this is a compiled suitable JS file that doesn't import - just bundled with everything, so it will work.
score: 2
comment on: http://stackoverflow.com/a/71795692

http://stackoverflow.com/a/29804031
answers question: http://stackoverflow.com/q/29803998
has body: The line breaks in your source code listing are not part of the string itself. You need to add line break characters (\n) if you want them to be part of the string. If you then convert the string to JSON and convert the JSON back to a string, you may or may not encounter other issues. But the above is the first issue you'll need to address. One trick I've seen to get around multiline weirdness is to not have a multiline string at all but to instead have an array of strings where each string represents one line in the multiline string.
downvote count: 0
has comment: http://stackoverflow.com/comment/47737820
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/47798844
comment on: http://stackoverflow.com/a/29835851
type: AnswerComment
score: 0
type: Comment
has text: I'm not sure how you defined your `getCookie` function, but if the value of `src` is anything other than an empty string, false, null, undefined, or NaN, it will pass.

slidingmenu
tag name: slidingmenu
tags question: http://stackoverflow.com/q/29823424
type: Tag

http://stackoverflow.com/q/29734657
has body: Assuming I had 45° Imagery similar to Google's (I want to draw them by hand, it's a small project) is it possible to use leaflet to display a map in a similar manner Google does? The problem is that I use OSM data to display markers and building outlines on the map but since the 45° Imagery is tilted it requires different projection (at least that's what I think). Is there a simple way of creating a projection that would allow me to correctly display existing OSM data on top of 45° tiles?
tagged with: projection
tagged with: openstreetmap
has answer: http://stackoverflow.com/a/32015955
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Use leaflet to display 45° Imagery
upvote count: 3
type: UnansweredQuestion
tagged with: maps
type: Question
score: 3
tagged with: leaflet

http://stackoverflow.com/comment/47756095
type: Comment
type: QuestionComment
has text: Did you create this or did you generate it with sails? I don't see where you are exporting this
score: 0
comment on: http://stackoverflow.com/q/29813403

http://stackoverflow.com/comment/47548722
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29706164
has text: i did exactly what u told me to do , but the maps didn't load , i tried to set map position this way if(marker) { marker.setPosition(results[0].geometry.location) ; } doesn't work as well

http://stackoverflow.com/comment/47665791
type: QuestionComment
comment on: http://stackoverflow.com/q/29750778
has text: Would it help to plot one dataset to the X11 terminal, use `pause -1` to wait until you adjusted the view point with your mouse, and after create the animation? It's not interactive nor fully automated, but the simplest/ fastest way to do it by hand.
score: 0
type: Comment

http://stackoverflow.com/comment/47664860
comment on: http://stackoverflow.com/a/29756696
score: 0
type: Comment
has text: for eg: ` Sky `
type: AnswerComment

http://stackoverflow.com/q/29776775
has title: Leaflet: update map
has answer: http://stackoverflow.com/a/29776829
type: Question
has answer: http://stackoverflow.com/a/63997538
tagged with: javascript
has answer: http://stackoverflow.com/a/66743899
answer count: 3
downvote count: 0
has body: Here is my function that I use to draw a Leaflet map in my website: function drawTweetMap(points) { if (tweetMap != null) tweetMap.remove(); var london = [51.505, -0.09]; tweetMap = L.map('tweetMap').setView(london, 5); var cloudmadeUrl = 'http://{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.jpg'; var subDomains = ['otile1','otile2','otile3','otile4']; var cloudmadeAttrib = 'Data, imagery and map information provided by MapQuest, OpenStreetMap and contributors, CC-BY-SA'; L.tileLayer(cloudmadeUrl, {attribution: cloudmadeAttrib, maxZoom: 18, subdomains: subDomains}) .addTo(tweetMap); var markers = L.markerClusterGroup(); var points_rand = L.geoJson(points, {onEachFeature: onEachFeature}); markers.addLayer(points_rand); tweetMap.addLayer(markers); tweetMap.fitBounds(markers.getBounds()); } This function is called periodically: mapWatch = setInterval(function() { retrieveCurrentTweetPositions()}, numMinutes*60*1000); in this function: function retrieveCurrentTweetPositions() { var points = retrieveCurrentPositions(); var mapInput = translatePointsInMapFormat(points); drawTweetMap(mapInput); } Unfortunately, if the map is drawn in this way, the result is the following: In other questions I found that it is possible to invalidate the size of the map to fix this problem, so it was suggested to call on startup this function: function updateTweetMapPosition() { setTimeout(function(){ tweetMap.invalidateSize(true);} ,500) } I did so, and this solves the problem during the first map drawing. However, when I try to redraw the map for a second time, the result is as follows: Has anyone experienced this problem? How can I redraw the map with a full loading of its content? Thanks. EDIT Here is the jsFiddle: http://jsfiddle.net/qzpwvqzk/
favorite count: 0
type: UnansweredQuestion
score: 11
upvote count: 11
tagged with: leaflet

http://stackoverflow.com/a/29747837
downvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47669140
answers question: http://stackoverflow.com/q/29747733
has comment: http://stackoverflow.com/comment/47665973
score: 6
type: Answer
has comment: http://stackoverflow.com/comment/47666567
has comment: http://stackoverflow.com/comment/57791307
upvote count: 6
has body: You can use this regex to get URLs outside of tags: (?![^<]*>|[^<>]*<\/)((http:|https:)\/\/[a-zA-Z0-9&#=.\/\-?_]+) See demo We can shorten it a bit, too, with an i option: (?![^<]*>|[^<>]*<\/)((https?:)\/\/[a-z0-9&#=.\/\-?_]+) See another demo Sample code: var re = /(?![^<]*>|[^<>]*<\/)((https?:)\/\/[a-z0-9&#=.\/\-?_]+)/gi; var str = 'Posting a link: http://test.com, posting an image . Posting an actual A tag: http://test.com/test.html'; var val = re.exec(str); document.getElementById("res").innerHTML = "URL Found: " + val[1]; var subst = '$1'; var result = str.replace(re, subst); document.getElementById("res").innerHTML += " Replacement Result: " + result; Update: To allow capturing inside specific tags, you can whitelist them like this: var re = /(?![^<]*>|[^<>]*<\/(?!(?:p|pre)>))((https?:)\/\/[a-z0-9&#=.\/\-?_]+)/gi;
accepted answer of: http://stackoverflow.com/q/29747733

regex
tags question: http://stackoverflow.com/q/29753567
tags question: http://stackoverflow.com/q/29809409
tags question: http://stackoverflow.com/q/29751397
tags question: http://stackoverflow.com/q/29837590
tags question: http://stackoverflow.com/q/29734288
tags question: http://stackoverflow.com/q/29842994
tags question: http://stackoverflow.com/q/29796463
tags question: http://stackoverflow.com/q/29837401
tags question: http://stackoverflow.com/q/29757150
tags question: http://stackoverflow.com/q/29713343
tag name: regex
tags question: http://stackoverflow.com/q/29836745
tags question: http://stackoverflow.com/q/29807849
tags question: http://stackoverflow.com/q/29772432
tags question: http://stackoverflow.com/q/29816318
tags question: http://stackoverflow.com/q/29719597
tags question: http://stackoverflow.com/q/29731686
tags question: http://stackoverflow.com/q/29799740
tags question: http://stackoverflow.com/q/29728757
tags question: http://stackoverflow.com/q/29719571
tags question: http://stackoverflow.com/q/29721971
tags question: http://stackoverflow.com/q/29730535
tags question: http://stackoverflow.com/q/29776741
tags question: http://stackoverflow.com/q/29760408
tags question: http://stackoverflow.com/q/29742463
tags question: http://stackoverflow.com/q/29810843
tags question: http://stackoverflow.com/q/29778716
tags question: http://stackoverflow.com/q/29718702
tags question: http://stackoverflow.com/q/29700713
tags question: http://stackoverflow.com/q/29816309
tags question: http://stackoverflow.com/q/29743984
tags question: http://stackoverflow.com/q/29730964
tags question: http://stackoverflow.com/q/29799463
tags question: http://stackoverflow.com/q/29757171
tags question: http://stackoverflow.com/q/29789076
tags question: http://stackoverflow.com/q/29699871
tags question: http://stackoverflow.com/q/29839793
tags question: http://stackoverflow.com/q/29760965
tags question: http://stackoverflow.com/q/29726805
tags question: http://stackoverflow.com/q/29838328
tags question: http://stackoverflow.com/q/29806159
tags question: http://stackoverflow.com/q/29794071
tags question: http://stackoverflow.com/q/29692732
tags question: http://stackoverflow.com/q/29838803
tags question: http://stackoverflow.com/q/29701472
tags question: http://stackoverflow.com/q/29726156
tags question: http://stackoverflow.com/q/29690512
tags question: http://stackoverflow.com/q/29756893
tags question: http://stackoverflow.com/q/29692914
tags question: http://stackoverflow.com/q/29826226
tags question: http://stackoverflow.com/q/29723696
tags question: http://stackoverflow.com/q/29768709
tags question: http://stackoverflow.com/q/29747733
tags question: http://stackoverflow.com/q/29814234
tags question: http://stackoverflow.com/q/29746408
tags question: http://stackoverflow.com/q/29694292
tags question: http://stackoverflow.com/q/29702412
tags question: http://stackoverflow.com/q/29816199
tags question: http://stackoverflow.com/q/29702499
tags question: http://stackoverflow.com/q/29788349
tags question: http://stackoverflow.com/q/29833245
tags question: http://stackoverflow.com/q/29808726
tags question: http://stackoverflow.com/q/29726981
tags question: http://stackoverflow.com/q/29793089
tags question: http://stackoverflow.com/q/29749493
tags question: http://stackoverflow.com/q/29826239
tags question: http://stackoverflow.com/q/29832438
tags question: http://stackoverflow.com/q/29760277
tags question: http://stackoverflow.com/q/29816982
tags question: http://stackoverflow.com/q/29779437
tags question: http://stackoverflow.com/q/29716743
tags question: http://stackoverflow.com/q/29763922
tags question: http://stackoverflow.com/q/29732756
tags question: http://stackoverflow.com/q/29704872
tags question: http://stackoverflow.com/q/29692822
type: Tag
tags question: http://stackoverflow.com/q/29760551
tags question: http://stackoverflow.com/q/29803495
tags question: http://stackoverflow.com/q/29809728
tags question: http://stackoverflow.com/q/29792136

http://stackoverflow.com/comment/47755873
comment on: http://stackoverflow.com/q/29814158
type: Comment
has text: c = paresInt(a)+parseInt(b)
score: 0
type: QuestionComment

http://stackoverflow.com/q/29776741
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47684538
accepted answer: http://stackoverflow.com/a/29776864
possible better answer: http://stackoverflow.com/a/29777011
type: Question
has answer: http://stackoverflow.com/a/29776828
has answer: http://stackoverflow.com/a/29777011
tagged with: javascript
has answer: http://stackoverflow.com/a/29776827
score: 0
has answer: http://stackoverflow.com/a/29776864
has body: I try to match a word not starts with "t" e.g. /^[^t]est$/.test('test') # false /^[^t]est$/.test('best') # true but when I try to set the length to 2, it doesn't works: /^[^t]{2,2}st$/.test('ttst') # false /^[^t]{2,2}st$/.test('tbst') # false (should be true) /^[^t]{2,2}st$/.test('bbst') # true tbst only contains one t so should not be matched anyone can explain why? thanks
has title: RegExp: Why this regex doesn't match "not starts with" two letter?
tagged with: regex

http://stackoverflow.com/a/29752301
downvote count: 1
answers question: http://stackoverflow.com/q/29752110
upvote count: 0
score: -1
has body: The general consensus in the front-end dev world (IMO) is to add something like a class to your element and then apply a listener. Have a backup link to run your action without JavaScript (if you so wish - putting #null in the href will just make it do nothing), and then add event.preventDefault(); to the events to prevent them from doing the default action of navigating to the other page so your JavaScript can run. Example HTML: Example jQuery: $('li.open').on('click', function(event) { event.preventDefault(); console.log('Open clicked'); }); $('li.delete').on('click', function(event) { event.preventDefault(); console.log('Delete clicked'); }); Example raw JavaScript: document.getElementsByClassName('open')[0].addEventListener('click', function(event) { event.preventDefault(); console.log('Open clicked'); }); document.getElementsByClassName('delete')[0].addEventListener('click', function(event) { event.preventDefault(); console.log('Delete clicked'); });
type: Answer
has comment: http://stackoverflow.com/comment/47636888
has comment: http://stackoverflow.com/comment/47637771

http://stackoverflow.com/comment/47559606
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29711931
has text: Still is wrong based on what I said.

http://stackoverflow.com/a/29795185
upvote count: 3
answers question: http://stackoverflow.com/q/29795058
has body: If you are using that JavaScript function with a PHP file, you can do it: ... var line2 = '&lt;?php echo $_SESSION["line2"]; ?&gt;'; var oline2 = '&lt;?php echo $_SESSION["oline2"]; ?&gt;'; ... To pass JavaScript variable to the PHP, you have to follow these steps: Include JQuery Library in your page (if you don't have yet). Create a PHP page to set the variables (ie: myPage.php). Pass the JS variables with ajax (JQuery) to the myPage.php via POST. myPage.php: &lt;?php session_start(); $_SESSION['line2'] = $_POST['myVariable']; $_SESSION['oline2'] = $_POST['anotherOne']; ... In your JS function: var sth = 'something...'; var sthMore = 'something more...'; $.ajax({ method: "POST", url: "myPage.php", data: { myVariable: sth, anotherOne: sthMore } }).done(function() { // alert('done!'); // here you can alert some message (if you want) });
has comment: http://stackoverflow.com/comment/47720595
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/47724949
has comment: http://stackoverflow.com/comment/47719450
type: Answer
has comment: http://stackoverflow.com/comment/47720243

http://stackoverflow.com/a/32348906
downvote count: 0
type: Answer
score: 6
has body: I had the same issue this morning. Switching to super dev mode: select your project in the Project Explorer -> Debug as -> Web Application(Super Dev Mode) Console will say: The code server is ready. Next, visit: http://127.0.0.1:9876/ Do so and follow instructions there.
upvote count: 6
answers question: http://stackoverflow.com/q/29743214

sesame
tags question: http://stackoverflow.com/q/29779302
tags question: http://stackoverflow.com/q/29785633
tag name: sesame
type: Tag

http://stackoverflow.com/comment/47526354
comment on: http://stackoverflow.com/a/29694639
type: AnswerComment
has text: @radbyx, datatables is backwards compatible regarding naming, in fact the fiddle demo above is in datatables **1.10.6**!! (most recent version); what do you mean by "_lengthMenu: [[10, 25, 50, 100, -1], ["10", "25", "50", "100", "All"]]_", do you want to change the content of the dropdown too? language.sLengthmenu !== lenghmenu
type: Comment
score: 1

http://stackoverflow.com/comment/47725828
type: Comment
comment on: http://stackoverflow.com/a/29798660
score: 0
type: AnswerComment
has text: @Phylogenesis: thanks. should be good after setting the max to actual length of image elements.

http://stackoverflow.com/q/29741667
tagged with: ios
tagged with: javascript
has comment: http://stackoverflow.com/comment/47616832
has comment: http://stackoverflow.com/comment/47619884
score: 0
answer count: 1
has title: Faded in div with jQuery causes content width to be larger than viewport on Mobile Safari
tagged with: jquery
type: UnansweredQuestion
has body: I'm fading in a div with jQuery on a button click. Before the div is faded in the website renders as desired. But when I click the button and the div gets faded in, the site increases in size somehow and I can horizontally. This does not happen if I dont hide and fade in the same div. JS $("#stopp").click(function() { $("#pil").removeClass("rotatePil"); getRotationDegrees(hjul); $("html, body").animate({ scrollTop: $("#third").offset().top}, 1500); //$("html, body").animate({ scrollTop: $(document).height() }, 1500); $("#hvit-boks>h1").fadeOut(500); $("#start,#stopp").fadeOut(500); setTimeout(function() { $("#res").fadeIn(1000); }, 500); setTimeOut(function() { $("html, body").stop(); }, 1500); }); HTML Snurr lykkehjulet! SNURR! STOPP Du fikk 145 Et lykkehjul er tilfeldig. Det er imidlertid ikke tilfeldig hva kundene våre synes om skadeoppgjøret vårt. Faktisk får vi 8,6 i gjennomsnittsscore på en skala fra 0-10 når de blir spurt om hvor fornøyde de er etter en skade. Det skal vi være stolte av! PRØV IGJEN CSS #hvit-boks { width: 90%; padding: 40px 0 40px 0; margin: 0 auto 0 auto; text-align: center; } #hvit-boks h1 { font-size: 30px; } #left { width: 100%; padding: 0; margin: 0; } #big-res { width: 50%; padding: 0; } #res p { width: 80%; padding: 0 0 30px 0; }
tagged with: css
tagged with: safari
type: Question
has answer: http://stackoverflow.com/a/29741883

cocos2d-android
tags question: http://stackoverflow.com/q/29811522
type: Tag
tag name: cocos2d-android

http://stackoverflow.com/a/29768330
type: Answer
score: 2
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/29768070
has body: Try using AVG() of mysql with group by month you should get the output. you can see a tutorial here:here

http://stackoverflow.com/a/29826811
type: Answer
has comment: http://stackoverflow.com/comment/47780951
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29716664
answers question: http://stackoverflow.com/q/29716664
has body: Second answer in brief: taking the question constraints strictly (given data model, one query, given output), I think the problem is over constrained. We can achieve the functional goal by relaxing either the fixed data model or the single query. First, relaxing single query. My answer above I assumed the following data model... Application --1 User (applicant) | --1 Job --1 User (postingUser) ...and suggested a single query of Application where the app job matched a Job via a second implicit inner query. This idea solved most of the problem, but misses Jobs for which there are no applications (INNER JOIN, as you point out). Repairing that error, we could achieve the goal with two explicit queries as follows: var user = // a given user var jobQuery = new Parse.Query("Job"); jobQuery.equalTo("postingUser", user); var jobs = []; jobQuery.find().then(function(results) { // requirement 1: jobs posted by a user jobs = results; var appQuery = new Parse.Query("Application"); appQuery.containedIn("job", jobs); return appQuery.find(); }).then(function(apps) { _.each(jobs, function(job) { // requirement 1.1: jobs' related to apps (trivial to count them) job["applications"] = _.find(apps, function(app) { return app.get("job").id == job.id; }); // requirement 2: decorate jobs where the postingUser is an applicant // could have combined loops above, but looping again for clarity _.each(jobs, function(job) { var posterIsApplicant = _.find(apps, function(app) { return app.get("applicant").id == user.id }); job["posterIsApplicant"] = app.get("user").id == user.id; }); }); }); Alternatively, unconstrained by the data model, but with a single query, we can get the functional result by arranging the data this way: Job --1 User (postingUser) | --&lt; Application (applications) --1 User (postingUser) Here, Job has a pointer to user and an array of pointers (or a relation if you expect the cardinality to be high... my rule of thumb is > 100) to Application. Application could continue to …
upvote count: 1

components
tags question: http://stackoverflow.com/q/29787211
tag name: components
tags question: http://stackoverflow.com/q/29742201
type: Tag

http://stackoverflow.com/comment/47754887
score: 0
type: Comment
type: QuestionComment
has text: What do you think this has to do with prototypes?
comment on: http://stackoverflow.com/q/29812938

http://stackoverflow.com/comment/47666719
type: Comment
comment on: http://stackoverflow.com/a/29766591
score: 0
has text: @Gauls - StackOverflow just isn't set up well for a continuing stream of questions after the first one has been fully answered. I'm often willing to field additional follow-on questions in comments (just to help out) until it gets to the point of we need to be sharing code and larger amounts of info than easily and clearly fit in comments. I think you've passed that threshold here.
type: AnswerComment

http://stackoverflow.com/q/29702931
upvote count: 2
has comment: http://stackoverflow.com/comment/47542123
has title: Converting a JavaScript Countdown to a jQuery Countdown and adding an Interval
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29703296
answer count: 2
has body: I found this JS-Countdown Script at JSFiddle. EDIT: I'm using the code of rafaelcastrocouto now, which is nearly perfect. I wanted a 10-seconds JQuery Countdown-Script with an interval that resets the countdown timer at 5 seconds and starts over again and again, but only for a specific class with a specific id on the whole HTML page. If it drops to 0, the countdown should stop. Also I want to reset specific counters to 10. It's about a WebSocket that refreshes every second and depending on the data I get for specific counters I want to reset them or they should count down to zero. New JSFiddle: http://jsfiddle.net/alexiovay/azkdry0w/4/
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47542293
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29703341
accepted answer: http://stackoverflow.com/a/29703341
possible better answer: http://stackoverflow.com/a/29703296
score: 2

ionic-framework
tags question: http://stackoverflow.com/q/29737469
tags question: http://stackoverflow.com/q/29792166
tags question: http://stackoverflow.com/q/29723710
tags question: http://stackoverflow.com/q/29733057
tags question: http://stackoverflow.com/q/29745058
tags question: http://stackoverflow.com/q/29792248
type: Tag
tags question: http://stackoverflow.com/q/29793316
tags question: http://stackoverflow.com/q/29784776
tags question: http://stackoverflow.com/q/29795998
tags question: http://stackoverflow.com/q/29783567
tags question: http://stackoverflow.com/q/29840892
tags question: http://stackoverflow.com/q/29836239
tags question: http://stackoverflow.com/q/29791900
tags question: http://stackoverflow.com/q/29689826
tags question: http://stackoverflow.com/q/29734464
tags question: http://stackoverflow.com/q/29713098
tags question: http://stackoverflow.com/q/29767476
tags question: http://stackoverflow.com/q/29840090
tags question: http://stackoverflow.com/q/29703076
tags question: http://stackoverflow.com/q/29742404
tags question: http://stackoverflow.com/q/29763130
tags question: http://stackoverflow.com/q/29832416
tags question: http://stackoverflow.com/q/29766164
tags question: http://stackoverflow.com/q/29806692
tags question: http://stackoverflow.com/q/29774123
tags question: http://stackoverflow.com/q/29702852
tags question: http://stackoverflow.com/q/29790767
tags question: http://stackoverflow.com/q/29819173
tag name: ionic-framework
tags question: http://stackoverflow.com/q/29749229
tags question: http://stackoverflow.com/q/29708073
tags question: http://stackoverflow.com/q/29769188

http://stackoverflow.com/comment/47742209
type: Comment
comment on: http://stackoverflow.com/q/29807029
type: QuestionComment
has text: That should work: http://codepen.io/anon/pen/xGxrNM
score: 0

http://stackoverflow.com/a/33563023
score: 2
answers question: http://stackoverflow.com/q/29788181
downvote count: 0
has comment: http://stackoverflow.com/comment/54925440
upvote count: 2
type: Answer
has body: @james emanon - So, you are referring to multiple inheritance (discussed on page 75 in the book "You Don't Know JS: this &amp; Object Prototypes"). And that mechanism we can find in underscore's "extend" function for example. Names of object you stated in your example are a bit mixing apples, oranges and candies but I understand the point behind. From my experience this would be OOLO version: var ObjA = { setA: function(a) { this.a = a; }, outputA: function() { console.log("Invoking outputA - A: ", this.a); } }; // 'ObjB' links/delegates to 'ObjA' var ObjB = Object.create( ObjA ); ObjB.setB = function(b) { this.b = b; } ObjB.setA_B = function(a, b) { this.setA( a ); // This is obvious. 'setA' is not found in 'ObjB' so by prototype chain it's found in 'ObjA' this.setB( b ); console.log("Invoking setA_B - A: ", this.a, " B: ", this.b); }; // 'ObjC' links/delegates to 'ObjB' var ObjC = Object.create( ObjB ); ObjC.setC = function(c) { this.c = c; }; ObjC.setA_C = function(a, c) { this.setA( a ); // Invoking 'setA' that is clearly not in ObjC shows that prototype chaining goes through ObjB all the way to the ObjA this.setC( c ); console.log("Invoking setA_C - A: ", this.a, " C: ", this.c); }; ObjC.setA_B_C = function(a, b, c){ this.setA( a ); // Invoking 'setA' that is clearly not in ObjC nor ObjB shows that prototype chaining got all the way to the ObjA this.setB( b ); this.setC( c ); console.log("Invoking setA_B_C - A: ", this.a, " B: ", this.b, " C: ", this.c); }; ObjA.setA("A1"); ObjA.outputA(); // Invoking outputA - A: A1 ObjB.setA_B("A2", "B1"); // Invoking setA_B - A: A2 B: B1 ObjC.setA_C("A3", "C1"); // Invoking setA_C - A: A3 C: C1 ObjC.setA_B_C("A4", "B2", "C1"); // Invoking setA_B_C - A: A4 B: B2 C: C1 It is simple example but the point shown is that we are just chaining object together in rather flat structure/formation and still have possibility to use methods and properties from multiple object. We achieve same things as with class/"copying the properties" …

http://stackoverflow.com/q/29727808
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29727970
linked to: http://stackoverflow.com/q/20830449
downvote count: 2
has comment: http://stackoverflow.com/comment/47589789
upvote count: 1
has comment: http://stackoverflow.com/comment/47589495
type: Question
has title: Does it matter if my Object returns the wrong constructor, JavaScript?
linked to: http://stackoverflow.com/q/8285575
linked to: http://stackoverflow.com/q/8453887
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47589414
accepted answer: http://stackoverflow.com/a/29727970
answer count: 1
has comment: http://stackoverflow.com/comment/47589552
favorite count: 0
has body: Alright, just looking at the question, it seems like it would matter, but lets look at a test I did. So I created 3 constructor functions. I did the usual Car, then a Mazda, then a MX8 constructor. All of them inherit based on the code in the JSFiddle. Here is a shell of what I did, more detail can be found in the JSFiddle. By the way I'm a big fan of Object.create which doesn't need any babysitting of anything. var Car = function () { //code here } var Mazda = function (type) { this.type = type; //more code here including a simple method test } var MX8 = function () { //more code here } Mazda.prototype = new Car(); MX8.prototype = new Mazda("MX8"); var z = new MX8(); //refer to my JSFiddle z.interior; // got correct interior z.type; // got correct type ie model z.warrantyInfo(); // method was correctly inherited z.speed; // got correct speed z.constructor === MX8; // false (unless I specify the constructor in the code of which is commented out in my JSFiddle)
has comment: http://stackoverflow.com/comment/47589850
has comment: http://stackoverflow.com/comment/47589431

http://stackoverflow.com/q/29732410
type: Question
accepted answer: http://stackoverflow.com/a/29732722
tagged with: javascript
has title: Making an image "move" on canvas
upvote count: 1
tagged with: html5-canvas
answer count: 1
has answer: http://stackoverflow.com/a/29732722
favorite count: 0
has comment: http://stackoverflow.com/comment/47599381
has comment: http://stackoverflow.com/comment/47598612
has comment: http://stackoverflow.com/comment/47599290
type: AnsweredQuestion
downvote count: 0
has body: So I am trying to make an image appear as if it is moving across and canvas and restore the previous background when its next drawn. The following test worked when drawing a basic rectangle. var canvas = document.querySelector('canvas'), ctx = canvas.getContext('2d'); var x = 10, = 10, w = 50, h = 50; var vx = 2; var vy = 2; var back = ctx.getImageData(1,1,1,1); function draw() { ctx.putImageData(back,x, y); x += vx; y += vy; back=ctx.getImageData(x, y, w, h); ctx.fillRect(x, y, w, h); } setInterval(draw, 1000/60); However when substituting the rectangle for an image as follows, it doesnt appear to show point.png and instead the imagedata for "back" appears to move. var canvas = document.querySelector('canvas'), ctx = canvas.getContext('2d'); var x = 10, y = 10, w = 50, h = 50; var vx = 2; var vy = 2; var back = ctx.getImageData(1, 1, 1, 1); function draw() { ctx.putImageData(back, x, y); x += vx; y += vy; back = ctx.getImageData(x, y, w, h); var img = document.getElementById("point"); ctx.drawImage(img, x, y, w, h); } setInterval(draw, 1000 / 60); Can anyone tell me what I am doing wrong and how to fix this?
score: 1

http://stackoverflow.com/comment/47703380
type: AnswerComment
type: Comment
has text: Or in the view just display `{{ details }}` - they should be an empty array at first, and then fill in when the GET returns.
comment on: http://stackoverflow.com/a/29786800
score: 0

http://stackoverflow.com/comment/47791207
type: Comment
comment on: http://stackoverflow.com/a/29782638
score: 0
type: AnswerComment
has text: @nathanvda ok, would love to see how you would do it anyway, if you wouldn't mind. Thanks!

http://stackoverflow.com/comment/47768892
comment on: http://stackoverflow.com/q/29821057
has text: But what is the boder pixel? Your code is missing a condition to check it.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29793155
accepted answer of: http://stackoverflow.com/q/29792400
upvote count: 3
has body: In your html, the trigger attribute should be added: &lt;ns-modal trigger="trigger"/&gt; Note that trigger might be any variable (but you wrote that in the main scope it's called trigger). This because when this is added: scope:{ trigger: "=" }, a new scope for the directive is created. Therefore you should specify every single variable passed to the directive with an attribute;
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 3
answers question: http://stackoverflow.com/q/29792400

http://stackoverflow.com/q/29806278
type: Question
answer count: 2
has title: redirect to same page after submit
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47740688
has answer: http://stackoverflow.com/a/29806385
favorite count: 0
has answer: http://stackoverflow.com/a/29806351
type: UnansweredQuestion
score: 1
has body: I want to submit a form when a file select is changed in my form and be able to redirect to same page. ie: I have this url: http://localhost:3000/worker_steps/basic_info. after dropdown changed, I want the form be submitted and redirect again to http://localhost:3000/worker_steps/basic_info. I have this code in html: &lt;form class="simple_form form-horizontal" novalidate="novalidate" id="edit_user_385" enctype="multipart/form-data" action="/worker_steps/basic_info" accept-charset="UTF-8" method="post"&gt; &lt;input class="file optional" name="user[picture]" id="user_picture" type="file"&gt; //this is th e dropdown select input and in my jquery, I have this atm: $("#user_picture").change(function(){ //window.location = "/worker_steps/basic_info"; $(this).closest("form").submit(); });
upvote count: 1

http://stackoverflow.com/q/29810942
tagged with: yii
tagged with: javascript
tagged with: jquery
has body: Good afternoon i've been struggling with these for 2 days now and i'm running out of time... I have this modal... &lt;div class="modal-header"&gt; &lt;a class="close" data-dismiss="modal"&gt;&amp;times;&lt;/a&gt; &lt;?php if ( $modalToOpen == "1") { ?&gt; &lt;h4&gt;Aplicar abono a la cuenta #&lt;?php echo $cardInformation-&gt;CardNumber ?&gt;&lt;/h4&gt; &lt;?php } ?&gt; &lt;?php if ($modalToOpen == "2") { ?&gt; &lt;h4&gt;Aplicar cargo a la cuenta #&lt;?php echo $cardInformation-&gt;CardNumber ?&gt;&lt;/h4&gt; &lt;?php } ?&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;p&gt;Saldo Actual: &lt;?php echo $lastBalance ?&gt;&lt;/p&gt; &lt;?php echo $modalToOpen ; if($modalToOpen == 1){ ?&gt; &lt;?php $form = $this-&gt;beginWidget('bootstrap.widgets.TbActiveForm', array('id' =&gt; 'inlineForm', 'type' =&gt; 'inline', 'htmlOptions' =&gt; array('class' =&gt; 'well'))); ?&gt; &lt;?php echo $form-&gt;TextField($auxModel, 'Payment', array('size' =&gt; 8, 'maxlength' =&gt; 8, 'placeholder' =&gt; "$. Abono", 'class' =&gt; 'span1')); ?&gt; &lt;?php echo $form-&gt;TextField($auxModel, 'Coment', array('size' =&gt; 250, 'maxlength' =&gt; 250, 'placeholder' =&gt; "Comentario", 'class' =&gt; 'span3')); ?&gt; &lt;?php $this-&gt;widget( 'bootstrap.widgets.TbButton', array( 'buttonType' =&gt; 'ajaxButton', 'type' =&gt; 'primary', 'label' =&gt; 'Guardar', 'url' =&gt; Yii::app()-&gt;createUrl('BusinessTargetCollectionCard/ApplyPayment'), 'htmlOptions' =&gt; array('onclick' =&gt; 'showWait();','id' =&gt;'payment-btn'. uniqid()), 'ajaxOptions' =&gt; array( 'type' =&gt; 'POST', 'dataType' =&gt; 'json', 'data' =&gt; array( 'cardNumber' =&gt; $cardInformation-&gt;CardNumber, 'lastBalance' =&gt; $lastBalance, 'coment' =&gt; 'js:$("#BusinessTargetCollectionCardMovement_Coment").val()', 'payment' =&gt; 'js:$("#BusinessTargetCollectionCardMovement_Payment").val()', 'businessTargetCollectionCardId' =&gt; $cardInformation-&gt;Id, 'collectorId' =&gt; $cardInformation-&gt;CollectorId), 'success' =&…
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29814448
tagged with: php
type: AnsweredQuestion
has title: YII: Assign value to a variable from onclick method
type: Question
has answer: http://stackoverflow.com/a/29814448

http://stackoverflow.com/q/29810409
favorite count: 0
has answer: http://stackoverflow.com/a/29843005
upvote count: 2
type: UnansweredQuestion
tagged with: python
score: 2
has body: We built a tableau workbook and planning to move them to production soon. As part of deployment, we need to document all the filters used in the workbook. Is there any way, I can extract all the filters used in a workbook or configurations done in a workbook? Like an API or any other options to get all at once? Because, we have more than 100 sheets and its really difficult to open all, read and document it manually. Thanks in advance.
type: Question
tagged with: javascript
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/29875586
has title: Download all the filters from tableau workbook
tagged with: tableau-api

http://stackoverflow.com/q/29780430
tagged with: css
downvote count: 1
has comment: http://stackoverflow.com/comment/47694903
has comment: http://stackoverflow.com/comment/47693995
has comment: http://stackoverflow.com/comment/47729448
has comment: http://stackoverflow.com/comment/47694704
has answer: http://stackoverflow.com/a/29805793
score: -1
has comment: http://stackoverflow.com/comment/47691426
type: Question
has body: So, I am in a conundrum with my JS failing after a certain amount of time through the menu navigation. Since it works with the console debugger open, I assumed it was a console.log error, but I have removed those functions. If you open up this page, http://behrent.com/test/Industry.html, in internet explorer, then use either your arrow keys or the menu headers to scroll many times right or left in a row it will break. It currently works in Chrome and FF. It's almost as though the js crashes or something. Any ideas on what might be occurring? My JS doesn't have any console.log. On another page using same css and js, but different html it is also producing scary behavior. http://www.behrent.com/test/Services.html. Basically if you go to that site you can navigate through them if you go slowly, but if you go very quick it will then break in the same fashion as the first page. Just hope I don't have to move to another layout. Chad
has comment: http://stackoverflow.com/comment/47691538
tagged with: internet-explorer
upvote count: 0
has title: Javascript failing on IE works if debugger is open
has comment: http://stackoverflow.com/comment/47691269
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47691927
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/47684538
has text: See my updated answer for a solution.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29776741
type: Comment

http://stackoverflow.com/comment/47816100
type: QuestionComment
type: Comment
has text: you want one map or multiple maps?
score: 0
comment on: http://stackoverflow.com/q/29844905

http://stackoverflow.com/comment/47729229
has text: Fisrtly avoid using `transition: all 0.5s linear 0s;`, set specific properties to set transition on: `transition: width .5s, height .5s;`. Secondly, `width:246.5px;` should be `width:246px;`. Thirdly, you could avoid multiple click by disallowing any click if there is any transition running, handling some logic using `transionEnd` event
type: QuestionComment
comment on: http://stackoverflow.com/q/29800530
score: 3
type: Comment

http://stackoverflow.com/comment/47805524
type: Comment
comment on: http://stackoverflow.com/a/29839521
score: 0
type: AnswerComment
has text: Once you have an object, there would be no need to escape the double quotes because stringifying the object will do that.

http://stackoverflow.com/q/29733672
tagged with: desktop
score: 0
tagged with: mobile
answer count: 1
tagged with: javascript
has body: I think I am asking the question the wrong way: I need to stop javascript from activating when a device is smaller than 800 pixels. Using Viewsource from the browser (IE 10 / 11 and Fire Fox 28 / 32) doesn't show any errors. This is the code I am using, it does not work on a brower at 800 px or less or more than 800 px. &lt;script&gt; function detectmob() { if(window.innerWidth &lt;= 800 &amp;&amp; window.innerHeight &lt;= 600) { return true; } else { return false; } } if(!detectmob()){ &lt;script async type="text/javascript" src="http://forms.aweber.com/form/19/37402019.js"&gt;&lt;/script&gt; } &lt;/script&gt; Would someone tell me whare I have gone wrong?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29733756
has title: Block javascript activation in mobile devices - part 2
type: Question
has comment: http://stackoverflow.com/comment/47603969

http://stackoverflow.com/comment/58537284
has text: sample: http://stackoverflow.com/questions/18316065/set-quality-of-png-with-html2canvas
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29766979

http://stackoverflow.com/comment/47599108
score: 0
comment on: http://stackoverflow.com/q/29732916
type: Comment
type: QuestionComment
has text: You can't have the same keys

http://stackoverflow.com/a/29730217
accepted answer of: http://stackoverflow.com/q/29730157
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29730157
has comment: http://stackoverflow.com/comment/47594198
score: 1
has body: $(document).ready(function(){ $(document).on("click",".directions", function() { $('.lightboxbg, .directionslightbox').fadeIn(800); $('.contactlist').fadeOut("slow"); }); $(document).on("click",".lightboxbg", function() { $('.lightboxbg, .directionslightbox').fadeOut(800); $('.contactlist').fadeIn("slow"); }); });
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47594023

http://stackoverflow.com/a/29808579
upvote count: 1
has body: From what I can get, you want the module to fetch your settings and identity data and return it as an AMD module. Unfortunately, you have an asynchronous operation there. The best you could do is to return a promise from the module instead and let the depending modules attach then. // SettingsAndIdentity.js define(['jquery'], function ($) { // $.when resolves when all promises passed resolves return $.when($.getJSON("models/settings.json"), $.getJSON("models/identity.json")) }); // foo.js define(['SettingsAndIdentity'], function(SettingsAndIdentity){ // Since SettingsAndIdentity is a promise, we just attach then SettingsAndIdentity.then(function(settings, identity){ // start doing things here }); });
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29808394
answers question: http://stackoverflow.com/q/29808394
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47746040

http://stackoverflow.com/q/29725545
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47585358
has title: How can I prevent popup blocking after ajax call?
has answer: http://stackoverflow.com/a/29725710
downvote count: 0
has comment: http://stackoverflow.com/comment/47585695
score: 1
has comment: http://stackoverflow.com/comment/47585569
has comment: http://stackoverflow.com/comment/47585317
has comment: http://stackoverflow.com/comment/47585562
type: Question
has body: I'm working on a JS project where I need for some popups, the problem is that when the popup is being made after an ajax call then the browser will block it but if I make it directly when the user clicking it's working well. The browser will block this: $.ajax({ url: url }).done(function(data) { showPopup(); }); While the browser will let this: $('#but').click(function(evt) { showPopup(); }); The code on Plunker
has comment: http://stackoverflow.com/comment/47585549
upvote count: 1
linked to: http://stackoverflow.com/q/22007592
linked to: http://stackoverflow.com/q/20822711
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47585754
tagged with: ajax
has comment: http://stackoverflow.com/comment/47585565
answer count: 1
has comment: http://stackoverflow.com/comment/47585432

http://stackoverflow.com/q/29740111
has body: I am new to android development. I am trying to develop an application to view math formulae.My application shows the formula in WebView, but use javascript in loading message. I want to trim the data loading the messages from WebView. My xml code: <TextView android:id="@+id/textTitle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="TextView" android:textColor="#ff33203d" android:textSize="18sp" /> My java code: public class MainActivity extends Activity implements View.OnClickListener{ private WebView txtQuestion; private String mathML; private String doubleEscapeTeX(String s) { String t=""; for (int i=0; i < s.length(); i++) { if (s.charAt(i) == '\'') t += '\\'; if (s.charAt(i) != '\n') t += s.charAt(i); if (s.charAt(i) == '\\') t += "\\"; } return t; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.examination_fragment_layout); txtQuestion = (WebView) findViewById(R.id.txtQuestion); txtQuestion.getSettings().setJavaScriptEnabled(true); try { InputStream raw = getApplicationContext().getAssets().open( "multipale_choose.xml"); QuizzesParser parser = new QuizzesParser(this); parser.startParsing(raw); answerList=parser.getpList(); // initiateWebView(answerList.get(1).getAns_body(),txtQuestion); mathML=" "; mathML=mathML+answerList.get(1).getAns_body(); mathML=mathML+" "; txtQuestion=formulaWebview; txtQuestion.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){ txtQuestion.evaluateJavascript("javascript:document.getElementById('math').innerHTML='" + doubleEscapeTeX(mathML) +"';",null); } else{ txtQuestion.loadUrl("javascript:document.getElementById('math').innerHTML='" + doubleEscapeTeX(mathML)+"';"); } txtQuestion.loadUrl("javascript:MathJax.Hub.Queue(['Typeset',MathJax.Hub]);"); } }); final String mathJaxOfflineUrl …
type: Question
has comment: http://stackoverflow.com/comment/47613320
linked to: http://stackoverflow.com/q/29671136
has answer: http://stackoverflow.com/a/29817533
tagged with: webview
has title: How to trimmed above data loading message from WebView in android
answer count: 1
tagged with: android-webview
upvote count: 3
has comment: http://stackoverflow.com/comment/47613342
has comment: http://stackoverflow.com/comment/47728899
accepted answer: http://stackoverflow.com/a/29817533
downvote count: 0
tagged with: javascript
type: AnsweredQuestion
score: 3
tagged with: android
has comment: http://stackoverflow.com/comment/47761958
favorite count: 0

http://stackoverflow.com/q/29750711
tagged with: function
tagged with: setinterval
tagged with: javascript
has answer: http://stackoverflow.com/a/29750805
answer count: 3
has comment: http://stackoverflow.com/comment/47633897
has comment: http://stackoverflow.com/comment/47633674
tagged with: vertical-scrolling
has title: Javascript vertical scrolling function
possible better answer: http://stackoverflow.com/a/29750805
has answer: http://stackoverflow.com/a/29750871
type: AnsweredQuestion
has body: I am trying to detect a scroll on my page using JavaScript. So that I can change classes and attributes of some elements when user has scrolled certain amount of page. This is my JS function: function detectScroll() { var header = document.querySelector(".headerOrig"), header_height = getComputedStyle(header).height.split('px')[0], fix_class = "changeColor"; if( window.pageYOffset &gt; header_height ) { header.classList.add(fix_class); } if( window.pageYOffset &lt; header_height ) { header.classList.remove(fix_class); } var change = window.setInterval(detectScroll, 5000); } and I am calling it when the page is loaded: &lt;body onload="detectScroll();"&gt; However, I have this problem - I need to set up a really small interval so that the function gets called and the class is changed immediately. BUT then the page freezes and everything except the JS function works very slowly. Is there any better way of achieving this in JavaScript? Thanks for any advice/suggestion.
tagged with: scroll
has answer: http://stackoverflow.com/a/29750814
type: Question
accepted answer: http://stackoverflow.com/a/29750871
score: 0

http://stackoverflow.com/comment/47526441
comment on: http://stackoverflow.com/q/29695027
score: 0
type: QuestionComment
has text: Good question, but isn't it more a npm/browserify module related question?
type: Comment

http://stackoverflow.com/comment/47655121
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/29761562
has text: You need `&&`, not `||`.
type: Comment

http://stackoverflow.com/comment/47539913
comment on: http://stackoverflow.com/a/29701237
type: AnswerComment
type: Comment
has text: You send me digging and I found this that works $.getScript('script.js'); which I put in my document.ready function which loaded in the div. This only seems to work some of the time though...
score: 0

http://stackoverflow.com/comment/47734523
has text: @AdamBaranyai It is used to set the text in the status bar at the bottom of the browser.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29803269
type: Comment

http://stackoverflow.com/q/29704037
has answer: http://stackoverflow.com/a/29704235
type: AnsweredQuestion
has title: Programmatically clicking a button that is not yet existing in DOM (jQuery)
has comment: http://stackoverflow.com/comment/47543728
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47543732
accepted answer: http://stackoverflow.com/a/29704235
tagged with: javascript
has comment: http://stackoverflow.com/comment/47543738
score: -7
tagged with: jquery
has answer: http://stackoverflow.com/a/29705431
has comment: http://stackoverflow.com/comment/47543850
possible better answer: http://stackoverflow.com/a/29705431
has body: I have a jQuery application that adds a "tile" when i click "addTile" button. The resultant tile will have a menu of buttons (google, youtube, ...), which on click, removes the button menu and replaces it with the respective widget. This part is working fine. The next part includes adding the widget directly on load. Whcih means i have to programmatically click() the "menu" button which is not yet on the DOM. If i want to display a google widget directly on load of the document, how can i do that? i am right now at this. $(document).ready(function () { $("#addTile").click().$("#setGoogle").click(); });
has comment: http://stackoverflow.com/comment/47543706
has comment: http://stackoverflow.com/comment/47543733
favorite count: 0
downvote count: 8
upvote count: 1

http://stackoverflow.com/q/29779489
possible better answer: http://stackoverflow.com/a/29779659
linked to: http://stackoverflow.com/q/563406
has comment: http://stackoverflow.com/comment/47689400
type: Question
has answer: http://stackoverflow.com/a/29779659
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: date
has title: angularjs getdate not working
accepted answer: http://stackoverflow.com/a/29779589
has body: I'm fairly new to javascript and angularjs so please bear with me. I am having issues when attempting to interact with the Date object. I assume that Date is a javascript object. However when running .getDate() on a Date object i get a date of 1970. My code is shown below: (function() { var app = angular.module("app", []); var DateController = function($scope) { $scope.today = new Date(); $scope.tomorrow = $scope.today.getDay() +1; }; app.controller("DateController", DateController); }()); This is really basic, however l do not understand why I am getting that date. I also get the same behavior when working with some other default javascript Date functions. An explanation would also be appreciated. I have created a plunk for convience: Take me to the plunk!
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47689229
upvote count: 2
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29779589
has comment: http://stackoverflow.com/comment/47689255

http://stackoverflow.com/comment/47772217
type: Comment
comment on: http://stackoverflow.com/q/29823029
has text: can you provide the html structure ?
score: 0
type: QuestionComment

http://stackoverflow.com/a/33603077
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29807044
has body: This is fixed as of Webpack 1.12 now that it's using Esprima 2.

http://stackoverflow.com/q/29844662
tagged with: javascript
tagged with: string
has answer: http://stackoverflow.com/a/29853695
accepted answer: http://stackoverflow.com/a/29853695
has body: I'm trying to create a Coffescript function that contains common HTML for a frequently re-used object in my page. I'm passing a variable to the function with the text I want changed each time. Every time I try to compile my Coffeescript, I get this error: [stdin]:6:5: error: unexpected identifier "text1" ^^^^^ Here's my code text1 = "Some text" ballon1 = (text1) -> "Open Modal "text1" X " I was hoping the output would be: Open Modal Some text X Any thoughts? I was trying to find the language for the job; maybe I should be using PHP instead? Also, I'm using Javascript because I thought the code needed to be run client-side, since I want to pass different text to the function depending on what links are clicked and when.
has title: Creating functions containing HTML
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/29844722
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: coffeescript
possible better answer: http://stackoverflow.com/a/29844722
type: Question
answer count: 2
tagged with: function
downvote count: 0

http://stackoverflow.com/comment/47649161
has text: Have you tried ViewState?? It works like Session variables, but ViewState variables just live in one page, when the user change the page, they are dropped
comment on: http://stackoverflow.com/q/29758424
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47739041
comment on: http://stackoverflow.com/a/29782775
score: 0
type: Comment
has text: Updated to always iterate through the entire source string. Should fix dropping characters since it would fail to copy the last few chars if it didn't match.
type: AnswerComment

http://stackoverflow.com/comment/47809679
has text: Added the example code; replaced animationend with click since the question does not include any animation code.
comment on: http://stackoverflow.com/a/29841086
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47628578
has text: Im sure there is a simple answer to this, can the data in the array be alphanumeric? Seems to only accept numeric data...
comment on: http://stackoverflow.com/a/29718401
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29705445
has answer: http://stackoverflow.com/a/29705538
type: Question
has answer: http://stackoverflow.com/a/29705689
tagged with: javascript
answer count: 2
upvote count: 1
favorite count: 0
has body: I am trying to make a website using a single image as background then add content over it. So far, I was able to achieve this using background-size: cover, however I am having a lot of difficulty when it comes to vertically aligning my content to the middle of the page (every vertical aligning solution seems to involve height being known at some point...) Looking at some websites doing what I am trying to do (like www.novactive.ca/en), I realized that the height of the image was being adjusted when I would adjust my browser size. I don't know how this is being done but I do suspect some javascript is involved... So I am wondering if I have been trying this correctly or if there are better, easier way to achieve this ?
type: UnansweredQuestion
tagged with: css
has title: Best way to make responsive full page?
tagged with: responsive-design
downvote count: 0
score: 1

wamp
tag name: wamp
tags question: http://stackoverflow.com/q/29739486
type: Tag

http://stackoverflow.com/comment/47641990
type: Comment
type: QuestionComment
has text: @henry: thganks. No, I'm not using css reset.
score: 0
comment on: http://stackoverflow.com/q/29754839

http://stackoverflow.com/a/29826526
has body: That's not quiet possible. You can't use client side variables (ECMA Script) inside your server side scripts (PHP). You may be able to achieve this by creating a web service and passing the variables using XHTTP Requests (AJAX) or reload the page using ECMA Script passing the value as a parameter and using it server side. I don't know what exactly you are trying to do so I can't give you a definitive answer to this.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29826391
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29826391
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47779656

http://stackoverflow.com/comment/47535226
comment on: http://stackoverflow.com/a/29699546
type: AnswerComment
has text: my solution is not the best one, look at responce of @SimonPlus
score: 0
type: Comment

http://stackoverflow.com/comment/47587470
comment on: http://stackoverflow.com/q/29726770
score: 0
has text: HTML can be either upper, lower or mixed case, it's not a typo (unless it's XHTML, where it has to be lowercase).
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29745025
tagged with: javascript
answer count: 2
tagged with: validation
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29745133
has comment: http://stackoverflow.com/comment/47623616
favorite count: 0
has body: Second edit: OH MY GODS I'M AN IDIOT!!! I was focusing on the javascript and completely neglected the lack of a "result" item in the html...Thanks to those who helped! Edit: Thanks so far. I corrected the errors that people pointed out but it still doesn't like me. :( My html is below. I'm following a tutorial on html.net (lesson 16 on Javascript) and I've written it exactly how it's supposed to be written. I even loaded up the javascript file of the working tutorial page and compared (was the same)...then copied it and pasted it into my file just to be sure and it still doesn't work. If anyone could offer an opinion, that'd be wonderful. Code is below: Lesson 16: form validation Lesson 16: Form validation Name: Email: function init() { var myForm = document.getElementById("myForm"); myForm.onsubmit = validate; } onload = init; function validate() { var name = document.getElementById("txtName").value; var email = document.getElementById("txtEmail").value; var isRequiredNameSet = false; var isRequiredEmailSet = false; var isEmailValid = false; var message = ""; isRequiredNameSet = validateRequired(name); isRequiredEmailSet = validateRequired(email); isEmailValid = validateEmail(email); if (isRequiredNameSet && isRequiredEmailSet && isEmailValid) { message = "Thank you, you know how to follow instructions...good for you."; } else if (! isRequiredNameSet) { message = "Please, enter a name. First thing and you got it wrong..."; writeMessage(message); return false; } else if (! isRequiredEmailSet) { message = "Please, enter an email...come on, it's not that hard..."; writeMessage(message); return false; } else if (! isEmailValid) { message = "A valid email, numb nuts...with an @ symbol and a .com or whatever...GODS!!"; writeMessage(message); return false; } alert(message); } function validateRequired(input) { var isValid = false; if (input.length == 0) { isValid = false; } else { isValid = true; } return isValid; } function validateEmail(email) { var isValid = false; if …
type: UnansweredQuestion
has title: Form validation doesn't like me
has answer: http://stackoverflow.com/a/29745088
tagged with: forms
upvote count: 1
has comment: http://stackoverflow.com/comment/47622522
type: Question

http://stackoverflow.com/comment/47684935
has text: Why move the first paragraph outside of `.content`? Why not just hide everything but the first paragraph from the start?
score: 2
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29777320

http://stackoverflow.com/comment/47790841
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29831934
has text: You, sir..saved the day! +1 for messageSource

http://stackoverflow.com/a/29845558
answers question: http://stackoverflow.com/q/29845163
score: 0
type: Answer
has body: First of all yes you are right, using a service is considered a better approach then using events on the $rootScope. It is not considered a best practice to use the $rootScope because in short its quite similar to using the window object in JavaScript. So every direct interaction with the $rootScope needs to be checked if its really needed. To go a bit further you need to think what your application wants to do and why it needs communication between controllers. Often such communication is not needed if you choose a good architecture. If two of your controllers are based on the same data set then you do not really need manual communication in AngularJS. Instead you can manage your data set in a service and both controllers can use this service to interact with the data. If you come to the conclusion that $broadcast or $emit is better for your use case it is a valid approach. But you don't need to use these methods on the $rootScope. Often communication just needs to travel to parent or child elements in your application. In this case you can call these methods on a $scope of a single controller. $emit transmits the events upwards in the hierarchy to all parents, $broadcast the opposite way to all childs. Therefor $rootScope often is not needed even if you want to do event emitting.

http://stackoverflow.com/comment/47706766
comment on: http://stackoverflow.com/a/29788231
type: Comment
has text: create function which having an events which is getting called onready event first and after that when you click on any button event bubbles till parent and parent click getting called in which all the clicks of child have to off, and on mouseleave simply reattach the events by calling same function. .off().on() uses for if event is attached before remove it and attach new one, its better to use full syntax of .offf() method
type: AnswerComment
score: 0

http://stackoverflow.com/a/29700206
has body: Try this: // This identifies your website in the createToken call below Stripe.setPublishableKey(''); var appendedStripeToken = false; var stripeResponseHandler = function(status, response) { var $form = $('#payment-form'); if (response.error) { // Show the errors on the form $form.find('.payment-errors').text(response.error.message); $form.find('button').prop('disabled', false); } else { // token contains id, last4, and card type var token = response.id; handleCall(token); } }; function handleCall(token) { if (!appendedStripeToken) { // Insert the token into the form so it gets submitted to the server $form.append($('&lt;input type="text" name="stripeToken" /&gt;').val(token); appendedStripeToken = true; phpCall(); } } function onSubmit() { var $form = $('#[put the form id here]'); // TODO: give your html-form-tag an "id" attribute and type this id in this line. IMPORTANT: Don't replace the '#'! Stripe.card.createToken($form, stripeResponseHandler); } function phpCall() { $.ajax({ url: 'paymentEmail.php', success: function (response) { // response is value returned from php (for your example it's "bye bye") // Disable the submit button to prevent repeated clicks $('#[put the input id here]').prop('disabled', true); // TODO: give your html-submit-input-tag an "id" attribute alert(response); } }); } There are two TODO comments! EDIT: Modified code
has comment: http://stackoverflow.com/comment/47542687
has comment: http://stackoverflow.com/comment/47537433
upvote count: 1
has comment: http://stackoverflow.com/comment/47540452
has comment: http://stackoverflow.com/comment/47543217
accepted answer of: http://stackoverflow.com/q/29695422
has comment: http://stackoverflow.com/comment/47538993
has comment: http://stackoverflow.com/comment/47543773
score: 1
answers question: http://stackoverflow.com/q/29695422
has comment: http://stackoverflow.com/comment/47543758
has comment: http://stackoverflow.com/comment/47543994
has comment: http://stackoverflow.com/comment/47537971
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47541553
has comment: http://stackoverflow.com/comment/47543406
has comment: http://stackoverflow.com/comment/47543852
has comment: http://stackoverflow.com/comment/47544924
has comment: http://stackoverflow.com/comment/47544801
has comment: http://stackoverflow.com/comment/47539819
has comment: http://stackoverflow.com/comment/47537821
has comment: http://stackoverflow.com/comment/47537863
type: Answer
has comment: http://stackoverflow.com/comment/47544257
has comment: http://stackoverflow.com/comment/47544830
has comment: http://stackoverflow.com/comment/47543669
has comment: http://stackoverflow.com/comment/47537657

http://stackoverflow.com/comment/47647116
type: Comment
comment on: http://stackoverflow.com/a/29756386
has text: I used your getOffsetTop() method like this: https://dl.dropboxusercontent.com/u/7647549/monthmay.PNG and it works (alerts "month: may" when i scroll past 01-05-2015). BUT, this means that i must hardcode all the IF-statements for every month (eg. 01-05-2015, 01-06-2015, 01-07-2015.... 01-01-2016...)?
type: AnswerComment
score: 0

http://stackoverflow.com/a/29779221
has body: APP.open.people().gender(); silly, I over saw this... Thanks guys!
type: Answer
answers question: http://stackoverflow.com/q/29779117
score: 0

http://stackoverflow.com/comment/47601114
comment on: http://stackoverflow.com/q/29733954
has text: You're calling `substr` on the array and not on the result of `array.join`. The `join` function does not modify the array, it returns a `string`
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/tag/csv
type: Tag
tag name: csv
tags question: http://stackoverflow.com/q/29768229
tags question: http://stackoverflow.com/q/29758326
tags question: http://stackoverflow.com/q/29785990
tags question: http://stackoverflow.com/q/29828408
tags question: http://stackoverflow.com/q/29808639
tags question: http://stackoverflow.com/q/29746087
tags question: http://stackoverflow.com/q/29802994
tags question: http://stackoverflow.com/q/29723379
tags question: http://stackoverflow.com/q/29725377
tags question: http://stackoverflow.com/q/29817510
tags question: http://stackoverflow.com/q/29799696

http://stackoverflow.com/comment/47649943
type: QuestionComment
has text: js is just another string to php like any other.
score: 0
comment on: http://stackoverflow.com/q/29758791
type: Comment

http://stackoverflow.com/q/29713288
answer count: 1
has body: So, I'm using Brackets and I keep running into this issue, maybe I just don't understand these things enough. Here's what I want to do, I'm trying to make an HTML document that has an input field and button. When you enter a number in the input field and press the button, it gives that information to a separate app.js file that connects with an api and finds an interesting fact about the number. The issue I'm running into is, I can't seem to connect the html with the JavaScript/jQuery. Please help, thanks in advance. $(function Test(){ $("#button").click( function() { var userInput = document.getElementById("userInput").value; alert('button clicked'); } $.ajax({ type: 'GET', url: "http://numbersapi.com/" + userInput + "/math?callback=?", dataType: 'jsonp', success: function(results) { var hi = results; console.log(hi); $("#results").append(results + "hi"); } }); ); }); Pick a number Number Submit This is a paragraph!
tagged with: jquery
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29713384
has title: How to HTML, jQuery, numbers API
type: Question
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/29713384
tagged with: api

http://stackoverflow.com/comment/47597892
comment on: http://stackoverflow.com/q/29732219
type: Comment
type: QuestionComment
score: 1
has text: global variables are a sign your architecture is perhaps too tightly coupled thus preventing modularity and easy reuse of disparate functions ... you may want to refactor so there is no/less need for shared variables ... also if appropriate leverage natural variable scoping and put these variables inside a function as a closure where they are visible to children functions

http://stackoverflow.com/comment/47518016
score: 1
type: QuestionComment
has text: Here's a similar question with a great answer. http://stackoverflow.com/questions/16296774/access-html-element-from-ko-computed http://stackoverflow.com/questions/10126812/knockout-js-get-dom-object-associated-with-data
type: Comment
comment on: http://stackoverflow.com/q/29688663

http://stackoverflow.com/a/29780742
score: 8
has body: It's because your single line if statement. If you omit the curly braces, only the first line is part of the statement, so return false; is being executed every time: With line breaks you can see your mistake: if(typeof obj !== 'object') console.log('error'); return false; //Bunch of code that never gets hit
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29780681
has comment: http://stackoverflow.com/comment/47692276
answers question: http://stackoverflow.com/q/29780681
upvote count: 8
type: Answer

http://stackoverflow.com/q/29838206
has comment: http://stackoverflow.com/comment/47874290
has comment: http://stackoverflow.com/comment/57169261
tagged with: pixi.js
tagged with: webgl
has comment: http://stackoverflow.com/comment/60353149
type: Question
has answer: http://stackoverflow.com/a/29871689
tagged with: canvas
tagged with: javascript
has comment: http://stackoverflow.com/comment/68510509
has comment: http://stackoverflow.com/comment/47833060
answer count: 1
downvote count: 1
upvote count: 17
has body: The idea Hi! I and a team of developers are creating an open-source graphical interface for interactive graph editing. I want this interface to handle a big amount of connected nodes, allowing the user to move them, reconnect, zoom in/out etc. Each node could have text, buttons, sliders and other controls on top of it. Additional we want to create a pretty advanced, pluggable graphical interface - each panel would be a plugin - you can think of it like about web based eclipse. A panel could be te graph editor, a timeline or a 3D viewport. The question I would like to ask you, which library would give us more benefits - Pixi.js, ThreeJS or maybe other one? Maybe we should mix them - creating the interface in Pixi.js and some of the plugins that need 3D support in ThreeJS (I don't personally like this idea, because of lower "consistency"). Requirements We want everything running in WebGL. A reason for that is, that we want to run the graph editor as smoothly as possible and considering the fact, that the graph editor needs to display the same controls that other parts of the GUI, it is reasonably to do it in one technology. I'm looking for a library, that would give me the best performance and flexibility in creating such a big project, especially considering: ability to create custom HUD elements (sliders, buttons, graphs, etc) ability to handle big amount of elements - a caching / redrawing only needed part is important canvas fallback is important, but not crucial
favorite count: 0
has title: Pixi.js and ThreeJS for an advanced web GUI
has comment: http://stackoverflow.com/comment/47817742
type: UnansweredQuestion
tagged with: three.js
has comment: http://stackoverflow.com/comment/58120855
score: 16

http://stackoverflow.com/comment/47622460
score: 0
type: QuestionComment
has text: Please, provide some of your code that could help others to understand your problem better.
type: Comment
comment on: http://stackoverflow.com/q/29744730

http://stackoverflow.com/comment/47668805
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29768671
has text: Try with these values : a = [11, 82, 3, 4], b = [62, 6, 3, 5], c = [4, 2, 20, 3], d = [34, 2, 21, 5]; It will fail

http://stackoverflow.com/comment/47691068
comment on: http://stackoverflow.com/a/29780441
has text: angular.copy copies the function pointer, +1 for the hack comment. Even if you deliberately want a copy without functions then I would write a function that does just that. don't litter your code base with these hacks. keep them in one place
type: AnswerComment
score: 1
type: Comment

http://stackoverflow.com/q/29730611
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29730754
tagged with: jquery
favorite count: 0
has title: modify template file from web and save it to local using HTML5, JavaScript, jQuery
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to create a site, where some settings, set up by a client, may be written to a file, that is not located in the client's filesystem, but is a file of my project. Then this file, with some parts of it overwritten, must be saved to local storage. For example: template_file.txt contents: My favourite color is WHITE. I like GREEN tea with lemon. Leaves on the trees are GREEN. Web page initially has something like: [Empty Text Field 1 Here] [Empty Text Field 2 here] [Empty Text Field 3 here] Filename: [Empty Filename Field here] {OK Button} {Save File Button} (Text of template_file.txt is not visible to the client, but is included into the website's project.) Client's input: [red] [black] [Empty Text Field 3 here] Filename: [generated_file] {OK Button} {Save File Button} (Field 3 left unchanged, {OK Button} clicked.) generated_file.txt contents: My favourite color is red. I like black tea with lemon. Leaves on the trees are GREEN. ({Save File Button} clicked. => Site proposes to save generated_file.txt to local filesystem.) I have found a tutorial on how to save all the text from a textarea to file here: Loading, Editing, and Saving a Text File in HTML5 Using Javascript But I have no idea how to generate file, using partly overwritten template file from web for it. Any tips on how to do it (if it's actually possible) would be greatly appreciated.
has answer: http://stackoverflow.com/a/29730754
upvote count: 1
has answer: http://stackoverflow.com/a/29730721
accepted answer: http://stackoverflow.com/a/29730721
type: AnsweredQuestion
score: 1

http://stackoverflow.com/q/29763936
has title: SoundCloud API for app for search
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29767028
has answer: http://stackoverflow.com/a/52250506
downvote count: 2
type: Question
has body: I know the basic API of soundcloud. How can I search a track in SoundCloud without asking the user (who is logged into my website) to login/create an account in soundcloud? I have to initialize the soundcloud with my client id before making any API call. SC.initialize({ client_id: 'YOUR_CLIENT_ID' }); I don't want to pass client id to search. How can we do.
score: -2
tagged with: javascript
answer count: 2
tagged with: soundcloud
tagged with: api
upvote count: 0
has comment: http://stackoverflow.com/comment/47679385
favorite count: 0

http://stackoverflow.com/comment/89120252
has text: Possible duplicate of [Javascript if statement with multiple permissible conditions](https://stackoverflow.com/questions/13944216/javascript-if-statement-with-multiple-permissible-conditions)
comment on: http://stackoverflow.com/q/29811872
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47748693
comment on: http://stackoverflow.com/a/29701477
has text: It is not recommended to rely on a hacky side-effect. This could stop working at anytime leaving sites that build off it broken.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/a/29848183
has comment: http://stackoverflow.com/comment/47876635
downvote count: 0
answers question: http://stackoverflow.com/q/29837266
has comment: http://stackoverflow.com/comment/47942017
has body: I would check the very first line of the code snippet you posted: _gaq.push(_setAccount,UA-xxxxx-1) It should look like: _gaq.push(['_setAccount', 'UA-xxxxx-1']); You can refer to the official Google Analytics documentation here: https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApi_gaq#_gaq.push Other that that, if you see any JavaScript errors appearing in your browser's developer console, it might also be worth looking into that.
has comment: http://stackoverflow.com/comment/48001536
type: Answer
has comment: http://stackoverflow.com/comment/48067409
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47915300
has comment: http://stackoverflow.com/comment/47965816

http://stackoverflow.com/comment/47540634
type: Comment
type: QuestionComment
has text: Okay - did that, and have a new problem. It is no longer giving the null errors related to the dom, but when I try to call these functions through the prototype for the scene, it throws an error that it isn't a function. So I have `CrashLandingScene.prototype.draw = drawCrash(); CrashLandingScene.prototype.draw2 = drawCrash2();` With the drawCrash() and drawCrash2(); in the other file, which is now in a script tag along with main.js in the bottom of the body of the HTML
comment on: http://stackoverflow.com/q/29690037
score: 0

http://stackoverflow.com/comment/47805869
type: QuestionComment
has text: I am using it in the browser and I already have that URL as a string, so I don't want to get it from anywhere else. I only want the function explained if possible
score: 0
comment on: http://stackoverflow.com/q/29839793
type: Comment

http://stackoverflow.com/comment/47673272
score: 0
has text: Sure, but I copied & pasted from [the rules](http://stackoverflow.com/help/on-topic)
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29771202

http://stackoverflow.com/a/46610455
upvote count: 7
downvote count: 1
answers question: http://stackoverflow.com/q/29810914
type: Answer
score: 6
has body: Making alternate attempt to answer OP's question including e.preventDefault() calls: Rendered link (ES6) &lt;a href="#link" onClick={(e) =&gt; this.handleSort(e, 'myParam')}&gt; Component Function handleSort = (e, param) =&gt; { e.preventDefault(); console.log('Sorting by: ' + param) }

http://stackoverflow.com/q/29776402
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
has body: In one case I have a problem with running a function on the Controller from the template. The value becomes a string containing the function signature, not the value that should be returned from the function. When I use {{ getSomeObject(d) }} in my template markup it works fine, and it prints the object values, meaning that the function got called on the Controller. I have tried with and without the {{ }}. Pseudo code: &lt;div class"xyz" data-lav-fact="getSomeObject(d)"&gt; &lt;!-- Does not work here --&gt; {{ getSomeObject(d) }} &lt;!-- Works here --&gt; &lt;/div&gt; And of course the function is added to the scope in the Controller: $scope.getSomeObject = function(data) { return { key: "test" }; }; This works in other parts of the application and I don't know what wrong in this case. Does anyone know what typically can be wrong here?
has answer: http://stackoverflow.com/a/29779391
downvote count: 1
score: 1
has title: Issues with calling function from template
tagged with: angularjs-scope
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/49377106
favorite count: 0
has comment: http://stackoverflow.com/comment/47683582
has comment: http://stackoverflow.com/comment/47684254
has comment: http://stackoverflow.com/comment/47683160
has comment: http://stackoverflow.com/comment/47683656

http://stackoverflow.com/q/29798678
has comment: http://stackoverflow.com/comment/47727647
has answer: http://stackoverflow.com/a/29798752
favorite count: 0
has comment: http://stackoverflow.com/comment/47727174
has comment: http://stackoverflow.com/comment/47727706
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47725518
type: Question
has answer: http://stackoverflow.com/a/29799963
has answer: http://stackoverflow.com/a/29799184
score: 1
has comment: http://stackoverflow.com/comment/47727761
has comment: http://stackoverflow.com/comment/47727216
has comment: http://stackoverflow.com/comment/47727558
has title: Does alert('some message') can make an impact in a callback function - Javascript
has comment: http://stackoverflow.com/comment/47727691
linked to: http://stackoverflow.com/q/2734025
has comment: http://stackoverflow.com/comment/47726245
downvote count: 0
tagged with: javascript
has body: I had written a callback function to capture the snapshot of running video using html5 video control and canvas. I used a for loop to iterate and call the same callback function take the burst capture. If i add alert('') in the callback , the video in the background rerendering when alert message display, the burst snap shot works fine as taking diff photos(frames/images of the running video). But when I removed the alert('') , the video does not run in the background and the bursted images are the same instead of different. The code for (var i = 0; i &lt; burstcount; i++) { var wcam = Webcam; wcam.burst_snap(function (dataurl, id) { var arrayindex = passedName + "_" + id; imgid = imgid + i; alert(dataurl); burstcapturedata[arrayindex] = dataurl; }, i); var j = 0; while (j &lt; 10000000000) { j++; } } DisplayBurstedImages(); }
answer count: 3
tagged with: webcam-capture
has comment: http://stackoverflow.com/comment/47726411

http://stackoverflow.com/q/29742087
tagged with: filtering
has answer: http://stackoverflow.com/a/29742548
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29742477
has answer: http://stackoverflow.com/a/29742477
answer count: 3
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/29742548
tagged with: angularjs
has title: Filter ng-repeat based on user selection
type: AnsweredQuestion
tagged with: dynamic
has answer: http://stackoverflow.com/a/29743190
score: 1
tagged with: web-applications
upvote count: 1
has body: I am currently working on a music catalog and trying to implement functionality to allow user to filter the catalog from a list of artists and genres The list: Artists {{artist.artist}} I have tried to build a custom filter but couldn't quite grasp the concept, what I managed to do - was get the value from the chosen selection // value from ng-click $scope.select = function(value){ filterBy = value; } I know i can add in filter: the ng-repeat by adding ng-repeat="artist in music | filter: {artist:'artistName' | orderBy:'-views'"} but how do i change the artist: 'value' to what ever use selects from a list this is the main area i am trying to filter {{artist.artist}} {{artist.songName}} When the view loads all items should show and then if user wants can select artist or genre from a list to filter to that result. My idea was to maybe place the custom filter function inside the click function, so when user selects from list the value from the click function could be parse into the custom filter and update the filter with correct value. But, I couldn't implement this. I am quite new to angular.js so if i didn't quite explain it correctly here is a JSfiddle replicating my project. http://jsfiddle.net/0n2qptg6/5/ Thanks in advance for any help, suggestions, criticisms
type: Question

http://stackoverflow.com/q/29845188
favorite count: 0
has body: I tried to Bind Laravel Eloquent ORM array to Angular JS View. This is my code, controller (Laravel) public function index() { $data = User::all(); Response::json(array('data'=>$data)); } View (Laravel) Laravel PHP Framework {{clients.name}} Controller (Anular JS) var anguApp = angular.module('anguApp', []); anguApp.controller('clientList',function($scope,$http) { $scope.clients=[]; $http.get('/').success(function (data, status) { $scope.clients = data; console.log(data); }); }); Now getting a blank screen in browser.... How to solve this ?
tagged with: angularjs
upvote count: 2
linked to: http://stackoverflow.com/q/15602129
tagged with: php
has comment: http://stackoverflow.com/comment/47817303
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29845284
type: Question
tagged with: laravel-4
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47816708
tagged with: javascript
has title: Angular JS with Laravel -- How to Bind Eloquent ORM array To View
tagged with: eloquent
accepted answer: http://stackoverflow.com/a/29845284

http://stackoverflow.com/comment/47557643
type: QuestionComment
comment on: http://stackoverflow.com/q/29711026
has text: does it work on your browser? if yes then use touchstart event for touch devices
score: 0
type: Comment

http://stackoverflow.com/comment/47536768
type: Comment
comment on: http://stackoverflow.com/a/29700177
has text: Ok can you provide a jsfiddle so that everyone can see what your code is? Also accept the answer if it solves the issue!
type: AnswerComment
score: 0

http://stackoverflow.com/a/29703828
upvote count: 2
has body: Honestly, this isn't a great question for S-O, because it's going to be somewhat opinion based, but I'll answer it anyway. Yes, this can be done, but it's not a great idea. The benefits of Angular are most realized in single page application. Essentially all your code loads once, and then everything happens in the browser. Presumably your current web application is not an SPA, therefore you'll have to re-initialize/re-include all the required JS on every page that you want to be done in Angular. Angular's #-based routing might get messy as well depending on how your current application is set up. You're much better off starting a parallel Angular application on a development server, point it to the same datasources and build it out over time until you can finally make the switch all at once. The end result will be much cleaner. You'll also won't be forced to make compromises against doing things the "angular way" just to keep everything in your current application functioning properly.
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47544184
has comment: http://stackoverflow.com/comment/47543637
answers question: http://stackoverflow.com/q/29703626

http://stackoverflow.com/comment/47629388
score: 2
comment on: http://stackoverflow.com/a/29744755
type: AnswerComment
type: Comment
has text: i modified my above answer, so that the script runs when the DOM is built (not earlier). If this still not work, put the above script into main.scala.html (of course in script-tags ;-)) edit: i know :D create a fiddle instead, if there is too much code.

http://stackoverflow.com/a/56806063
score: 4
upvote count: 4
has body: myStart = "01:30:00 am"; myEnd = "2:45:07 am"; function getTimeDiff(start, end) { return moment.duration(moment(end, "HH:mm:ss a").diff(moment(start, "HH:mm:ss a"))); } diff = getTimeDiff(myStart, myEnd) console.log(`${diff.hours()} Hour ${diff.minutes()} minutes`);
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29745873

http://stackoverflow.com/a/29833325
accepted answer of: http://stackoverflow.com/q/29831906
has body: Your question got me wondering how angular tests ngHide and ngShow, here's a snippet from their spec file: it('should show if the expression is a function with a no arguments', function() { element = jqLite('&lt;div ng-show="exp"&gt;&lt;/div&gt;'); element = $compile(element)($scope); $scope.exp = function() {}; $scope.$digest(); expect(element).toBeShown(); }); Seems tidy. At first I thought they must be using jquery-jasmine which does expose a toBeHidden matcher (though not toBeShown as it turns out), in fact they wrote their own custom matcher for determining visibility: // [jtrussell] Custom Jasmine Matcher toBeShown: function() { this.message = valueFn( "Expected element " + (this.isNot ? "" : "not ") + "to have 'ng-hide' class"); return !isNgElementHidden(this.actual); } // [jtrussell] ... // [jtrussell] The helper from elsewhere in same file function isNgElementHidden(element) { // we need to check element.getAttribute for SVG nodes var hidden = true; forEach(angular.element(element), function(element) { if ((' ' + (element.getAttribute('class') || '') + ' ').indexOf(' ng-hide ') === -1) { hidden = false; } }); return hidden; } So I guess they're cheating a little... checking for the existence of an .ng-hide class to determine visibility. But I suppose they were once in your shoes and decided this was the best route, given that angular already supports this classname. Since we're already using angular perhaps you could consider using the .ng-hide class to set visibility and writing a similar helper. Edit: As a side note I'll say that adding/removing .ng-hide to set visibility will have the benefit of getting for free any ngAnimations the user of your module has already put in place for that class.
has comment: http://stackoverflow.com/comment/47795569
type: Answer
score: 6
upvote count: 6
has comment: http://stackoverflow.com/comment/47834497
downvote count: 0
answers question: http://stackoverflow.com/q/29831906
type: AcceptedAnswer

http://stackoverflow.com/q/29757171
answer count: 2
tagged with: regex
has answer: http://stackoverflow.com/a/29757828
has answer: http://stackoverflow.com/a/29757396
score: 0
has comment: http://stackoverflow.com/comment/47680337
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47668062
has comment: http://stackoverflow.com/comment/47647015
has comment: http://stackoverflow.com/comment/47647107
has body: I'm trying to create a RegExp that will match a string if there are zero or more "options". For example, I have these three strings that I wish to match: 'user' 'user/1' 'user/1/admin' I currently have this: /^user(?:(?:\/){1}([%a-zA-Z0-9\-\_\s,]+))*$/g This will match them all but it will only return the last matched option. So on the 2nd string, it will remember '1'. On the 3rd, it will remember 'admin'. On the 3rd, I'd like it to remember ['1', 'admin']. This would need to be dynamic to allow 1 or unlimited options. This is so I can define something like user:args and I can then return the args.
has comment: http://stackoverflow.com/comment/47647062
type: Question
has title: JS RegExp to match none or all

http://stackoverflow.com/a/29804102
has comment: http://stackoverflow.com/comment/47747956
type: Answer
answers question: http://stackoverflow.com/q/29713004
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47747973
has body: A more jasmine-approved way would be to add a custom jasmine reporter. You can do something like this: var myReporter = { jasmineStarted: function(suiteInfo) { localStorage.setItem('foo', 'bar'); } }; jasmine.getEnv().addReporter(myReporter); You just need to make sure that your reporter is registered early enough.
downvote count: 0

http://stackoverflow.com/a/29733027
accepted answer of: http://stackoverflow.com/q/29732898
answers question: http://stackoverflow.com/q/29732898
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47617436
has body: You can do it like this: function onClick(){ var areas = document.getElementsByTagName("textarea"); for(var i = 0; i < areas.length; i++){ alert(areas[i].value); } } Gather information Also see this regarding your "save to a file" question Using HTML5/Javascript to generate and save a file
has comment: http://stackoverflow.com/comment/47599741

http://stackoverflow.com/q/29823889
has answer: http://stackoverflow.com/a/29823963
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47775118
has title: Comment out a Javascript function called in an event of PHTML
score: 0
has body: I am new to javascript, html, php and started working on it. Today i faced a problem that i need to comment out a javascript function called on an event of a textbox but i am unable to do so . Can you please tell me how can i do that Here i am attaching the code part and part which i need to comment out. Help will be appreciated . &lt;label class="input"&gt; &lt;input type="text" data-src="gupta" id="sudhanshu" class="price" name="sudhanshu" onblur="EditMe.calculatePrice('id1'); EditMe.calculateRatio('id1');" fieldtype="decimal"&gt; &lt;/label&gt; Here Onblur is the event called in a text box, when this event is called calculatePrice and calculateRatio are javascript functions called, now i want to comment out the second function. what should be the way to do that. My tries: /* EditMe.calculateRatio('id1'); */ // EditMe.calculateRatio('id1');" &lt;!-- EditMe.calculateRatio('id1');"--&gt; not any of these is working. please reply what should i do
has comment: http://stackoverflow.com/comment/47774251
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47775227
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php

http://stackoverflow.com/q/29708075
type: AnsweredQuestion
tagged with: twitter-bootstrap
accepted answer: http://stackoverflow.com/a/29709331
type: Question
tagged with: bootbox
upvote count: 5
has answer: http://stackoverflow.com/a/32334328
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29890974
has answer: http://stackoverflow.com/a/29708394
has answer: http://stackoverflow.com/a/29890974
has title: How to confirm a form submission with Bootbox using jQuery AJAX and JSON
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
score: 5
has body: I'm working in a web application using Spring MVC. I'm trying to show a confirmation dialog before submitting a form using Bootbox, but I'm getting a 500 internal server error. This is my form: &lt;form id="checkout-form" class="smart-form" novalidate="novalidate"&gt; ...some fields &lt;button type="button" class="btn btn-primary" onclick="insertFunction()"&gt; Accept &lt;/button&gt; &lt;/form&gt; This is my insertFunction() function insertFunction(){ var name = $('#name').val(); var lastname = $('#lastname').val(); var confirmSend; var json = {"name": name,"lastname": lastname}; $.ajax({ type: "POST", url: "register/insertPerson", data: JSON.stringify(json), contentType: "application/json; charset=utf-8", dataType: "json", cache: false, beforeSend: function (xhr){ bootbox.dialog({ message: "I am a custom dialog", title: "Custom title", buttons: { success: { label: "Success!", className: "btn-success", callback: function() { //I DONT KNOW WHAT TO DO HERE } }, danger: { label: "Danger!", className: "btn-danger", callback: function() { return false; } } } }); xhr.setRequestHeader("Accept", "application/json"); xhr.setRequestHeader("Content-Type", "application/json"); }, success: function (data){ if (data.message === true){ bootbox.alert("OPERATION WAS EXECUTED WITHOUT PROBLEMS"); } else { bootbox.alert("OPERATION FAILED"); } }, error: function (xhr, ajaxOptions, thrownError){ alert(xhr.status); alert(xhr.responseText); alert(thrownError); } }); } I send the name and last name value to my spring controller and I do a insert and if it was successfully my controller method returns true, and in the success block of my script I check the value if is true I show a message and if it's false i show a different message. My problem is that i don't know what to do inside this section: success: { label: "Success!", className: "btn-success", callback: function() { //I DONT KNOW WHAT TO DO HERE } } *EDIT: * It was my fault submiting a value in the form fields, now I'm not getting a…
has answer: http://stackoverflow.com/a/29709331
answer count: 4

http://stackoverflow.com/q/29816343
score: 1
has body: saveButton.onclick = function(e) { var filename= file.name; console.warn("file name " +filename); //alert("hello"); var audioType = "audio/*"; //console.warn("audiotype " +audioType); if(filename.type.match(audioType)) { console.warn("audiotype " +audioType); var reader=new FileReader(); console.warn("file reader object " +reader); read.onload=function(e) { var rowdata=reader.result; console.warn("file reader object row data " +rowdata); } reader.readAsBinaryString(filename); } } here on save button event i am getting audio file name using file.name.now i want to read it in buffer because i want to upload this file on server.so i want to read it using file reader class.but here i am not getting any output.can any one plzz help me to figure out that where is the problem in this code.
has comment: http://stackoverflow.com/comment/47760114
has answer: http://stackoverflow.com/a/30000192
answer count: 1
downvote count: 0
tagged with: javascript
has title: how to read audio file in fire fox using file reader class
favorite count: 0
has comment: http://stackoverflow.com/comment/47759944
has comment: http://stackoverflow.com/comment/48693425
type: UnansweredQuestion
tagged with: firefox-os
upvote count: 1
type: Question
tagged with: audio

http://stackoverflow.com/comment/47573899
has text: What is the desired outcome? Doesn't the array already contain individual strings? Note that you cannot use literals in the parameter definition.
comment on: http://stackoverflow.com/q/29719678
type: Comment
type: QuestionComment
score: 5

http://stackoverflow.com/q/29812914
upvote count: 11
has comment: http://stackoverflow.com/comment/79204616
tagged with: javascript
tagged with: meteor
has body: I'm trying to use Chrome DevTools for some of my development for my Meteor project (specifically my LESS files, but that's irrelevant). It looks like Chrome currently has a bug that causes it to use the query string for the URL for the mapping, without any ability to tell it to just ignore the question. Meteor puts query strings on all of the style sheets, JavaScript files, etc., so that's problematic. I see two possible solutions to this. Can anyone tell me: Is it possible to remove the query strings from Meteor (at least in a dev environment)? Or, is it possible to wildcard the query strings in Chrome some way that isn't mentioned in that bug? Or, can anyone think of another method? Update: I'm not exactly sure what I did, but it loaded without the query strings once and I was then able to do the mapping. Chrome complained about a slight mismatch in URL but otherwise seems to be working. Does anyone know if this is going to last, or if I just got temporarily lucky?
favorite count: 0
has comment: http://stackoverflow.com/comment/55308969
type: UnansweredQuestion
downvote count: 0
answer count: 0
score: 11
tagged with: google-chrome
type: Question
has title: Chrome DevTools Workspace and Meteor
linked to: http://stackoverflow.com/q/42313622
tagged with: google-chrome-devtools

http://stackoverflow.com/comment/47634621
type: AnswerComment
has text: Sorry, but I didn't have the time to dig into that. Hopefully this helped move you further along.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29697742

http://stackoverflow.com/comment/47585710
has text: you can set the css to visibility hidden, thats the only way to 'hide' something without losing its space. Otherwise you need a container to take up the space and load content into that, that way theres always an element taking up the space
score: 0
comment on: http://stackoverflow.com/q/29725696
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29747459
tagged with: jquery
favorite count: 0
has body: I need to group the column name of ccSection in the below json. I need output as Tab1, Tab2. Please help me. I am new of this field.. var temp=[ { "cfId": 3, "ccDisplayOrder": 1, "ccControlID": 1, "ccKey": "stName", "ccSection": "Tab1" }, { "cfId": 3, "ccDisplayOrder": 2, "ccControlID": 2, "ccKey": "stOwner", "ccSection": "Tab1" }, { "cfId": 3, "ccDisplayOrder": 3, "ccControlID": 3, "ccKey": "stBegin", "ccSection": "Tab2" }, { "cfId": 3, "ccDisplayOrder": 4, "ccControlID": 4, "ccKey": "stEnd", "ccSection": "Tab2" } ]
has answer: http://stackoverflow.com/a/29748188
type: Question
answer count: 2
score: -2
possible better answer: http://stackoverflow.com/a/29748345
has title: Group By Column Name in Json Object
has answer: http://stackoverflow.com/a/29748345
tagged with: http://stackoverflow.com/tag/json
downvote count: 2
has comment: http://stackoverflow.com/comment/47627111
accepted answer: http://stackoverflow.com/a/29748188
tagged with: javascript
type: AnsweredQuestion
upvote count: 0

openlayers-3
type: Tag
tag name: openlayers-3
tags question: http://stackoverflow.com/q/29752190

http://stackoverflow.com/a/29761908
type: Answer
has comment: http://stackoverflow.com/comment/47659294
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29760778
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29760778
has body: Hi i have check it and the problem you have got that jQuery(window).scroll don't work when you click on Page B because the location is changes and simply to fix this change jQuery(window).scroll to jQuery(document).scroll and it will work jQuery(document).ready(function() { var offset = 220; var duration = 500; //here you should change jQuery(window) to jQuery(document) like this jQuery(document).scroll(function() { if (jQuery(this).scrollTop() &gt; offset) { jQuery('.back-to-top').fadeIn(duration); } else { jQuery('.back-to-top').fadeOut(duration); } }); jQuery('.back-to-top').click(function(event) { event.preventDefault(); jQuery('html, body').animate({scrollTop: 0}, duration); return false; }) });

http://stackoverflow.com/a/29725250
downvote count: 0
has body: $(document).on('change', '#check', function () { if (document.getElementById("check").checked) { $('#check').tooltip("show"); } else{ $('#check').tooltip("hide"); } }); It was trying to hide, even though it shouldn't, separate both cases.
has comment: http://stackoverflow.com/comment/47584960
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/29725157
score: 2

http://stackoverflow.com/comment/47821823
type: Comment
has text: Oops, lol. I forgot to change the url. That won't change anything cause in , my program, I have the right url, seems when I was pasting it here I misplaced the dummy with the real one.
comment on: http://stackoverflow.com/q/29835507
score: 0
type: QuestionComment

http://stackoverflow.com/a/29705999
score: 1
type: Answer
answers question: http://stackoverflow.com/q/29705755
upvote count: 1
has body: I'd use promises. The q library is my favorite way to implement them. But since you're using JQuery, I'd recommend following a similar approach to what I outline below, but using $.when, instead of q.allSettled I often use promises when scraping tons of websites at once -- I need to iterate through a long list of websites, make requests for content, and do something with the content when the requests return. The last thing I want to do is send requests one at a time, handling each one as it returns. In the abstract, that looks something like this: function scrapeFromMany() { var promises = []; _.forEach(urls, function(url) { // this makes the request var promise = scraper(url); // this stores the promise with the others you iterate through promises.push(promise); }); q.allSettled(promises).then(function(res) { // this function is executed when all of the promises (requests) have been resolved console.log("Everything is done -- do something with the results.", res); }); } Fwiw, promises aren't that easy to grok if you've never used them. If that's the case, plan on spending some time getting up to speed with the concepts. They'll change (for the much much better) the way you write async javascript, and they really are the blessed path with these sorts of operations.
downvote count: 0

http://stackoverflow.com/q/29693920
upvote count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47524593
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/29777575
possible better answer: http://stackoverflow.com/a/29706451
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29706451
tagged with: php
score: 4
has body: I did a little page with 3 graphics using the Google API. Everything worked perfectly. However from one moment to the other crashed. In the chart of the place appears this message: bL is not the function Does someone can explain to me why this happens? My example working: &lt;script type="text/javascript" src="https://www.google.com/jsapi"&gt;&lt;/script&gt; &lt;script&gt; google.load("visualization", "1", {packages:["corechart"]}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('string', 'Date'); data.addColumn('number', '2015'); data.addColumn('number', '2014'); data.addRows([ ['Jan', 197680, 241921], ['Fev', 183619,205572], ['Mar', 205643,214666], ['Abr', 205643,202097], ['Mai', 0,210007], ['Jun', 0,202434], ['Jul', 0,217502], ['Ago', 0,175038], ['Set', 0,206510], ['Out', 0,209802], ['Nov', 0,197122], ['Dez', 0,162796] ]); var options = { title: 'Energia 2014/2015', titleTextStyle: {color: 'white', fontSize: '18'}, chart_M: 'function', legend: {textStyle: {color: 'white'}}, colors: ['#0099FF', '#11334c'], backgroundColor: "transparent", hAxis: {title: '', textStyle: { color: '#C8C8C8' }}, vAxis: {title: '', textStyle: { color: '#C8C8C8' }} }; var chart = new google.visualization.ColumnChart(document.getElementById('chart_energy')); chart.draw(data, options); } &lt;/script&gt; This is how it was working. From one moment to the other was so.
answer count: 3
has answer: http://stackoverflow.com/a/29694216
has title: Google Chart error: b.L is not a function
tagged with: charts
has answer: http://stackoverflow.com/a/29777575

http://stackoverflow.com/comment/47538133
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29701127
score: 1
has text: Read documentation: https://api.jquery.com/add/ (... resulting collection from .add() will be sorted in document order ...)

http://stackoverflow.com/comment/47600193
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29724631
type: Comment
has text: You are very welcome. Just to help you on your way -- the var item = a ? b : c is called a "ternary expression." The 'site_data' on the left is evaluated for "truthiness." (see: http://james.padolsey.com/javascript/truthy-falsey/ ) Javascript has some strange behavior, and a lot of it has to do with its unique evolution. But stick with it. One day, when you are programming in a more classical language, you'll think to yourself, "why can't they make this easy, like it is in javascript?" :-D

http://stackoverflow.com/q/29773962
has comment: http://stackoverflow.com/comment/47678949
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47678600
possible better answer: http://stackoverflow.com/a/29774423
accepted answer: http://stackoverflow.com/a/29774209
linked to: http://stackoverflow.com/q/1876485
has answer: http://stackoverflow.com/a/29774506
has answer: http://stackoverflow.com/a/29774423
answer count: 3
has comment: http://stackoverflow.com/comment/47678412
downvote count: 0
favorite count: 0
tagged with: multidimensional-array
upvote count: 2
has title: populate select dropdown with keys from JSON array
has comment: http://stackoverflow.com/comment/47678418
has comment: http://stackoverflow.com/comment/47678668
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29774209
has comment: http://stackoverflow.com/comment/47678326
has body: I have the following json-array available: { "Particulier": { "Weekend": { "2015": { "04": [ { "startDate": "24-04-2015", "endDate": "27-04-2015", "price": 1111 }, { "startDate": "15-04-2015", "endDate": "22-04-2015", "price": 9999 }, { "startDate": "17-04-2015", "endDate": "24-04-2015", "price": 0 } ], "05": [ { "startDate": "01-05-2015", "endDate": "04-05-2015", "price": 2222 } ] }, "2016": { "05": [ { "startDate": "08-05-2016", "endDate": "15-05-2016", "price": 5555 }, { "startDate": "15-05-2016", "endDate": "22-05-2016", "price": 6666 }, { "startDate": "13-05-2016", "endDate": "20-05-2016", "price": 11111 } ], "04": [ { "startDate": "24-04-2016", "endDate": "27-04-2016", "price": 1111 }, { "startDate": "15-04-2016", "endDate": "22-04-2016", "price": 9999 }, { "startDate": "17-04-2016", "endDate": "24-04-2016", "price": 0 } ] } }, "Midweek": { "2015": { "04": [ { "startDate": "20-04-2015", "endDate": "24-04-2015", "price": 3333 }, { "startDate": "27-04-2015", "endDate": "01-05-2015", "price": 4444 } ] } } }, "Clienten en patienten": { "Weekend": { "2016": { "01": [ { "startDate": "08-01-2016", "endDate": "11-01-2016", "price": 7777 }, { "startDate": "09-01-2016", "endDate": "16-01-2016", "price": 8888 } ] } } } } Is it possible to retrieve all the keys on the same level so they can be used by jQuery to populate a select dropdown. With on the same level I mean : 'Particulier' &amp; 'Clienten en patienten' and 'Weekend' &amp; 'Midweek' &amp; 'Week' and so on.. If any information is required please ask, new to this. Thanks in advance!
linked to: http://stackoverflow.com/q/11922383
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47678506

http://stackoverflow.com/a/29753807
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29710817
has body: The value is actually stored in the artistForm object in the scope. You just need to change: name: this.name to name: $scope.artistForm.name.$viewValue PS: console.log($scope) helps a lot with the investigation
answers question: http://stackoverflow.com/q/29710817
upvote count: 2

http://stackoverflow.com/q/29836122
favorite count: 0
has answer: http://stackoverflow.com/a/29836240
has title: Weighted Random number selection
upvote count: 2
accepted answer: http://stackoverflow.com/a/29836240
downvote count: 1
type: AnsweredQuestion
score: 1
type: Question
has body: I'm developing a node.js app where a winner has to be randomly selected based on it's win probability in the range of [0, 100] % My code is as follows: var activeGame = { id: 12324, type: 1, active: true, players: [{ id: 5032, name: "Username", foo: true, winProbability: 56.32 //% }, { id: 98243, name: "Username", foo: true, winProbability: 22.68 //% }, { id: 10943, name: "Username", foo: false, winProbability: 21.00 //% }], }; I've found other algorithms that weren't very clear and didn't work with probabilities adding up to 100%. I'm looking for a way to create a function selectRandomWinner() to return the index of the winning player but I'm stuck and all and any help would be greatly appreciated. Thanks!
tagged with: javascript
has comment: http://stackoverflow.com/comment/47799290
tagged with: random
answer count: 1

http://stackoverflow.com/q/29717373
tagged with: http://stackoverflow.com/tag/svg
type: Question
tagged with: javascript
score: 0
tagged with: compatibility
answer count: 1
has body: (Plunkr: http://plnkr.co/edit/S0nSaeFU2TjSSDgvTL3s?p=preview) I'm trying to dynamically set the URL of an SVG in my Angular app. In my controller I have: $scope.svg = "http://url/of/svg.svg" And in my HTML I have: &lt;object type="image/svg+xml" data="{{svg}}" /&gt; On Chrome and Firefox when I load my page I first get a 404 for {scope}, I then get a successful request for http://url/of/svg.svg. The image is displayed correctly. But in Safari I just get the 404 for {scope}, it never attempts to request the SVG. No image is displayed. Is there something special I have to do to get Safari to respect scope changes for SVGs?
tagged with: angularjs
has title: Angular SVG URL from scope does not work in Safari
has answer: http://stackoverflow.com/a/29734663
accepted answer: http://stackoverflow.com/a/29734663
tagged with: safari
type: AnsweredQuestion

http://stackoverflow.com/comment/47794804
comment on: http://stackoverflow.com/a/29831674
has text: Hmmm... the showpnd and showcpu work fine for the onclick() events.. but how can I call or trigger a similar function based on the data returned $prepdel? Assign a hidden element like so: echo " ";
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47600314
has text: If you are referring to the chrome developer console, it remains blank. And when I say "not interacting" I include something being wrong with the request in the first place that prevents it from being sent. Which is why I included the scripts and functions.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29733411

http://stackoverflow.com/q/29699738
has comment: http://stackoverflow.com/comment/47535577
has comment: http://stackoverflow.com/comment/47537513
type: UnansweredQuestion
tagged with: php
has body: I have the following script Essentially the phpCall() should only execute after $form.append($(' ').val(token); to be executed again, the user would have to refresh or land on the page, and hit the submit button again. The problem here is that when a user hit submit, then the php code gets executed, which is great but when the page refresh or user relands on the page the php code gets executed regardless if the submit button was clicked. Below is the php code, where I would like to store the value of this input and post it on the php page php page: <?php $course_price_final = $_POST['course_price_final']; $course_token = $_POST['stripeToken']; $course_provider = $_POST['course_provider']; $user_email = $_POST['user_email']; $course_delivery = $_POST['course_delivery']; $order_date = date("Y-m-d"); $insert_c = "insert into orders (course_title,course_price_final,course_provider,user_email,course_date,course_delivery,order_date,course_token) values ('$crs_title','$course_price_final','$course_provider','$user_email','$course_date1','$course_delivery','$order_date','$course_token')"; $run_c = mysqli_query($con, $insert_c); Update: Error! <? $success ?> <? $error ?> Choose Start Date <?php if(isset($_GET['crs_id'])){ $course_id = $_GET['crs_id']; $get_crs = "select * from courses where course_id='$course_id'"; $run_crs = mysqli_query($con, $get_crs); while($row_crs=mysqli_fetch_array($run_crs)){ $course_date1 = $row_crs['course_date1']; echo $course_date1 ; } } ?> <option value=<?php if(isset($_GET['crs_id'])){ $course_id = $_GET['crs_id']; $get_crs = "select * from courses where course_id='$course_id'"; $run_crs = mysqli_query($con, $get_crs); while($row_crs=mysqli_fetch_array($run_crs)){ $course_provider = $row_crs['course_provider']; $course_date2 = $row_crs['course_date2']; $course_price = $row_crs['course_price']; $course_title = $row_crs['course_title']; $course_priceFinal = $row_crs['course_priceFinal']; $dig = explode(".", $row_crs['course_tax']); $course_tax = …
score: 2
has answer: http://stackoverflow.com/a/29701346
downvote count: 0
has title: Running a php code after script been successfully executed
tagged with: mysql
has comment: http://stackoverflow.com/comment/47540419
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/47540215
answer count: 2
has comment: http://stackoverflow.com/comment/47535519
has answer: http://stackoverflow.com/a/29699862
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/47535468
favorite count: 0

http://stackoverflow.com/q/29752613
has body: Here is my html snippet: {{row.inventory_serialno}} SL No: Goal: Get the value of an element inside ng-repeat (In this case the 'h6' tag value of each row) Use that corresponding value to autofill the value of respective text box input present in each row. The input text box is out of the ng-repeat scope. For some reason i cant access the value of the h6 tag if i do this (gives a value null) document.getElementById("1").innerHTML; //or even text() Weirdly i noticed the above JavaScript code runs fine on the browser console but not on my script (which means its something to do with the angular element generation time.. May be i'm accessing it before it even got generated). Nonetheless can someone please shed some light on the solution. Thanks in advance. ******** Updated with controller code ***** app.controller('InventoryCtrl', function ($scope) { var x = document.getElementById("1").innerHTML; // giving a null value console.log(x); $scope.rowCollection = [{ id: 100, inventory_serialno: 'HW13FGL' }, { id: 101, inventory_serialno: 'SM123GH' }, { id: 102, inventory_serialno: 'LK90100' }]; });
type: Question
has comment: http://stackoverflow.com/comment/47637443
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47637743
has comment: http://stackoverflow.com/comment/47637559
has comment: http://stackoverflow.com/comment/47637423
has answer: http://stackoverflow.com/a/29752946
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: angularjs
has title: Get the value of an element inside ng-repeat
upvote count: 2
type: UnansweredQuestion
downvote count: 1
has comment: http://stackoverflow.com/comment/47637874
score: 1

http://stackoverflow.com/a/29835768
has body: It seems in your code FIREuni is a global variable that is being modified from within the function checkCookie(). It is possible to this if somewhere where you opened the tag, you declared it explicitely as var FIREuni;, or VAR FIREuni = false; or var FIREuni = TRUE; depending on the default value you want it to have or if you want it to be null before any validation is done. About your specific question, the if is correct in your case, is just a matter of if(condition){ }else{ }` and your condition seems to come from another function that checks if a cookie named src is set in the client's machine. I wouldn't though recommend you to use the approach you are using, eventhough is fine, I wouldn't set a global variable if the cookie is set with the function you are using, but I would move the whole code that is creating the object in case it is set or not, to the function getCookie(), and then, whenever you need to check if the cookie is set, call this function, and if the object is initialized leave as it is, and if it is not do whatever you should do, I mean, put it all in blank, or initialize it with the user's values. That would be more efficient in my opinion and wouldn't be using global variables which is confusing, time consuming and some times not a good practice.
type: Answer
downvote count: 1
upvote count: 0
answers question: http://stackoverflow.com/q/29835679
score: -1
has comment: http://stackoverflow.com/comment/47798529
has comment: http://stackoverflow.com/comment/47798337

http://stackoverflow.com/a/29791668
has comment: http://stackoverflow.com/comment/47768062
has comment: http://stackoverflow.com/comment/47947764
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/47739667
score: 3
has body: try using these changes of width and useHtml for Xaxis. xAxis: { tickInterval: 1, title: { text: 'Category Axis Label', margin: 10 }, labels: { autoRotation: [-20, -40, -80], padding: 0, style: { width : '100px' }, useHTML: true }, categories: true, gridLineWidth: 1 }, Or You can use this workaround series: [ { id: 'Drilldown_749_6', index: 0, name: 'Y-Axis Label', data: [ { name: ' ', y: null }, { name: 'Abc def ghi jkl mno pqr stu vwx yx 123 456 789 0', y: 90000 }, { name: 'Abc def ghi jkl mno pqr stu vwx yx 123 456 789 0', y: 710000 }, { name: 'Abc def ghi jkl mno pqr stu vwx yx 123 456 789 0', y: null }, { name: 'Abc def ghi jkl mno pqr stu vwx yx 123 456 789 0', y: 1740000 }, { name: 'Abc def ghi jkl mno pqr stu vwx yx 123 456 789 0', y: 800000 }, { name: 'Abc def ghi jkl mno pqr stu vwx yx 123 456 789 0', y: 800000 }] } ],
downvote count: 0
answers question: http://stackoverflow.com/q/29788382

http://stackoverflow.com/a/29823712
score: 0
has comment: http://stackoverflow.com/comment/47779152
has comment: http://stackoverflow.com/comment/47775149
has comment: http://stackoverflow.com/comment/47779679
has comment: http://stackoverflow.com/comment/47781824
type: Answer
has comment: http://stackoverflow.com/comment/47781752
has comment: http://stackoverflow.com/comment/47776429
has comment: http://stackoverflow.com/comment/47779241
has comment: http://stackoverflow.com/comment/47779389
answers question: http://stackoverflow.com/q/29821946
has comment: http://stackoverflow.com/comment/47774311
has body: A while ago I wanted to do the same for a completely DOM-based text editor, and needed to find the previous (ARR LEFT) and next (ARR RIGHT) text nodes, both up and down the tree. Based on this code I have made an adaptation suiting this question. Be warned, it's quite performance-heavy, but it is adapted to any scenario. There are two functions findPrevElementNode and findNextElementNode which both return an object with properties: match - returns the closest matching node for the search or FALSE if none is found iterations - returns the number of iterations done to find the node. This allows you to check whether the previous node is closer than the next or vice-versa. The parameters are as follows: //@param {HTMLElement} referenceNode - The node from which to start the search //@param {function} truthTest - A function that returns true for the given element //@param {HTMLElement} [limitNode=document.body] - The limit up to which to search to var domUtils = { findPrevElementNode: function(referenceNode, truthTest, limitNode) { var element = 1, iterations = 0, limit = limitNode || document.body, node = referenceNode; while (!truthTest(node) &amp;&amp; node !== limit) { if (node.previousSibling) { node = node.previousSibling; iterations++; if (node.lastChild) { while (node.lastChild) { node = node.lastChild; iterations++; } } } else { if (node.parentNode) { node = node.parentNode; iterations++; } else { return false; } } } return {match: node === limit ? false : node, iterations: iterations}; }, findNextElementNode: function(referenceNode, truthTest, limitNode) { var element = 1, iterations = 0, limit = limitNode || document.body, node = referenceNode; while (!truthTest(node) &amp;&amp; node !== limit) { if (node.nextSibling) { node = node.nextSibling; iterations++; if (node.firstChild) { while (node.firstChild) { node = node.firstChild; iterations++; } } } else { if (node.parentNode) { node = node.parentNode; iterations++; } else { return false; } } } return {match: …
has comment: http://stackoverflow.com/comment/47774875

http://stackoverflow.com/comment/47784001
comment on: http://stackoverflow.com/q/29828673
type: QuestionComment
type: Comment
score: 0
has text: Doesn't matter. The string representation should also work. `I20150423-18:55:09.950(3)? Thu Apr 23 2015 18:55:09 GMT+0300 (EEST)` is > than `I20150423-18:55:09.950(3)? Thu Apr 23 2015 18:52:52 GMT+0300 (EEST)` try .toString() on the objects

http://stackoverflow.com/comment/61856597
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29722646
has text: @Zorgatone: Only the declaration syntax, not how they are loaded or how they are identified by name.
type: AnswerComment

http://stackoverflow.com/q/29708572
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: qunit
favorite count: 0
has title: Use Require.js for a script with qunit
has answer: http://stackoverflow.com/a/29713877
type: UnansweredQuestion
tagged with: requirejs
downvote count: 1
has body: On my book of Eric Elliot I find these three code but I can not understand like to use them: (1) define(['ch04/amd1', 'ch04/amd2'], function myModule(amd1, amd2) { var testResults = { test1: amd1.test(), test2: amd2.test() }, // Define a public API for your module: api = { testResults: function () { return testResults; } }; return api; }); (2) require(['ch04-amd'], function (amd) { var results = amd.testResults(); test('AMD with Require.js', function () { equal(results.test1, true, 'First dependency loaded correctly.'); equal(results.test2, true, 'Second dependency loaded correctly.'); }); }); (3) if (typeof define === 'function') { define([], function () { return api; }); } I tried to use require.js and I write these codes but it doesn't work: javascript\librerie\jquery.js javascript\librerie\qunit.js javascript\librerie\require.js script_libro_eric_elliott.php Utilizzo della libreria Require.js Utilizzo della libreria Require.js javascript\moduli\script_libro.js define(['ch04/amd1', 'ch04/amd2'], function myModule(amd1, amd2) { var testResults = { test1: amd1.test(), test2: amd2.test() }, // Define a public API for your module: api = { testResults: function () { return testResults; } }; return api; }); javascript\moduli\main.js require(['ch04-amd'], function (amd) { var results = amd.testResults(); test('AMD with Require.js', function () { equal(results.test1, console.log(true), 'First dependency loaded correctly.'); equal(results.test2, console.log(true), 'Second dependency loaded correctly.'); }); }); javascript\configurazione.js /* global requirejs */ requirejs.config({ "baseUrl": "javascript/librerie", "paths": { "moduli": "../moduli" }, "shim": { "script_libro": { deps: ["jquery", "qunit"] } } }); requirejs(["moduli/main"]); I would like to write output strings on console so I edit Eric Elliot's script too. On my console I can only read: Error: Script error for: moduli http://requirejs.org/docs/errors.html#scripterror Could you help me, please? NEW UPDATE I b…
score: -1

http://stackoverflow.com/comment/47574661
has text: @ElizabethDimova How about `return false;` instead of that line?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29719753
score: 0

http://stackoverflow.com/comment/47630690
score: 0
comment on: http://stackoverflow.com/q/29740712
type: Comment
type: QuestionComment
has text: yes your right ,I was rushing didn't post the complete code. I want to calculate distance using users location and the position of each marker. I tried to use "place.vucinity" to get addresses of places returned from my textsearch but, it keeps giving me the same value for all the search results. Please is there any better approach to calculating distance. My method returns value but the results are wrong.

http://stackoverflow.com/comment/47689924
comment on: http://stackoverflow.com/q/29779829
type: Comment
type: QuestionComment
score: 0
has text: New to web development->tries to make a gallery of images. Go through the basics first please. It sounds harsh but that is my best advice. Learn html, css, javascript in that order.

http://stackoverflow.com/a/29802630
upvote count: 2
type: Answer
score: 2
has body: You can also use the starts-with jQuery selector: $('id^="table"').hide(); $('id^="list_row"').on('click',function(){ var num = this.id.split('w')[1]; //alert(num) $('id^="table"').hide(); $('#table'+num).show(); }); Reference: All jQuery Selectors
answers question: http://stackoverflow.com/q/29802395
downvote count: 0
has comment: http://stackoverflow.com/comment/47733249

http://stackoverflow.com/comment/47672421
has text: What do you mean by "save" it as a variable?
comment on: http://stackoverflow.com/q/29770895
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47642741
score: 0
has text: You should try not to post your entire Javascript file, but instead post a minimal version of where you are having a problem. In this case, you could post only the portion of the code that is handling this *Calendario*. If you absolutely need all of your code, then create a [fiddle](http://jsfiddle.net). Also, please put a link to the plugin you are using so that we can review the documentation to help you.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29754936

http://stackoverflow.com/a/29754647
answers question: http://stackoverflow.com/q/29753964
score: 2
downvote count: 0
has body: You already described one of the key advantages. Another advantage is that some scripts may never be used. For example, you may have a script that integrates Google Wallet payments or Facebook login, but not every user needs these features every time. So there is no reason to load these scripts until actually needed.
upvote count: 2
type: Answer

http://stackoverflow.com/comment/47669037
has text: pass only parameter to get faster response otherwise u have perform more coding work for this
comment on: http://stackoverflow.com/q/29769154
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29738019
type: Answer
upvote count: 1
score: 1
has body: Just define yours after the original. Assuming you don't need to keep anything in the original. If you do . . . like if you need to wrap it in something else for example, you can do something like this: var origBuildDropdown = buildDropdown; function buildDropdown() { // Do pre-function stuff // Invoke original function origBuildDropdown(); // Do post-function stuff }
answers question: http://stackoverflow.com/q/29737988
downvote count: 0

http://stackoverflow.com/a/29732691
answers question: http://stackoverflow.com/q/29732498
type: Answer
score: 3
has body: this is a pseudo-parameter, it is passed to the function every time the function is called. var person1 = { name: "John" }, person2 = { name: "Maria" }; function f (greeting) { return greeting + ", my name is " + this.name; } f.apply(person1, ["hi"]) // "hi, my name is John" f.apply(person2, ["hello"]) // "hello, my name is Maria" So what happens when you call it normally, like foo(); ? Well, it depends, on whether you're using "strict mode" or not: when NOT using "strict mode", the function will receive the global object (window) as this. when using "strict mode", the function will receive undefined as this. To adapt your example: var log = function(){ return "this is log func"; } var greeting = function(){ return "Hello world: " + this(); } greeting.apply(log) // "Hello world: this is log func" The above example works, because this is set to the log function. Since this is actually log, you can play around like you are doing with any other function: var log = function(){ return "this is " + this.name; } var greeting = function(){ return "Hello world: " + this.apply({name: "Mark"}); } greeting.apply(log) // "Hello world: this is Mark
upvote count: 3
downvote count: 0

http://stackoverflow.com/comment/47708739
has text: try to place the bordereddiv styles at common css file of your project , then you can use that class anywhere of your views which consist that css file
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29789053

http://stackoverflow.com/a/29745804
has body: You have done some mistakes in code and I listed those thing below. Don't use $('#username').attr('value'). Instead of use $('#username').val(). Because $('#username').attr('value') return the value of the element while the html created. But $('#username').val() will return the current value. Same as change $('#password').attr('value') to $('#password').val(). For more information check this post. Concatenation operator in javascript is + not .. And also u added a variable like $jsonString. In your Server php code, if your using $_POST['loginemployee'] to retrieve the post values means don't use contentType: "application/json; charset=utf-8",. Because it will use the entire content including key as invalid json like loginemployee={"userName":"cloud","password":"cloudnine"}. If you need like that means u need to use file_get_contents('php://input') to retrieve the post content. But better don't use contentType in ajax. So you can able to easily get the post content using $_POST['loginemployee']. And also if the reply is json means use dataType in ajax, else dont use that. For more information about contentType and dataType check this post. So, I updated the code. Check and reply back if there is any issues. Hope it will work as your wish. $(document).ready(function(){ $('form#loginForm').submit(function() { // loginForm is submitted var username = $('#username').val(); // get username var password = $('#password').val(); // get password alert(username); var UserData= {"userName":username , "password":password}; var jsonString=JSON.stringify(UserData); var datanew = "loginemployee="+ jsonString; if(jsonString) { alert("encoded"+jsonString); } if (username &amp;&amp; password) { // values are not empty console.log(datanew); $.ajax({ type: "POST", url: "http://url_to_post", // URL // contentType: "application/json; charset=utf-8", // If reply is json means uncomment the below line. // dataType: "json", // send username and password as parameters crossDomain : true, data…
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47660027
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29694300
has comment: http://stackoverflow.com/comment/47659924
answers question: http://stackoverflow.com/q/29694300

http://stackoverflow.com/a/29712886
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29712774
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29712774
has body: It seems like you have the right idea, but you're working too hard, you can just use one array and iterate through that (unless you're worried about a timing attack) like so: function checkAllAns(index) { ansAll[index] = true; for (i = 0; i &lt; ansAll.length; ++i) { if (ansAll[i] != true) { break; } if (i == ansAll.length-1) { document.getElementById("stop-btn").style.display = "inline-block"; document.getElementById("stop-btn").style.opacity = "1"; } } }

http://stackoverflow.com/a/34912924
type: AcceptedAnswer
has body: You can add a &lt;style&gt; tag inside the view that you want to disable the animation on: &lt;style&gt; main.ng-enter { transition: 0.001s; } &lt;/style&gt; I used '0.001s' because setting it to '0s' or 'none' seems to disable the transitions for all views. I've created a plunk showing this working at http://plnkr.co/edit/gbMHlY?p=preview, there are 2 tabs where only the first tab has a fade in transition. The plunk is forked from a tutorial on ngAnimate with UI Router that I just posted.
type: Answer
answers question: http://stackoverflow.com/q/29735496
accepted answer of: http://stackoverflow.com/q/29735496
score: 0

http://stackoverflow.com/a/29802132
has comment: http://stackoverflow.com/comment/47762816
type: Answer
has comment: http://stackoverflow.com/comment/55130068
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47766490
has body: Simplest way is to remember your grid somewhere in your node component and then hide it on itemcollapse event. Quick example based on your code https://fiddle.sencha.com/#fiddle/lnc
answers question: http://stackoverflow.com/q/29797173
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29797173

http://stackoverflow.com/a/29882481
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/47892024
has comment: http://stackoverflow.com/comment/47891833
has comment: http://stackoverflow.com/comment/47912947
downvote count: 0
answers question: http://stackoverflow.com/q/29752566
type: Answer
has body: This is unlikely going to be a satisfying approach - and obviously it isn't based on CSP - but it might be your only option if you really have to prevent such attacks. Before using anything like this, make sure that there is really no way to disable inline scripts (which should cover most attacks). Moreover, you should send your feedback to the public-webappsec@w3.org mailing list with a [CSP2] subject. Here my (incomplete) idea: function guardMethods(clazz, methodNames, urlGetter, allowFilter, reportViolation) { var prototype = clazz.prototype; methodNames.forEach(function (methodName) { var originalMethod = prototype[methodName]; if (originalMethod) { Object.defineProperty(prototype, methodName, { value: function () { var url = urlGetter.apply(this, arguments) || ''; if (allowFilter(url)) { return originalMethod.apply(this, arguments); } else { reportViolation(url); } } }); } }) } function allowFilter(url) { // todo: implement } function reportViolation(url) { console.error('Redirection prevented:', url); } guardMethods(HTMLAnchorElement, ['click', 'dispatchEvent', 'fireEvent'], function () {return this.href}, allowFilter, reportViolation); You would have to implement similar guards for location, location.href, window.open and other functions/properties/events which allow to redirect to other pages. If you miss just one, then you are still vulnerable. Forms, XHR and most other resources can be covered with CSP itself. As far as I know, the prototype hack does not work in some older browsers. Once more, I do not recommend to use this. The chance that you make a mistake or that it does not work in some browsers or that a new API will be added which can be leveraged for redirects is just too high.

primefaces
tags question: http://stackoverflow.com/q/29774131
tags question: http://stackoverflow.com/q/29794056
tags question: http://stackoverflow.com/q/29741968
tags question: http://stackoverflow.com/q/29738536
tag name: primefaces
tags question: http://stackoverflow.com/q/29772191
tags question: http://stackoverflow.com/q/29800689
type: Tag
tags question: http://stackoverflow.com/q/29709815
tags question: http://stackoverflow.com/q/29804319

http://stackoverflow.com/a/29823341
answers question: http://stackoverflow.com/q/29822673
score: 2
has body: The problem is that both modals observe the same attribute (show) for showing/hiding themselves. To correct this, the show attribute must be scoped for each modal and I propose the following: Have a controller that defines the 2 show attributes: app.controller('Ctrl', function($scope) { $scope.show1 = false; $scope.show2 = false; }); And activate it as: Change the modal trigger to have isolated scope and the show attribute, as follows: function modalTrigger() { return { restrict: 'A', transclude: true, link: function(scope, element, attrs) { scope.toggleModal = function() { scope.show = !scope.show; }; }, scope: { show: '=' }, template: ' ' }; } Use it e.g. as: Waiting List Change the modal directive to use isolated scope with the show attribute; simply add: scope: { show: '=' }, to the directive. Use it as: <modal-dialog data-modal-name="modal1" show="ctrl.show1"> A forked plunker with the full solution: http://plnkr.co/edit/cJOXju9H3PMjRdUKqVCF?p=preview
downvote count: 0
has comment: http://stackoverflow.com/comment/47773203
upvote count: 2
has comment: http://stackoverflow.com/comment/47773260
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47772981
accepted answer of: http://stackoverflow.com/q/29822673
type: Answer

http://stackoverflow.com/comment/47643852
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29755686
score: 1
has text: @bloodyKnuckles You could also grab the body quicker with `document.body`

http://stackoverflow.com/a/29805281
has comment: http://stackoverflow.com/comment/47743836
type: Answer
has body: You should move your ... outside of your ... , that way, the .click() function will be captured correctly and open the modal: User Div × Modal title One fine body… Close See this bootply for an example.
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29805039
accepted answer of: http://stackoverflow.com/q/29805039

http://stackoverflow.com/comment/47761332
score: 0
type: Comment
has text: Give them a class instead of ids like shown here. `$('.news')` will create an array of all elements with the class `news` and you can access any of them you want by calling `$('.news').eq(i)` where `i` is the index of of the element you want from that array
comment on: http://stackoverflow.com/a/29816657
type: AnswerComment

http://stackoverflow.com/a/29734350
has body: Because you're muddling jQuery with native JS. The jQuery object has no such property innerHTML - that is a native property. The equivalent in jQuery is the method html() $('something').html('my html');
score: 5
upvote count: 5
answers question: http://stackoverflow.com/q/29734322
type: Answer
downvote count: 0

http://stackoverflow.com/comment/47636726
type: QuestionComment
comment on: http://stackoverflow.com/q/29749532
has text: You need to do some debugging beyond recognising that the error branch of your Ajax function is firing. Look at your browser's developer tools. Look at the JavaScript console. Does it report any errors? Look at the Net tab. Is the request being made? Does it get a response? Do they contain the data you expect?
score: 0
type: Comment

http://stackoverflow.com/comment/47735664
has text: I used image map with jQuery flip method. But then the hovered image cover the main image. So the other slices couldn't be hover at all. Any hints?
comment on: http://stackoverflow.com/q/29803836
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47676278
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29767501
has text: @web-tiki It is probably very user platform dependent.

http://stackoverflow.com/comment/47685019
type: Comment
type: QuestionComment
has text: I assumed this would be a duplicate, but when you don't know the problem it's hard to know what to search for.
comment on: http://stackoverflow.com/q/29777171
score: 0

http://stackoverflow.com/comment/47801768
type: AnswerComment
comment on: http://stackoverflow.com/a/29837577
score: 0
type: Comment
has text: missing before a line break won't throw error though unless it gets minified that way

http://stackoverflow.com/comment/47660796
type: AnswerComment
type: Comment
has text: Well, clearly the OP wanted something else, but thanks !
score: 0
comment on: http://stackoverflow.com/a/29764250

postback
tag name: postback
tags question: http://stackoverflow.com/q/29786640
type: Tag

http://stackoverflow.com/a/29807288
downvote count: 0
type: Answer
score: 1
has body: Fiddle: http://jsfiddle.net/g68wtwfq/ The CSS as posted .class a[href="URL"]{pointer-events: none;} should work. However, I would suggest that you do it server side (don't output the href at all) or with JavaScript (remove the href attribute) If you want to target based on a data attribute .class a[data-product_id="32570"]{pointer-events: none;} should do the trick. One thing to note as I was doing this is that a should be a descendant of .class. If you want to target a link that has class="class" then you should use a.class[attr=value] instead.
answers question: http://stackoverflow.com/q/29807029
upvote count: 1

http://stackoverflow.com/comment/47587458
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29726770
type: Comment
has text: @ManishShukla that is fine .. though it is not recommended

http://stackoverflow.com/q/29715911
has answer: http://stackoverflow.com/a/29715928
has comment: http://stackoverflow.com/comment/47567022
type: UnansweredQuestion
has title: Find a server in local network via client javascript in browser
type: Question
has comment: http://stackoverflow.com/comment/47633948
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/139037457
has answer: http://stackoverflow.com/a/29716089
has comment: http://stackoverflow.com/comment/47665359
downvote count: 0
tagged with: javascript
score: 4
favorite count: 0
has body: Is it possible to find the ip of an http-server (which will respond on a specific request) in local network only via client javascript in the browser? It should work on mobile and desktop browsers. The poor mans way trying out all ip(v4) adresses seems not possible because I cannot get reliably the local ip (http://net.ipcalf.com doesn't work on IE and all mobile browsers on iOS). UDP broadcasts don't seem possible with javascript. Is there any other possibility? My only other alternative seems to be developing a native discovery app for all relevant platforms (win, mac, ios, android).

http://stackoverflow.com/a/29768817
accepted answer of: http://stackoverflow.com/q/29768056
type: Answer
has comment: http://stackoverflow.com/comment/47697111
has body: Yes you need JavaScript (other languages could do it, but it is the simplest I know) for example, you can change HTML to (slightly simplified for the sake of clarity): Home Profile Gallery Contact Home contents Profile contents Gallery Contents Contact contents so you can use class to define which area you click and which area hide/show then use a js file with a .ready function (in my example, save as test.js in same folder as HTML: $(document).ready(function(){ $(".showhome").click(function(){ $(".home").show(); $(".Profile").hide(); $(".Gallery").hide(); $(".Contact").hide(); }); $(".showProfile").click(function(){ $(".home").hide(); $(".Profile").show(); $(".Gallery").hide(); $(".Contact").hide(); }); $(".showGallery").click(function(){ $(".home").hide(); $(".Profile").hide(); $(".Gallery").show(); $(".Contact").hide(); }); $(".showContact").click(function(){ $(".home").hide(); $(".Profile").hide(); $(".Gallery").hide(); $(".Contact").show(); }); // Hide all and show home on page loading $(".home").show(); $(".Profile").hide(); $(".Gallery").hide(); $(".Contact").hide(); }); for a cleaner function, you can also use things like $(".home").toggle();, it would switch the state (if it was shown it would hide and vice versa). but I don't see how right now :)
score: 0
answers question: http://stackoverflow.com/q/29768056
type: AcceptedAnswer

http://stackoverflow.com/comment/47708382
type: Comment
score: 2
has text: I routinely shop at a well known (US) website which works with JavaScript off. If your e-commerce site doesn't, you might not be getting my money.
type: AnswerComment
comment on: http://stackoverflow.com/a/29786995

http://stackoverflow.com/q/29766083
has answer: http://stackoverflow.com/a/29766388
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47663438
has title: html5 canvas draw multiple lines
tagged with: canvas
has body: i am trying to make a function that shows the last move of my 'players', but when i try it shows no errors and/or lines. this is my code: ctx.clearRect(0, 0, canvas.width, canvas.height ); ctx.drawImage(backgroundImg,0,0,canvas.width, canvas.height) for (var i = 0; i &lt; team1X.length; ++i) { ctx.drawImage(playerImg,X[i],Y[i]) } //this part doesn't work for (var i = 0; i &lt; X.length; ++i) { ctx.beginPath(); ctx.moveTo(LastX[i],LastY[i]); ctx.lineTo(X[i],Y[i]); ctx.stroke(); } X, Y, LastX and LastY are arrays with 11 numbers.
tagged with: html5-canvas
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/q/29731465
has answer: http://stackoverflow.com/a/29731611
tagged with: javascript
has body: When ever I press a back button in google chrome browser, For the first click it doesnt navigate instead it store the data in cache and while I press it again it goes back and displays stale information. I am using JS and Perl in my web page. I dont want the data to be cached. I want to stop displaying stale information. Could some body please help me regarding this. Thanks Ruban C
accepted answer: http://stackoverflow.com/a/29731611
answer count: 1
has title: Back Button issue in Chrome due to cache
favorite count: 0
tagged with: google-chrome
downvote count: 1
type: AnsweredQuestion
score: -1
type: Question
upvote count: 0
tagged with: perl

http://stackoverflow.com/a/29708869
score: 1
has body: For those who research and come across this post, the proper answer to my question is to detect the value that has been checked by doing this: 'donation' : $('input[name=donation]:checked').val(),
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29708508
downvote count: 0

http://stackoverflow.com/comment/47629813
type: Comment
comment on: http://stackoverflow.com/a/29748727
has text: And I'm telling you it's the wrong method to iterate and alert ?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47781852
score: 0
comment on: http://stackoverflow.com/a/29778972
type: Comment
has text: Thank you all! Very nice of you to put such effort into my problem :) I figured could call the function with the model as a parameter, thus being sure it changes. I dont know however if this is the correct method, but it works! :) ` `
type: AnswerComment

http://stackoverflow.com/comment/47770253
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29821973
has text: Use a class instead of an id then

http://stackoverflow.com/q/29738543
downvote count: 0
has title: Prompting for a variable not working when trying to find random number
favorite count: 0
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47610278
upvote count: 1
type: Question
has body: My assignment for Intro to Javascript is to: "Write a function that accepts two numbers and returns a random number between the two values." It seems easy enough until I attempt to prompt the variables to input, at which point the output seems incorrect. This is code that is most recommended for finding a random number between two ints, in this case 1 and 6: function getRandomizer(bottom, top) { return function() { return Math.floor( Math.random() * ( 1 + top - bottom ) ) + bottom; } } var rolldie = getRandomizer(1, 6); document.write(rolldie()); The output I get is what it should be, a random integer between 1 and 6. However my assignment is to prompt for the numbers, which can be anything. So I do this, using 10 and 1 as example numbers: var max = prompt("input 10"); var min = prompt("input 1"); function getRandomizer(bottom, top) { return function() { return Math.floor( Math.random() * ( 1 + top - bottom ) ) + bottom; } } var rolldie = getRandomizer(min, max); document.write(rolldie()); The output: 961. Second try: 231. etc. If I set the variables max and min directly to 10 and 1, the code works perfectly, returning numbers between 1 and 10. But for some reason, prompting input and then entering the exact same numbers gives completely different output. Why does this happen and how can I fix it?
answer count: 2
has answer: http://stackoverflow.com/a/29738585
tagged with: javascript
has answer: http://stackoverflow.com/a/29738573
has comment: http://stackoverflow.com/comment/47610357

http://stackoverflow.com/comment/47718343
type: Comment
comment on: http://stackoverflow.com/q/29795086
score: 0
has text: Code from: https://docs.shopify.com/support/your-store/collections/filtering-a-collection-with-multiple-tag-drop-down
type: QuestionComment

http://stackoverflow.com/comment/47538855
has text: `$(".error").remove();` `$(".text-success").remove();` add these at the top in the function. This will remove previous messages and prepend new one
score: 1
comment on: http://stackoverflow.com/a/29700325
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29811147
tagged with: multidimensional-array
upvote count: 2
has title: Whitelist a set of properties from a multidimensional json array and delete the rest
score: 2
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question
has body: For examples sake i'll use a github api response as my data input. https://api.github.com/users/unsalted/repos I have a list of properties I want to keep, the rest I want to discard because I want to keep the output i'm generating considerably more compact. How can I achieve my goal without doing this: for (var i = tagged.length - 1; i &gt;= 0; i--) { delete tagged[i].private; delete tagged[i].owner.gravatar_id; delete tagged[i].owner.url; delete tagged[i].owner.followers_url; delete tagged[i].owners.following_url; delete tagged[i].gravatar_id; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; }; I am using lodash in the project so lodash solutions are more than welcome. For times sake I didn't fill out the rest of the values but you get the idea...
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29814858
answer count: 1
downvote count: 0
tagged with: lodash
favorite count: 0
has answer: http://stackoverflow.com/a/29814858

http://stackoverflow.com/comment/47579013
type: Comment
has text: It's good practice to use a form, and prevent it's submit with javascript e.preventDfault() method, so it can be used also if js is disabled.
comment on: http://stackoverflow.com/q/29722215
score: 1
type: QuestionComment

http://stackoverflow.com/comment/47632794
type: AnswerComment
comment on: http://stackoverflow.com/a/29749514
score: 0
type: Comment
has text: Method 2 is calling method 1, method 1 is setting mWebView and then returning it back to method 2: public void method2() { Log.v("Url", method1()); } public String method1() {webView.post(new Runnable() { public void run() { mWebView.loadUrl("javascript:" + s + ";"); mWebViewUrl = mWebView.getUrl(); } }); return mWebViewUrl;}

http://stackoverflow.com/comment/47800144
type: QuestionComment
comment on: http://stackoverflow.com/q/29836445
score: 0
type: Comment
has text: Answer Thank you. I wanted to know this.

http://stackoverflow.com/a/29767577
has body: Try this code, start typing url like http://google.com : function myFunction() { var x = document.getElementById("myText").value; document.getElementById("demo").innerHTML = x; window.open(x, '_blank'); } Surf here: Load If you test here, you will get this error in console Blocked opening 'http://google.com/' in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set, then put that in your code.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29767274

http://stackoverflow.com/comment/47793400
comment on: http://stackoverflow.com/a/29833324
type: AnswerComment
has text: Here is my output: wait... Thu Apr 23 2015 13:11:04 GMT-0700 (PDT) ok... Thu Apr 23 2015 13:11:04 GMT-0700 (PDT)
score: 0
type: Comment

http://stackoverflow.com/comment/47874290
has text: For zooming in and out you can use the svg tag, vector based graphics are just made for such things. And you can use a canvas to interact with your graphs. The answer from Entity Black is what I wanted to tell you, I was just limited in characters. You have more options with Pixi and Three.js, but also more limitations, since both of them are based on a custom render loops (that actually is easy to blow up with overheads).
comment on: http://stackoverflow.com/q/29838206
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47648928
type: Comment
type: QuestionComment
has text: @TimMcClure, there was a little bug in your fiddle. Calling `trigger()` wouldn't actually do anything on it's own. I changed it to `trigger("click")` [here](http://jsfiddle.net/3zp1ocnt/1/), and you'll see in Chrome at least a warning that a popup was blocked.
comment on: http://stackoverflow.com/q/29757604
score: 0

http://stackoverflow.com/q/29735344
has comment: http://stackoverflow.com/comment/47603804
type: UnansweredQuestion
downvote count: 2
tagged with: onclick
has answer: http://stackoverflow.com/a/29735377
type: Question
tagged with: addclass
upvote count: 0
score: -2
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to make a navbar out of text that hides/shows different divs. I want to have it so when you click on one of the options, the text turns red to show that it's been selected, and whatever other item is selected is "unselected". I am fairly new to JavaScript, but I thought the best way to do this is to add a class to it onClick, and remove the class from its siblings onClick. But it's not working—nothing happens onClick. What am I doing wrong? test Option 1 Option 2 Option 3
has title: onClick addClass color to navbar item - not working
favorite count: 0

http://stackoverflow.com/comment/47677891
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29773495
type: AnswerComment
has text: @KristofferK: I updated my answer with suggestion about class variables.

http://stackoverflow.com/comment/47626568
comment on: http://stackoverflow.com/q/29736331
score: 0
has text: @Teepeemm Btw i had a mistake, i used `chrome.tabs.getCurrent`, not executeScript, check edited question again
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29829402
has body: IMAGE OF FORM HTML: ..... .......... 2015 .... I tried to get data this way, but it didn't works: var birthdate = $contactForm.getElement('select[name="birthdate"]').getProperty('value'); How to get array from form in JS or Mootools to send it than to PHP? Will be send data to PHP in JSON format.
upvote count: 1
linked to: http://stackoverflow.com/q/1184624
answer count: 1
has title: How to get array from form in JS or Mootools to send it than to PHP?
favorite count: 0
has comment: http://stackoverflow.com/comment/47785515
tagged with: php
has comment: http://stackoverflow.com/comment/47785441
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47791751
tagged with: mootools
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29829993
accepted answer: http://stackoverflow.com/a/29829993

http://stackoverflow.com/comment/47599096
has text: that was valid. Thanks. @A.Wolf ! do u suggest me to host the site in an online domain and then try the iframe? and what if I don't use any scripting to adjusting the site size and just using a normal iframe? I tried that and I still got a blank white page.
comment on: http://stackoverflow.com/q/29732180
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47541685
type: AnswerComment
has text: This is the point of this line : document.getElementsByClassName('main')[0].innerHTML = searchResult;
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29702277

http://stackoverflow.com/comment/47813393
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29843323
type: QuestionComment
has text: I want it to be an image link, as in, when I click on the image, it will redirect me to another page, for example "products.php"

http://stackoverflow.com/comment/48057636
has text: Please, improve your question being more specific of what you want. Why do you think Offline.js isn't useful on your case?
score: 1
comment on: http://stackoverflow.com/q/29802403
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29711219
tagged with: d3.js
type: Question
type: AnsweredQuestion
has title: How to freeze and unfreeze hover line on click in D3
tagged with: linegraph
tagged with: bar-chart
answer count: 1
has body: my friend and I each created a chart using D3 and we combined it together looking something like this: http://jsfiddle.net/vertaire/vba1ryzp/5/ We were hoping to remove the slider and replace it with the line hover in the line graph. The hover line returns the year whenever you move the mouse, currently. chart1.append('svg:rect') // append a rect to catch mouse movements on canvas .attr('width', chart1_width) // can't catch mouse events on a g element .attr('height', chart1_height) .attr('fill', 'none') .attr('pointer-events', 'all') .on('mouseout', function(){ // on mouse out hide line, circles and text d3.select(".mouseLine") .style("opacity", "0"); d3.selectAll(".mouseCircle circle") .style("opacity", "0"); d3.selectAll(".mouseCircle text") .style("opacity", "0"); }) .on('mouseover', function(){ // on mouse in show line, circles and text d3.select(".mouseLine") .style("opacity", "1"); d3.selectAll(".mouseCircle circle") .style("opacity", "1"); d3.selectAll(".mouseCircle text") .style("opacity", "1"); }) .on('mousemove', function() { // mouse moving over canvas d3.select(".mouseLine") .attr("d", function(){ yRange = y.range(); // range of y axis var xCoor = d3.mouse(this)[0]; // mouse position in x var xDate = x.invert(xCoor); // date corresponding to mouse x d3.selectAll('.mouseCircle') // for each circle group .each(function(d,i){ var rightIdx = bisect(data[1].values, xDate); // find date in data that right off mouse yVal = data[i].values[rightIdx-1].VALUE; yCoor = y(yVal); var interSect = get_line_intersection(xCoor, // get the intersection of our vertical line and the data line yRange[0], xCoor, yRange[1], x(data[i].values[rightIdx-1].YEAR), y(data[i].values[rightIdx-1].VALUE), x(data[i].values[rightIdx].YEAR), y(data[i].values[rightIdx].VALUE)); d3.select(this) // move the circle to intersection .attr('transform', 'translate(' + interSect.x + ',' + interSect.y + ')'); d3.select(this.children[1]) // write coordinates out .text(xDate.getFullYear() + "," + yVal)…
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29711312
accepted answer: http://stackoverflow.com/a/29711312

http://stackoverflow.com/comment/49294632
has text: Just change your method to return a List<string> and return that - you don't need to manually serialise this, it happens under the hood with webapi
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29819781

http://stackoverflow.com/comment/47648755
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29757604
has text: [This jsfiddle](http://jsfiddle.net/3zp1ocnt/) shows one implementation of what @redbmk mentions in their comment above, but as they correctly predicted, the second window is blocked. Browsers usually block windows from opening when it is not directly opened by a user action (in this case, the first is opened directly by the user, the second is opened as a **result** of the initial click).

http://stackoverflow.com/q/29702565
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47540949
score: 1
upvote count: 1
type: Question
has body: Hello I am new with JavaScript trying to find solution for my problem. Is there any way I can live highlight my text like we do in PDF's ? Something like this: Plunker Relevant Code llentesque volutpat tempus eleifend. Integer viverra erat ante. Aliquam gravida ac nibh non sollicitudin. highlight I have a button which allow/enable text highlighting on click. Then I drag my mouse selecting texts will get yellow background color. Is this possible ? Any example will really help. Thanks Demo var app = angular.module('plunker', []); app.controller('MainCtrl', function($scope) { }); .box span { background: yellow; } llentesque volutpat tempus eleifend. Integer viverra erat ante. Aliquam gravida ac nibh non sollicitudin. highlight DEMO: llentesque volutpat tempus eleifend. Integer viverra erat ante. Aliquam gravida ac nibh non sollicitudin.
linked to: http://stackoverflow.com/q/8644428
accepted answer: http://stackoverflow.com/a/29703503
tagged with: javascript
answer count: 2
has title: Live text highlight
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47541092
possible better answer: http://stackoverflow.com/a/29703361
has answer: http://stackoverflow.com/a/29703503
has comment: http://stackoverflow.com/comment/47541021
has answer: http://stackoverflow.com/a/29703361

http://stackoverflow.com/comment/47722125
type: QuestionComment
comment on: http://stackoverflow.com/q/29796263
score: 0
has text: CSS solution for your problem does not exist. My solution -> I have set class of .child to child element and class of .parent to parent element. Because you have said that you have more of this elements you could reuse those classes on all elements. Script loop through all of your elements that have class .child and calculate its width and height. After script gets sizes it puts those sizes to the parent of that child. In this way parent element will have same size as its child. One problem is that in this solution you will have to call this script also on browser resize.
type: Comment

http://stackoverflow.com/q/29805922
has answer: http://stackoverflow.com/a/29806126
tagged with: extjs
score: 0
answer count: 1
type: AnsweredQuestion
has body: I am trying to minify sencha 5 project with sencha cmd, but it always failed. sencha generate app -ext demoApp ./demoApp Then I try to minify the app, by typing sencha app build production For blank project, the minify success, I can run in my local web server. Then I change the existing project that have been created, just add one button to display popup window (and the information displayed by xtype "displayfield"). Before it minified &amp; after add one button to display popup, it works normal (tested in browser, click the button, the popup and information showed correctly). After minified, it doesn't work, GET http://localhost/test/sencha/demoApp/widget/displayfield.js?_dc=1429726459576 404 not found. "NetworkError: 404 Not Found - http://localhost/test/sencha/demoApp/widget/displayfield.js?_dc=1429726459576" Is it weird? If I change the xtype "displayfield" to "textfield" it works normal, or if I change to "button" and change fieldLabel to text, it works! Anyone have succesfull minify sencha 5 with sencha cmd? My Sencha Cmd version is 5.1.2.52 and I use sencha 5.1.0.107. I attach the original app folder code original in here and my changes app code in here Many thanks!
tagged with: sencha-cmd
accepted answer: http://stackoverflow.com/a/29806126
type: Question
has title: Sencha cmd 5 minify issue
tagged with: javascript

http://stackoverflow.com/a/29774051
score: 1
accepted answer of: http://stackoverflow.com/q/29709388
has body: I haven't used Reflux, but I think the issue here is that all your Graph instances are listening to the GraphStore, and as soon as that store sends an event, all component instances will receive that event. They will filter out the data they're not interested in, but Reflux will still call setState on all instances, triggering them to re-render. Reflux does not (to my knowledge) short-circuit re-renders if the result of the filter function is the same as it was before. To short-circuit it and avoid re-rendering when you get the same data back, you need to implement the shouldComponentUpdate method on the component and compare the new state to the old state, and return false if it's the same. A popular approach to this is to use [1] Immutable.js together with the [2] PureRenderMixin, which does the short-circuiting for you. [1] https://github.com/facebook/immutable-js [2] https://facebook.github.io/react/docs/pure-render-mixin.html
upvote count: 1
has comment: http://stackoverflow.com/comment/48338590
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47691431
type: Answer
has comment: http://stackoverflow.com/comment/47690841
answers question: http://stackoverflow.com/q/29709388
downvote count: 0

http://stackoverflow.com/comment/47710015
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29790434
type: Comment
has text: its working fine,make sure $verbo_name having null.

http://stackoverflow.com/comment/47869907
has text: Very clean code @frenchie. No, [show()](http://api.jquery.com/show/) has a default of 400 miliseconds, not 0.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29829716
type: AnswerComment

http://stackoverflow.com/comment/47665933
comment on: http://stackoverflow.com/q/29767476
score: 0
type: Comment
type: QuestionComment
has text: can we make custom input field in ionic ?

http://stackoverflow.com/q/29768529
has title: In writing Chrome extensions, how is "var i in windows" (within a callback function(windows)) compiled?
answer count: 3
accepted answer: http://stackoverflow.com/a/29769086
has answer: http://stackoverflow.com/a/29768760
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29768760
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47699066
has answer: http://stackoverflow.com/a/29768663
type: Question
has answer: http://stackoverflow.com/a/29769086
has body: The array of Window windows which is passed to the callback has a number of properties, so how does the compiler know what "var i in windows" is referring to? The code snippet looks like this: chrome.windows.getAll({"populate":true}, function(windows) { for (var i in windows) { var tabs = windows[i].tabs; In the next line windows[i].tabs windows is being passed as an array, so I understand how that works but not var i in windows.
score: 0

http://stackoverflow.com/q/29820214
tagged with: requirejs
has title: How to use RequireJS properly?
score: 1
type: Question
upvote count: 2
tagged with: testing
answer count: 2
has answer: http://stackoverflow.com/a/29820312
tagged with: javascript
has answer: http://stackoverflow.com/a/29820476
downvote count: 1
tagged with: jasmine
favorite count: 0
type: UnansweredQuestion
has body: I need to test a JavaScript project. There are described several modules but when I try to load them something goes wrong. define([ 'core/BaseModel' ], function (BaseModel) { var MessageModel = BaseModel.extend({ defaults: { messageType: "Advertisment", receiver: "me", title: "Title", heading_1: "Heading1", heading_2: "Heading2" }, url: function () { var base = this.apipath + '/companies/'; if (this.isNew()) return base; return base + (base.charAt(base.length - 1) == '/' ? '' : '/') + this.id; } }); return MessageModel; }); To load the module I do this: var message; beforeAll(function(done){ require(['../../../public/js/app/models/Message'], function(Message){ message = Message; done(); }); }); Now message is not undefined but when I test if message.defaults or message.url is defined this fails. what is wrong there?

http://stackoverflow.com/a/29753954
downvote count: 0
has comment: http://stackoverflow.com/comment/47644290
answers question: http://stackoverflow.com/q/29753641
has comment: http://stackoverflow.com/comment/47647087
score: 1
has body: David's solution is great (as always). Just to offer some variety, I'd suggest moving your preferences (or the whole darn profile) to its own collection. Then, use a .publish(null,... to always have access to that collection. Either solution will work great, it is simply my preference to have nothing except login credentials attached to the critical users collection.
upvote count: 1
has comment: http://stackoverflow.com/comment/47640553
has comment: http://stackoverflow.com/comment/47647273
type: Answer

http://stackoverflow.com/q/29719376
type: UnansweredQuestion
has title: Rails assign ids to elements in builder to access using jQuery
tagged with: ruby-on-rails
type: Question
has body: I'm using the Rails builder to build multiple :pay objects <%= f.fields_for :pay do |builder| %> <%= render "non_taxable_pays", :f => builder %> <% end %> This is rendering _taxable_pays multiple times as desired _taxable_pays.html.erb <%= f.hidden_field :employee_id %> <%= f.hidden_field :ee_pay_id %> <%= f.hidden_field :pay_sub_head_id %> <%= f.object.ee_pay.company_pay.description %> € <%= f.text_field :rate, value: number_to_currency(f.object.rate), class: "currency_input" %> <%= f.text_field :amount, value: number_to_currency(f.object.amount, :unit => ""), class: "number_input" %> <%= f.object.ee_pay.company_pay.units %> € <%= number_to_currency(f.object.rate*f.object.amount) %> My issue is in the partial _taxable_pays above. In the last section I have code that displays the value * the rate f.object.rate*f.object.amount. This is great when the page is first displayed as it calculates it based on the values in the database. I'm now looking to dynamically update this field using jQuery if the user changes the values in the text_fields holding the :rate or :amount. But for the life of me I can't figure out how I should assign id's to the different renders or access them using jQuery. Can anyone point me in the right direction? Thanks for looking
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/29758147
linked to: http://stackoverflow.com/q/13189689
has comment: http://stackoverflow.com/comment/47637124

http://stackoverflow.com/q/29751396
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/47635832
score: 1
possible better answer: http://stackoverflow.com/a/29751830
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29751830
tagged with: javascript
has body: So I have a basic form that takes in Name, Email, Date of Arrival, Date of Departure and Comment with a big "Send" button. Here is the code for that: It successfully opens up my mail client with an email. The issue is that this is what is in the body of the email: Name+%250D%250A+=Name+Test&Email+%250D%250A=test%40email.com&Date+Of+Arrival+%250D%250A=09%2F04%2F2015&Date+Of+Departure+%250D%250A=24%2F04%2F2015&Text=This+is+a+test+comment How can I style this? I have looked online and can't figure it out. For this example, this is how I would like the email body to look: Name: Name Test Email: test@email.com Date of Arrival: 09/04/2015 Date of Departure: 24/04/2015 Message Body: This is a test comment. I wouldn't mind having the subject field repopulated too with "booking request" or something. Thanks!
has comment: http://stackoverflow.com/comment/47635392
answer count: 3
has title: How can I style my mailto form results?
has answer: http://stackoverflow.com/a/29751613
accepted answer: http://stackoverflow.com/a/29751613
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/12626940
tagged with: php
tagged with: css
has answer: http://stackoverflow.com/a/29751614

http://stackoverflow.com/comment/47666239
type: Comment
comment on: http://stackoverflow.com/a/29767070
type: AnswerComment
score: 0
has text: Yes it works. But my purpose is to achieve separation of concerns. Include Processor should not know what other processors are used.

http://stackoverflow.com/q/29823916
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/52733769
score: 10
has title: Increase buffer size or time for video-js HTML5 player
has answer: http://stackoverflow.com/a/75628243
tagged with: html5-video
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/93434840
answer count: 3
has answer: http://stackoverflow.com/a/65414794
upvote count: 10
has body: how do I increase buffer on video-js HTML5 player? I have a US server and in the US is all fine but clients in EU have loading issues related to video caching. buffer size in video.js is constant value and I want to change it.
tagged with: video.js

http://stackoverflow.com/comment/47772370
score: 2
has text: Well, if you want to append it - do it. What is the problem?
comment on: http://stackoverflow.com/q/29823088
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29786694
accepted answer: http://stackoverflow.com/a/29786780
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47703146
score: 2
type: AnsweredQuestion
downvote count: 0
has body: Is it possible to run a single line of text wrapped in a single tag, and then output it with a background colour, breaks into multiple lines encased in a box, and these boxes are translucent that overlapped each other? I have a demo in JSFiddle >here<. Live a good life. If there are gods and they are just, then they will not care how devout you have been, but will welcome you based on the virtues you have lived by. ~Marcus Aurelius That up there is what I wanted to accomplish in terms of looks, but it is not what I wanted to accomplish in terms of markup. I needed partcularly this line to break into seperate boxes that overlap: Live a good life. If there are gods and they are just, then they will not care how devout you have been, but will welcome you based on the virtues you have lived by. Now how do I split these into boxed lines? ~Marcus Aurelius Is this still a CSS3 job, or do we need to use JQuery now? (CSS for all of it) .wrap { width:100%; text-align:center; } p { display:block; } b { display:inline-block; background-color: rgba(78, 145, 220, 0.5); color: #55349E; font-weight:100; padding:10px 1% 18px; margin:-10px auto; white-space:pre-wrap; text-align:center; } .blue-tape { text-align: center; font-weight: 100; font-size: 14px; color: #fff; display: block; background-color: rgba(78, 145, 220, 0.5); line-height: 1.6677547em; width:80%; margin: 0 auto; white-space: pre-wrap; }
type: Question
has comment: http://stackoverflow.com/comment/47704929
tagged with: javascript
has title: Making a single line of text into separate boxes using CSS
has comment: http://stackoverflow.com/comment/47703416
upvote count: 2
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29786780

http://stackoverflow.com/q/29700225
possible better answer: http://stackoverflow.com/a/29700249
score: 0
has comment: http://stackoverflow.com/comment/47536237
has comment: http://stackoverflow.com/comment/47536245
has comment: http://stackoverflow.com/comment/47536210
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29700299
has title: Why cant i access variable in jquery function
type: Question
has body: I'm wondering why I can't access the value of variable ("dial") any help would be great.
answer count: 2
has answer: http://stackoverflow.com/a/29700249
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29700299

http://stackoverflow.com/comment/97563617
type: Comment
score: 2
has text: Hello @Mick, excellent sample, but how about client side? I'm struggling with how disconnect when the unsubscribe is called over the fromEvent observable.
type: AnswerComment
comment on: http://stackoverflow.com/a/48351659

http://stackoverflow.com/a/29698639
upvote count: 1
answers question: http://stackoverflow.com/q/29698445
score: 1
has body: Since tagged with jQuery $scope.modifyHtml = function (html) { var $tmp = $('&lt;div /&gt;', { html: html }); //remove span elements $tmp.find('span').contents().unwrap(); return $tmp.html() } Demo: Fiddle Without jQuery $scope.modifyHtml = function (html) { var el = document.createElement('div'), spans, span, len; el.innerHTML = html; spans = el.getElementsByTagName('span'), span; for (var i = 0; i &lt; spans.length; i++) { span = spans[i]; len = span.childNodes.length; for (var j = 0; j &lt; len; j++) { span.parentNode.insertBefore(span.childNodes[0], span) } span.parentNode.removeChild(span); } return el.innerHTML; } Demo: Fiddle, Fiddle2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47537146
accepted answer of: http://stackoverflow.com/q/29698445
type: Answer

http://stackoverflow.com/comment/47818032
has text: what about cube.translateY = (actualHeight-newHeight)/2 ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29844253

http://stackoverflow.com/comment/47590817
type: Comment
has text: Thanks for the help I'm going to have to figure this out later. Got to go to work.
type: QuestionComment
comment on: http://stackoverflow.com/q/29728367
score: 0

http://stackoverflow.com/comment/47733217
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29800333
has text: If I understood your CSS correctly, you only set the .newsArticleContent to be display:none at the lowest screen size you have set (less than 319px). The above code would only run when that CSS was active, meaning the title would only be clickable when the content was hidden, at the lower screen size?
type: AnswerComment

http://stackoverflow.com/q/29796437
has comment: http://stackoverflow.com/comment/47732910
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47725466
score: 0
has comment: http://stackoverflow.com/comment/47726581
has comment: http://stackoverflow.com/comment/47731101
has comment: http://stackoverflow.com/comment/47773834
has comment: http://stackoverflow.com/comment/47999102
has comment: http://stackoverflow.com/comment/47721090
has body: Kendo Ui grid Custom Validation is firing twice My coding schema: { model: { id: "StaffID", fields: { StaffName: { validation: { required: true } }, RoleID: { field: "RoleID", type: "number", defaultValue: 2 }, Username: { validation: { required: true } }, Password: { validation: { required: true } }, Email: { validation: { email: true, required: true,validateOnBlur: false, EmailValidation: function(input) **// This is fired twice** { var valid = CheckEmailValidate(input,dataSource,dataItem); return valid; } } } } } } Reference: please Check http://demos.telerik.com/kendo-ui/grid/editing
answer count: 0
has comment: http://stackoverflow.com/comment/47731306
type: UnansweredQuestion
has title: Kendo Ui grid Custom Validation is firing twice
type: Question
has comment: http://stackoverflow.com/comment/47730842
tagged with: kendo-grid
has comment: http://stackoverflow.com/comment/47739808

http://stackoverflow.com/a/29840080
has comment: http://stackoverflow.com/comment/47821157
has comment: http://stackoverflow.com/comment/47819904
answers question: http://stackoverflow.com/q/29839622
type: Answer
has comment: http://stackoverflow.com/comment/47821361
has comment: http://stackoverflow.com/comment/47820761
has comment: http://stackoverflow.com/comment/47820595
has comment: http://stackoverflow.com/comment/47820527
has body: You need to enable cors by adding cors module in your express app. Download its dependency using npm command. And add following lines in your node.js file. var cors = require('cors'); app.use(cors());
score: 0

http://stackoverflow.com/q/29841107
type: Question
has body: Hi guys i have the following script displaying a chart `$(function () { $('#container').highcharts({ chart: { type: 'line' }, title: { text: 'Monthly Average Temperature' }, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, yAxis: { title: { text: 'Temperature (°C)' } }, plotOptions: { line: { dataLabels: { enabled: true }, enableMouseTracking: false } }, series: [{ { name: 'London', data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8] }] }); });` The chart is displaying well, but i'm not able to select axis labels when passing mouse on it, it displays like an image, i need to know is their a way to make labels selectable.
tagged with: javascript
has title: Selectable axis labels on highcharts
tagged with: dotnethighcharts
score: 0
answer count: 1
tagged with: highcharts
tagged with: jquery
has answer: http://stackoverflow.com/a/29842786
type: UnansweredQuestion

http://stackoverflow.com/q/29821795
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47772340
has comment: http://stackoverflow.com/comment/47773578
has comment: http://stackoverflow.com/comment/47771757
has title: Button Hide & Show only on first row?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29822289
has comment: http://stackoverflow.com/comment/47770193
type: Question
has comment: http://stackoverflow.com/comment/47773129
has comment: http://stackoverflow.com/comment/47770084
has comment: http://stackoverflow.com/comment/47769842
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47772503
score: 0
has comment: http://stackoverflow.com/comment/47769874
has comment: http://stackoverflow.com/comment/47773154
has comment: http://stackoverflow.com/comment/47769703
has answer: http://stackoverflow.com/a/29822289
has body: This is my userlist generated with a for loop with the same ID and function for all the save button. The Button hide &amp; show is only working in the 1st row. @foreach (var usr in (List&lt;RegistrationResponsive.Models.RegistrationModels&gt;)ViewData["UsersList"]) { &lt;td&gt; @{ List&lt;SelectListItem&gt; listItems = new List&lt;SelectListItem&gt;(); listItems.Add(new SelectListItem { Text = "Active", Value = "Active" }); listItems.Add(new SelectListItem { Text = "In Active", Value = "InActive" }); } @Html.DropDownListFor(a =&gt; @usr.Status, listItems, new { @class = "form-control", @autocomplete = "OFF", @id = "drpDwn", onchange = "MyFunction()" }) &lt;td id="btn" style="display:none"&gt; &lt;button type="submit" style="float:right" onclick="Save('@usr.ID')" ng-hide="false" class="btn btn-primary active pull-right"&gt;Save&lt;/button&gt; &lt;td&gt; &lt;/td&gt; &lt;/tr&gt; } And this is the JS function that I use to show/hide the button: function MyFunction() { if ($('#drpDwn').val() == "Active") { $('#btn').hide(); } else { $('#btn').show(); } } The generated code looks like this: &lt;form&gt; &lt;div class="table-responsive container"&gt; &lt;table id="myTable" class="table table-striped webgrid-table"&gt; &lt;thead&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Phone No.&lt;/th&gt; &lt;th&gt;Country&amp;nbsp;Name&lt;/th&gt; &lt;th&gt;Gender&lt;/th&gt; &lt;th&gt;Action&lt;/th&gt; &lt;/thead&gt; &lt;tr&gt; &lt;td&gt; Sanju &lt;/td&gt; &lt;td&gt; +91XXXXXXXXXX &lt;/td&gt; &lt;td&gt; India &lt;/td&gt; &lt;td&gt; Female &lt;/td&gt; &lt;td&gt; &lt;select autocomplete="OFF" class="form-control" id="drpDwn" name="usr.Status" onchange="MyFunction()"&gt;&lt;option value="Active"&gt;Active&lt;/option&gt; &lt;option value="InActive"&gt;In Active&lt;/option&gt; &lt;/select&gt; &lt;td id="btn" style="display:none"&gt; &lt;button type="submit" style="float:right" onclick="Save('5sYRctjnzg')" ng-hide="false" class="btn btn-primary active pull-right"&gt;Save&lt;/button&gt; &lt;td&gt;…

http://stackoverflow.com/a/29725540
has comment: http://stackoverflow.com/comment/47588628
upvote count: 1
has comment: http://stackoverflow.com/comment/47588686
answers question: http://stackoverflow.com/q/29712871
has comment: http://stackoverflow.com/comment/47588898
has body: Plunker You have to inject the result of the resolve using the controller of the state. Then you can use that binding in your view like you normally would. You need this in your state controller: function($scope, customPromise) { $scope.message = customPromise; } Now, in your HTML you can bind {{message}}. Resolve Documentation Study the example there if you are not clear. Note that there is a necessary correlation between what happens in resolve and injecting it into the controller of the state further down.
score: 1
accepted answer of: http://stackoverflow.com/q/29712871
has comment: http://stackoverflow.com/comment/47589049
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/29784468
type: UnansweredQuestion
tagged with: input
tagged with: passwords
has title: Password field cleared when returning to page with Back button
type: Question
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29787290
has body: There is an embedded device with a web interface. Configuration page contains various settings, including SMTP account for e-mail alerts. It's a simple HTML form with input elements, including password. When user opens the page, all fields are filled using JS with previously saved settings. The page contains also a button which causes navigation to another page containing some more settings. The problem is that when a user goes back from that page using Back button in the browser, then the password field is cleared. I suppose it's for security reasons but here it's just an annoyance. If a user goes back to the settings page and wants to change something then he has to re-enter the password each time. How can I prevent the password field from being cleared?
tagged with: field

gruntjs
tags question: http://stackoverflow.com/q/29733432
tags question: http://stackoverflow.com/q/29735873
tags question: http://stackoverflow.com/q/29773091
tags question: http://stackoverflow.com/q/29786105
tags question: http://stackoverflow.com/q/29769481
tags question: http://stackoverflow.com/q/29718639
tags question: http://stackoverflow.com/q/29819698
type: Tag
tags question: http://stackoverflow.com/q/29749111
tags question: http://stackoverflow.com/q/29817511
tags question: http://stackoverflow.com/q/29822353
tags question: http://stackoverflow.com/q/29777929
tag name: gruntjs
tags question: http://stackoverflow.com/q/29780002
tags question: http://stackoverflow.com/q/29745227

http://stackoverflow.com/q/29842657
possible better answer: http://stackoverflow.com/a/31345934
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/31345934
tagged with: css
tagged with: stylus
favorite count: 0
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29843427
upvote count: 7
type: Question
score: 7
has body: I have a Stylus file, looking like @import init @import typography @import colors @import 'components/*' @import '3rdparty-stylesheet.css' The last line is a CSS file I get from a 3rd party plugin which I want not just to stay as it is when compiled into CSS, but all the content of this file to be injected. I use Gulp. How can I achieve it?
answer count: 2
has answer: http://stackoverflow.com/a/29843427
downvote count: 0
tagged with: javascript
tagged with: gulp
has title: Make Stylus merge imported CSS into the stylesheet

http://stackoverflow.com/q/29738461
has body: I have a feeling I'm missing something obvious, could someone please help? I'm unable to reference jquery and mustache using if you notice, I'm able to read in main.js just fine using but not with appreciate any help, thanks.
has title: Unable to reference jquery
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29738473
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29738473

http://stackoverflow.com/a/29815873
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29757619
has body: As stated by the Bookshelf.js developer: basically transactions don't play nicely with promise.all Supposedly, a new version of Bookshelf.js is in development and a better support for transactions is promised: https://github.com/tgriesser/knex/pull/786
type: AcceptedAnswer
score: 4
type: Answer
answers question: http://stackoverflow.com/q/29757619
upvote count: 4

http://stackoverflow.com/comment/47763119
comment on: http://stackoverflow.com/q/29817796
score: 0
type: Comment
type: QuestionComment
has text: @jonamreddy I've updated the OP with the jSon value.

http://stackoverflow.com/q/29725845
has answer: http://stackoverflow.com/a/29726009
tagged with: javascript
has body: Im new to Meteor/iron-router and am following the Microscope project/ file structure. My question is : I dont want the usual drop down login box with {{> loginButtons}}. How do I set up a stand alone authentication page as the primary loaded page if user is not registered or logged in? It will have the usual email/pw and social logins. This is the basic router code for easy reference. Do I just tweak the requireLogin part? I also tried to use accounts-entry package but its fairly tough to figure how to use it.
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/29725985
tagged with: meteor
has comment: http://stackoverflow.com/comment/47596641
favorite count: 0
tagged with: user-accounts
tagged with: iron-router
type: UnansweredQuestion
score: 2
downvote count: 0
type: Question
has title: How do I create a standalone signup/ login page in Meteor?

http://stackoverflow.com/a/29824951
has comment: http://stackoverflow.com/comment/47777693
score: 0
has comment: http://stackoverflow.com/comment/47777942
type: Answer
has comment: http://stackoverflow.com/comment/47776233
answers question: http://stackoverflow.com/q/29824656
has comment: http://stackoverflow.com/comment/47776284
has body: I believe you will need to do this server side by using geolocation data for each zipcode. Then you can do a distance query and set your limits. The data can be obtained from USPS. There are roughly 80,000 zipcodes

currency
tag name: currency
tags question: http://stackoverflow.com/q/29809778
type: Tag

http://stackoverflow.com/q/29724244
tagged with: listjs
accepted answer: http://stackoverflow.com/a/29724621
has body: Anyone in here familiar with LISTJS plugin? If so, I require your assistance. Reffering to: http://codepen.io/javve/pen/zpuKF. What I'm trying to achieve is NOT havin the search-input within the same div as the list. I want the search-input in another div. Is this possible? If so, what do I do, I'm guessing I'm gonna have to edit the source code...? To sum up - I wan't the input field in another div, not the "users" - as described below. Sort by name Jonny Stromberg 1986 Jonas Arnklint 1985 Martina Elm 1986 Gustaf Lindqvist 1983
type: Question
upvote count: 0
has answer: http://stackoverflow.com/a/29724427
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/39848507
tagged with: http://stackoverflow.com/tag/html
tagged with: input
has answer: http://stackoverflow.com/a/29724621
has answer: http://stackoverflow.com/a/39848507
answer count: 4
has answer: http://stackoverflow.com/a/68828634
score: -1
downvote count: 1
has title: Need input in another div! #listjs
type: AnsweredQuestion

http://stackoverflow.com/q/29824412
has comment: http://stackoverflow.com/comment/47775305
type: UnansweredQuestion
tagged with: wordpress
has body: Currently users are allowed to use Javascript in bbPress posts. I would like to disable this for security reasons but cannot find the "off" switch. I have looked for plugins, settings and other questions to no avail. Is there a way to do this? Thanks!
type: Question
has answer: http://stackoverflow.com/a/29836319
has comment: http://stackoverflow.com/comment/47775217
has title: Disable Javascript in fourm posts - bbPress
tagged with: bbpress
answer count: 1
tagged with: javascript
tagged with: security
score: 0

http://stackoverflow.com/q/29749437
has answer: http://stackoverflow.com/a/29749704
has body: I need some help. I need to create a new date object in mm/dd/yyyy format from a string of format 24-Mar-2015.
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29749791
has comment: http://stackoverflow.com/comment/47631115
has comment: http://stackoverflow.com/comment/47633437
linked to: http://stackoverflow.com/q/4772425
answer count: 4
upvote count: 0
type: UnansweredQuestion
tagged with: java
type: Question
has title: How can I generate date object from string in format "23-Jan-2015" in java and javascript
has answer: http://stackoverflow.com/a/29749810
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/29749905

http://stackoverflow.com/a/29706053
type: Answer
has body: To answer your question about arguments, each function in Javasctript can access a list with all its arguments via the arguments pseudo-parameter: success: function(){ return success.apply(callbackObj, arguments) } However, its going to be simpler to use the bind method instead of apply or call. success: success.bind(callbackObj), failure: failure.bind(callbackObj)
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29705669
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29705669

http://stackoverflow.com/q/29843847
has comment: http://stackoverflow.com/comment/47814608
answer count: 1
tagged with: attributes
upvote count: 0
has answer: http://stackoverflow.com/a/29843965
accepted answer: http://stackoverflow.com/a/29843965
downvote count: 1
has comment: http://stackoverflow.com/comment/47814960
type: AnsweredQuestion
score: -1
type: Question
has body: It is my lovely title. So I tried to manipulate with title for Scrollme.js. And here my script code which it got it from here. I have some manipulate with that and: $("[title*='aniscroll']").each(function() { $(this).addClass("scrollme animateme"); var title = this.title, when = this.title.match(/when=(.*?)(\s|$)/), from = this.title.match(/from=(.*?)(\s|$)/), ... crop = this.title.match(/crop=(.*?)(\s|$)/) $(this).attr("data-when", when[1]); $(this).attr("data-from", from[1]); ... $(this).attr("data-crop", crop[1]); }); &lt;div class="test" title="aniscroll when=enter from=0.5 to=0 opacity=0 rotatex=90 translatex=-200"&gt; It doesn't work for me properly, cause after that script I have &lt;div class="test scrollme animateme" data-when="enter" data-from="0.5" data-to="0" data-opacity="0" data-translatex="-200" style="opacity: 0.77; transform: translate3d(-45px, 0px, 0px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale3d(1, 1, 1);"&gt;&lt;!-- simple frame --&gt;&lt;/div&gt; And it animates only opacity and translatex but where my rotatex. And there is an error in console: Uncaught TypeError: Cannot read property '1' of null But if I will swap of $(this).attr("... to: //Манипуляции с data-attr $("[title*='aniscroll']").each(function() { $(this).addClass("scrollme animateme"); var title = this.title, when = this.title.match(/when=(.*?)(\s|$)/), from = this.title.match(/from=(.*?)(\s|$)/), ... crop = this.title.match(/crop=(.*?)(\s|$)/) $(this).attr("data-when", when[1]); $(this).attr("data-from", from[1]); ... $(this).attr("data-crop", crop[1]); }); It will work perfectly for my this specific test title but if I will change title and add "roatatez" to it it doesn't work. So problem is in emplty attribute and I don't know how to fix it. Maybe it will need to add some "if condition" to work properly. Maybe you know solution about this? Thanks for your future answers. I hope you understood my question. So I use your third script and get it $("[title*='aniscroll']").each(f…
has comment: http://stackoverflow.com/comment/47813879
tagged with: javascript
tagged with: jquery
has title: why does empty attribute break script?
tagged with: title
linked to: http://stackoverflow.com/q/29828199
favorite count: 0
tagged with: typeerror
has comment: http://stackoverflow.com/comment/47816998

http://stackoverflow.com/a/29914023
has body: Ok this is what i finally did, if it could help someone: HTML: JS: var realclick = true; // prevent adding history on hashchange $(".tab").on('click', function() { id = $(this).attr('id'); $(".tab").removeClass('selected'); $( '#' + id).addClass('selected'); $(".box").addClass('hidden'); $( '#_' + id ).removeClass('hidden'); if (realclick) { history.pushState(null, null, '#'+id); } }); $(window).on('hashchange', function(e){ // triggered by browser, previous and next button var id =''; realclick = false; if (location.hash!='') { // if has hash id = $(location.hash+".tab").attr('id'); $('#'+id).click(); } else { // no hash = initial page id = $(".first.tab").attr('id'); $('#'+id).click(); } realclick = true; }); If someone has some improvements to share, be welcome! I need to simulate click on my tab because some of them have others events attached to them and i need to keep them.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/52916752
type: Answer
answers question: http://stackoverflow.com/q/29817603
accepted answer of: http://stackoverflow.com/q/29817603
score: 2
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/52874412

http://stackoverflow.com/comment/47556517
comment on: http://stackoverflow.com/q/29710363
score: 0
type: Comment
type: QuestionComment
has text: I would suggest looking into lodash which can help you when dealing with collections, arrays, and objects.

http://stackoverflow.com/comment/47698442
comment on: http://stackoverflow.com/a/29784210
type: AnswerComment
score: 0
type: Comment
has text: Right, but as we've pointed out, he should not use the same ID. If he needs help changing the appended list items from the same ID to the same class I'd be happy to help, but it's pretty straight forward.

http://stackoverflow.com/comment/47763662
comment on: http://stackoverflow.com/q/29818415
score: 0
type: QuestionComment
type: Comment
has text: Isn't this French? :D Anyway, please do only use English language on Stack Overflow.

http://stackoverflow.com/comment/47672113
comment on: http://stackoverflow.com/q/29770368
has text: Will do in future Oka and I didn't have enough rep to post an image moffeltje, thanks though.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47752905
comment on: http://stackoverflow.com/a/29809779
score: 0
type: AnswerComment
type: Comment
has text: Yeah indeed I forgot to add the `:` character into the allowed ones, your correction seems perfect

http://stackoverflow.com/a/29762849
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/29762709
answers question: http://stackoverflow.com/q/29762709
upvote count: 1
has body: The problem is that 'this' in the success handler of the ajax function is the ajax function itself not the element that triggered the event handler. What you need to do is store the value of the element var el = $(this) then reference that whenever you want to access the element taking advantage of closures. $('*[data-pickup]').change(function(){ var value = $(this).val(); var el = $(this); console.log(value); $.ajax({ type : "POST", cache : false, url : "a.php?pickup", data : {'X': value}, success: function(data) { $("*[data-pick='" + el.attr("data-pickup") + "']").html("HELLO"); } }); $("*[data-pick='" + el.attr("data-pickup") + "']").html("HELLO 2"); $("*[data-pick='" + el.attr("data-pickup") + "']").show(); })
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47713272
type: AnswerComment
has text: Ok then Have you gone to W3schools.com that has a lot of helpful stuff
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29790728

http://stackoverflow.com/comment/47592670
score: 0
comment on: http://stackoverflow.com/q/29729067
type: QuestionComment
type: Comment
has text: You are expecting the constructor, but you are logging its instance.

http://stackoverflow.com/a/29783982
answers question: http://stackoverflow.com/q/29783760
has body: I honestly think your current way is the best way, considering you offload everything client side so there are less trips back and forth to the server. If you feel the need to have a view per question, check out the following... You can do a sliding expiration cache to hold your data and do the CRUD operations when the final question is answered. Create a controller action that takes view model with a count of what question they are on and you can just return a view model with question, answer and question number of the next question, after updating the cache object with their recent answer. Something like public ActionResult AnswerQuestion(QAndAViewModel vm) { //update answer cache here //get next question by adding 1 to the question count in the view model return View(new QAndAViewModel { Question = "How are you?", QuestionCount = vm.QuestionCount + 1 }); } Your cache object should be a Dict where int is the question count and string is the answer, this way if they hit the back button and re-submit a previous answer, you can account for that. Anyways, here is the cache singleton that I use. public class CacheSingleton { private static readonly Lazy&lt;CacheSingleton&gt; Lazy = new Lazy&lt;CacheSingleton&gt;(() =&gt; new CacheSingleton()); public static CacheSingleton Instance { get { return Lazy.Value; } } private CacheSingleton() { _cache = MemoryCache.Default; } private readonly ObjectCache _cache; public object Get(string key) { var contents = _cache[key]; return contents; } public void Add(string key, object value, bool useSlidingExpiration = true, int minutesUntilExpiration = 15) { if (value == null || String.IsNullOrWhiteSpace(key)) { return; } var policy = new CacheItemPolicy(); if (useSlidingExpiration) { policy.SlidingExpiration = new TimeSpan(0, minutesUntilExpiration, 0); } else { policy.AbsoluteExpiration = DateTimeOffset.UtcNow.AddMinutes(minutesUntilExpiration); } _cache.Set(key, value, policy); } public void Remove(string key) { if (_cache.Contains(…
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/47534462
type: QuestionComment
has text: @Nadh I don't want to hash all users I want to make an algorithm which generate some hashes through all users and fter executing this function we can check email existence with this hashes generated. consider this algorithm execute once and then just we use it.
comment on: http://stackoverflow.com/q/29698769
score: 0
type: Comment

http://stackoverflow.com/q/29746285
favorite count: 0
tagged with: angularjs
has body: if (DataService.Validation(file)) { //angularjs call to api controller }; //DataService Validation: function (file) { var Url = URL.createObjectURL(file); var img = new Image(); $(img).load(function () { var imgwidth = this.width; var imgheight = this.height; if (imgheight &gt; 400) { viewModel.ErrorMessage = 'The Image height cannot be more then 400 px.'; return false; } }); img.src = Url; if (file == null) { viewModel.ErrorMessage = 'Please select a file to upload.'; return false; } if (viewModel.Name == null) { viewModel.ErrorMessage = 'Name is a required field.'; return false; } return true; } The above validation function is completing the execution and returning true without the code inside img load function is checked..It means tht even if the image is greater then 400px the validation returns true as the code inside load runs after a long time once the whole Jquery ajax call is sent to api controller.. What I am trying to achieve is that the Validation should not return the value until the code inside the image load is executed.
upvote count: 1
has comment: http://stackoverflow.com/comment/47626202
accepted answer: http://stackoverflow.com/a/29746681
type: AnsweredQuestion
score: 1
type: Question
answer count: 2
tagged with: jquery-ui
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47624789
tagged with: jquery-file-upload
has title: Function returns the value before Jquery Image load is executed
possible better answer: http://stackoverflow.com/a/41062902
has answer: http://stackoverflow.com/a/29746681
has answer: http://stackoverflow.com/a/41062902
has comment: http://stackoverflow.com/comment/47624793

http://stackoverflow.com/q/29790965
has title: Increase size of input field as text is entered
has comment: http://stackoverflow.com/comment/47710968
has answer: http://stackoverflow.com/a/29792301
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29791123
tagged with: css
answer count: 4
favorite count: 0
linked to: http://stackoverflow.com/q/931207
has comment: http://stackoverflow.com/comment/47710899
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29791159
has comment: http://stackoverflow.com/comment/47710872
has answer: http://stackoverflow.com/a/29793085
has body: I have a fairly simple CSS question. I have an input text field, and on page load i would like it to be 150px in width. However, as the user enters some text, if the text is greater than 150px in width, then the width should auto adjust. Here's a plunker: http://plnkr.co/edit/ig0BQrJDiEtXKV8zJ2w2?p=preview HTML: &lt;input class="input-class" type="text" placeholder="Placeholder"&gt; CSS: .input-class-2 { -moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; border-color: -moz-use-text-color -moz-use-text-color #ef8e80; border-image: none; border-style: none none dashed; border-width: 0 0 1px; color: #ef8e80; cursor: pointer; font-family: Gotham-Book; font-size: 18px; min-width: 150px; } I assumed min-width would do this.
has comment: http://stackoverflow.com/comment/47710911
upvote count: 5
type: Question
score: 5
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/29832420
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29831935
has body: Simply create a span element containing × char for the x, put some style and bind the click event to the popup close action: HTML &lt;span class="cancel-icon" &gt;×&lt;/span&gt; CSS: .cancel-icon{ float:right; cursor:pointer; } JS $('.cancel-icon').click(function () { //Close the popup }); Using your Fiddle: http://jsfiddle.net/sGeVT/118/

http://stackoverflow.com/a/45664274
has body: this example might be little different from yours. but i can assure you that this is the best solution you can have for this problem. i have searched for days for a solution which has no performance issue. and finally came up with this one. class HtmlComponent extends React.Component { constructor() { super(); this.state={ name:'MrRehman', }; this.handleClick= this.handleClick.bind(this); } handleClick(event) { const { param } = e.target.dataset; console.log(param); //do what you want to do with the parameter } render() { return ( &lt;div&gt; &lt;h3 data-param="value what you wanted to pass" onClick={this.handleClick}&gt; {this.state.name} &lt;/h3&gt; &lt;/div&gt; ); } } UPDATE incase you want to deal with objects that are supposed to be the parameters. you can use JSON.stringify(object) to convert to it to string and add to the data set. return ( &lt;div&gt; &lt;h3 data-param={JSON.stringify({name:'me'})} onClick={this.handleClick}&gt; {this.state.name} &lt;/h3&gt; &lt;/div&gt; );
score: 23
has comment: http://stackoverflow.com/comment/78544546
has comment: http://stackoverflow.com/comment/81144507
answers question: http://stackoverflow.com/q/29810914
type: Answer
has comment: http://stackoverflow.com/comment/81144416
downvote count: 1
upvote count: 24
has comment: http://stackoverflow.com/comment/78507463

http://stackoverflow.com/q/29696044
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47528544
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29702490
accepted answer: http://stackoverflow.com/a/29702317
type: Question
has comment: http://stackoverflow.com/comment/47528341
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47529252
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47528746
favorite count: 0
score: 4
has comment: http://stackoverflow.com/comment/47528197
has comment: http://stackoverflow.com/comment/47528250
has body: I've wrote a script to change a few CSS properties of a div. I've tried 2 methods I found on google but neither of them work. I've thoroughly read the examples and I don't know why this won't work. When there is less content in the #rightsection then there are images in the #leftsection, the #rightsection attaches to the bottom of the #contentpage. But if there is too much content in the #rightsection, the content overflows. So I want to change to position:absolute to position:static when there's a scroll detected upon overflow. I'm not really that good with JQuery so I'm hoping anybody of you would know the answer. If anybody does know, I'd appreciate it. (function($) { $.fn.hasScrollBar = function() { return this.get(0).scrollHeight &gt; this.height(); } //Method 1 if($("#rightsection").hasScrollBar()){ $('.rightsection1').css({ "position":"static", "margin":"-75px 0 0 150px" }); } //Method 2 if($("#rightsection").hasScrollBar()){ $('#rightsection').addClass("rightsection1"); $('#rightsection').removeClass("rightsection2"); } })(jQuery); JSFiddle Solution I changed (function($) by $(document).ready(function() and now it works flawlessly.
answer count: 2
has comment: http://stackoverflow.com/comment/47528575
has title: Changing CSS with JQuery not working
has comment: http://stackoverflow.com/comment/47529672
has comment: http://stackoverflow.com/comment/47528311
has comment: http://stackoverflow.com/comment/47532054
has answer: http://stackoverflow.com/a/29702317
has comment: http://stackoverflow.com/comment/47528976
has comment: http://stackoverflow.com/comment/47528453
has comment: http://stackoverflow.com/comment/47528251
has comment: http://stackoverflow.com/comment/47530128
upvote count: 4
has answer: http://stackoverflow.com/a/29702490
has comment: http://stackoverflow.com/comment/47532591

http://stackoverflow.com/comment/47597456
comment on: http://stackoverflow.com/q/29729197
score: 1
has text: I believe the OP needs to display part of another website he doesn't control in his page, needs to prevent a scroll bar in the iframe, and doesn't want to muck about with processing the DOM to fit his site. Due to CORS, his options are limited.
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29721430
type: Question
has comment: http://stackoverflow.com/comment/47906285
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/47703573
has body: I have developed some HTML pages which contain a table with several columns, but I am facing a problem: the columns cannot be resized untill the page is refreshed. Can anyone please help me in resolving this issue and helping me understand the reason why is this happening?
tagged with: javascript
score: -4
has answer: http://stackoverflow.com/a/30159953
has comment: http://stackoverflow.com/comment/47577529
downvote count: 4
type: AnsweredQuestion
upvote count: 0
has title: Resize columns of HTML table working after page refreshed
tagged with: jquery
accepted answer: http://stackoverflow.com/a/30159953
favorite count: 0

http://stackoverflow.com/q/29793245
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29793497
accepted answer: http://stackoverflow.com/a/29793497
possible better answer: http://stackoverflow.com/a/29793827
favorite count: 0
has answer: http://stackoverflow.com/a/29793827
has comment: http://stackoverflow.com/comment/47715059
has comment: http://stackoverflow.com/comment/47715098
has body: I'm working on a system to do with images, and if some parameters are invalid, rather than returning an image the script just has to die with some text. This all works fine in a browser, the user can tell what's going on, but now I'm creating a form to set the params, iv'e come across an issue. I'm using $('#img').attr('src', theUrl) to load a preview, but if the parameters are invalid, I get the broken image icon, as it returns just text, not an image. Is there anyway I can capture the text, so I can display to the user exactly what went wrong? I tried looking in the event from an .error(function(event){ handler, but I couldn't see anything useful there.
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47715194
score: 1
type: Question
answer count: 2
has title: Can I capture this text in a variable?

http://stackoverflow.com/comment/47744994
comment on: http://stackoverflow.com/a/29808259
has text: Thanks for your help but i need the selected checkbox appear in place of select of button and post values of selected product and user name to database
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/64264859
answers question: http://stackoverflow.com/q/29785294
upvote count: 3
type: Answer
has body: I wanted to compare a time range in the day ... so I wrote this simple logic where the time is converted into minutes and then compared. const marketOpen = 9 * 60 + 15 // minutes const marketClosed = 15 * 60 + 30 // minutes var now = new Date(); var currentTime = now.getHours() * 60 + now.getMinutes(); // Minutes since Midnight if(currentTime &gt; marketOpen &amp;&amp; currentTime &lt; marketClosed){ } Note that I have not taken UTC minutes and hours since I want to use the local time, In my case it was IST time.
score: 3
downvote count: 0

http://stackoverflow.com/comment/47722861
has text: I give answer for this in up, but once more: `$jatek` is a class that instantiates with the session id . A function of `epuletkesz()` and `$jatek`. The main things: There are buildings ( Web game will be ) and if the player wants to develop the building will develop the tar button. Each building is added separately to the amount of time built up . (For example : 0:00:15 ) . The `$szamol` give the time in seconds , the current time I start the counter and when the time expires, the `$jatek- > epuletkesz ()` when times run out)
type: Comment
comment on: http://stackoverflow.com/a/29796832
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47772981
comment on: http://stackoverflow.com/a/29823341
has text: Brilliant answer! but is there any way we can eliminate the use of controllers? this is because i will have a few modals common in the layout. So if we use the controller, we will have to initialise that in the layout itself. also, another purpose was that just editing the view would give a new modal, without touching the controller!
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47788176
type: Comment
comment on: http://stackoverflow.com/a/29817574
score: 0
type: AnswerComment
has text: This was exactly what I was asking for, it should work thanks.

http://stackoverflow.com/q/29835007
upvote count: 1
has title: make protractor wait for the select element to get populated with options on selecting a option in another Select element
favorite count: 0
accepted answer: http://stackoverflow.com/a/29854702
downvote count: 0
has answer: http://stackoverflow.com/a/29854702
type: AnsweredQuestion
score: 1
type: Question
tagged with: protractor
answer count: 1
tagged with: javascript
has body: I got two Select elements, select1 and select2. Selecting a option in select1 will populate with options in select2. I'm able to select the option in select1, but want to make protractor wait for the options to get populates in select2 and then select a option in select2 element. i tried to use selectOrganizationElement.all(by.tagName('option')).filter(function(element){ return element.getText().then(function(text){ return text === value1; }); }).click().then(function(){ selectSchoolElement.all(by.tagName('option')).filter(function(element){ return element.getText().then(function(text){ return text === value2; }); }).click(); }); but its not able to select. any Suggestions?

http://stackoverflow.com/q/29694594
has body: I am having problem in updating the infowindow content everytime my loop runs with the specified setInterval.Every 1 second the content of the infowindow will change each marker array...but I am having problem If I put the closure in the if statement. after 5 minuets the browser will crash because of adding the listener in every 1 second.what I want is to update only the content of each marker.how would I do that.? Thank you in advance. var map; var marker; var markerarray =[]; setInterval(function(){ $.ajax({ type: "post", url: "vehiclecordinates.php", success: function(data){ coordinates = data.latlng; vehiclename = data.vehiclename; heading = data.heading; devname = data.vehiclename; thedate = data.trackdate; for (var i = 0; i < coordinates.length; i++) { newcoordinate = new google.maps.LatLng(coordinates[i].split(",")[0],coordinates[i].split(",")[1]); if (markerarray[vehiclename[i]] && markerarray[vehiclename[i]].setPosition){ markerarray[vehiclename[i]].icon.rotation = parseInt(heading[i]); markerarray[vehiclename[i]].setPosition(newcoordinate); var con = ' Vehicle Name:' + devname + ' ' +'Date='+thedate+' '; }else { marker = new MarkerWithLabel({ map:map, labelClass: "mylabels", labelStyle: {opacity: 1.0}, labelContent: ' '+ vehiclename[i]+' ', icon:{ path: google.maps.SymbolPath.CIRCLE, scale:.7, strokeColor: 'white', strokeWeight: .10, fillOpacity: 1, fillColor: '#404040', offset: '5%', rotation: parseInt(heading[i]), anchor: new google.maps.Point(10, 50) } }); marker.setPosition(newcoordinate); markerarray[vehiclename[i]] = marker; var con = ' Vehicle Name:' + devname + ' ' +'Date='+thedate+' '; google.maps.event.addListener( marker, 'click', (function (marker, con, infowindow) { return function () { infowindow.setContent(con); infowindow.open(map, marker); }; })( marker, con, infowindow)); } } } }); },1000);
has answer: http://stackoverflow.com/a/29695012
has title: How do i update content of infowindow in loop with setInterval
score: 0
type: UnansweredQuestion
tagged with: google-maps
answer count: 1
tagged with: javascript
tagged with: google-maps-api-3
type: Question

http://stackoverflow.com/a/29723737
accepted answer of: http://stackoverflow.com/q/29723696
answers question: http://stackoverflow.com/q/29723696
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47581674
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47581960
has comment: http://stackoverflow.com/comment/47581771
downvote count: 0
has body: You can simply remove the digits: var x = "123442234535asd"; x = x.replace(/\d+/, ""); console.log(x); output: asd CODEPEN DEMO If you really need to split the string you can use: var x = "123442234535asd"; x= x.split(/\d+/);

http://stackoverflow.com/q/29721176
has comment: http://stackoverflow.com/comment/47576913
score: 0
has title: querySelectorAll not recognizing var
has comment: http://stackoverflow.com/comment/47577354
has body: I am using casperjs for some webscraping and am having a strange problem. I want to be able to construct a CSS path from strings and get an array using 'querySelectorAll' like below: var tier = '-ou-'; var index = 'div.list &gt; div &gt; a[href*="' + tier + '"]'; var battles = document.querySelectorAll(index); However, this does not work, and battles returns null. This version works: var links = document.querySelectorAll('div.list &gt; div &gt; a[href*="-ou-"]'); But none other does. I also tried: var index = 'div.list &gt; div &gt; a[href*="-ou-"]'; var battles = document.querySelectorAll(String(index)); and var index = 'div.list &gt; div &gt; a[href*="-ou-"]'; var battles = document.querySelector(index); and all combinations of the above, just as a sanity check, and none worked. I am relatively new to javascript so I feel I may be missing something obvious, but I have no idea what. EDIT: My entire program is below. As is, it works fine. If the commented line in getBattles is used instead of the one below it, it no longer works (var 'battles' becomes null) var casper = require('casper').create(); var url = 'http://play.pokemonshowdown.com/'; var battles = []; var tier = '-ou-'; var index = "div.list &gt; div &gt; a[href*=\"" + tier + "\"]"; function getBattles() { //var battles = document.querySelectorAll(index); var battles = document.querySelectorAll('div.list &gt; div &gt; a[href*="-ou-"]'); return Array.prototype.map.call(battles, function(e) { return e.getAttribute('href'); }); } casper .start(url) .then(function() { if(this.exists('div.leftmenu')) { this.echo('something works'); } else { this.echo('nothing works'); } }) .thenClick('button[name="roomlist"]') .then(function(){ this.echo("This one is done."); }) .waitForSelector('div.list &gt; div &gt; a', function(){ battles = this.evaluate(getBattles); this.echo(this.getHTML('div.list &gt; div:nth-child(2) &gt; a')); }) .then(function(){ this.echo("This two is done."); }); casper.run(function() { this.echo(bat…
accepted answer: http://stackoverflow.com/a/29721531
has comment: http://stackoverflow.com/comment/47577284
tagged with: casperjs
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47577131
has comment: http://stackoverflow.com/comment/47577300
has answer: http://stackoverflow.com/a/29721531
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/29815879
tagged with: google-tag-manager
tagged with: javascript
has comment: http://stackoverflow.com/comment/47804962
score: 0
has body: Regarding universal analytics in google tag manager. I have setup the same configurations for dev and prod environments but the prod doesn't seems to send data. When in debug mode, it shows that the tags are being fired but looking at the console (chrome), under the network tab, it should show requests to www.google-analytics.com/collect? but this is not showing on the prod application. Anyone know what's happening?
type: UnansweredQuestion
has title: GA GTM Tags fired on debug mode but doesn't send data
answer count: 0
has comment: http://stackoverflow.com/comment/47766657
type: Question
tagged with: google-analytics

http://stackoverflow.com/q/29842206
tagged with: javascript
tagged with: rest
upvote count: 1
favorite count: 0
downvote count: 0
has title: Javascript / REST / Activiti - What am I doing wrong in my XMLHttpRequest?
tagged with: activiti
accepted answer: http://stackoverflow.com/a/29842332
type: AnsweredQuestion
score: 1
has body: I'm trying to learn how to use the Activiti REST api and I'm have trouble getting back data. I'm not very familiar with using rest apis so I may be making a stupid mistake, but as it stands I can't figure it out. I've had success getting back JSON using the Advanced REST Client for Chrome but I can't seem to implement it with Javascript. I'd really appreciate it if someone could point me in the right direction. Links to relevant tutorials and videos would also be much appreciated. window.onload = function get_json() { var hr = new XMLHttpRequest(); var url = "http://kermit:kermit@localhost:8080/activiti-rest/service/repository/process-definitions"; var result = document.getElementById("result"); hr.open("GET", url, true); hr.setRequestHeader("Content-type", "application/json", true); hr.onreadystatechange = function() { if(hr.readystate == 4 &amp;&amp; hr.status == 200) { var data = JSON.parse(hr.responseText); result.innerHTML = data; } } hr.send(); }
has answer: http://stackoverflow.com/a/29842332
type: Question
answer count: 1

http://stackoverflow.com/comment/47768431
type: QuestionComment
has text: you can use escape sequence "\". Please check this onclick="window.location.href=\".../home.do?tbNam=all&userType=${USER.type}&editPermission=${USER.hasPermission['editPermission']}\";"
comment on: http://stackoverflow.com/q/29820756
type: Comment
score: 0

http://stackoverflow.com/comment/47773899
has text: Thnaks for proving a fiddle: I extended your fiddle by using an alternate solution, ie, overriding the function in a class derived from proxy,Ajax: https://fiddle.sencha.com/#fiddle/lpe
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29801883

http://stackoverflow.com/comment/47720716
type: AnswerComment
comment on: http://stackoverflow.com/a/29787627
type: Comment
score: 0
has text: Thank you for your answer. I really wish I could use the getter syntax but I need to support IE8.

http://stackoverflow.com/q/29765152
has body: i'm trying to extend basketjs functionality. i want to load the script dynamically via basketjs. But i have a problem with that. first, i scan all the DOM to get my own data-attribute. then convert the array into object and pass them to basketjs. well, it works without their promise function. My plan is i loop them all, the 1st script is passed without promise, the rest are using promise. objects : var obj: [ { url: 'first_script.js', skipCache: true }, { url: 'second_script.js', skipCache: true }, { ... } ]; function : var forEach = function (array, callback, scope) { for (var i = 0; i &lt; array.length; i++) { callback.call(scope, i, array[i]); } }; var i = 0; forEach(obj, function (i) { if (i === 0) { console.log('load first_script'); basket.require(obj[0]); } else { console.log('load the second_script and others'); basket.require( obj[i] ); } }); Goal : I want to load the second_script and others using .then(function({ basket.require( ... ) so i can ordering the scripts. Anybody can help me? any help will be greatly appreciated. :)
score: 0
has comment: http://stackoverflow.com/comment/47667300
answer count: 1
accepted answer: http://stackoverflow.com/a/29768305
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47661705
has comment: http://stackoverflow.com/comment/47666759
has comment: http://stackoverflow.com/comment/47665143
type: Question
has title: extending basket js functionality to load a script dynamically
has answer: http://stackoverflow.com/a/29768305
tagged with: javascript

http://stackoverflow.com/comment/47628430
has text: hmm, I can find the difference between your codes and mine! :( Except that I put the module, controller and factory in different files
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29733016
score: 0

http://stackoverflow.com/a/29779575
has comment: http://stackoverflow.com/comment/47689187
has comment: http://stackoverflow.com/comment/47690686
has comment: http://stackoverflow.com/comment/47689221
type: Answer
has comment: http://stackoverflow.com/comment/47689509
has comment: http://stackoverflow.com/comment/47689223
answers question: http://stackoverflow.com/q/29779445
has comment: http://stackoverflow.com/comment/47689386
upvote count: 5
has comment: http://stackoverflow.com/comment/47691183
has body: Sort the array first so the negative numbers are at the end. We can sort with a callback that moves the negative numbers to the end. Then iterate backwards and remove the last indices with pop as long as they are negative. What we're left with is the positive values. var X = [-3, 5, 3, 8, 1,-6,-7,8,9]; X.sort(function(a,b) { return b - a; }); for (var i=X.length; i--;) { if ( X[i] &lt; 0 ) X.pop(); } document.body.innerHTML = '&lt;pre&gt;' + JSON.stringify(X, null, 4) + '&lt;/pre&gt;';
has comment: http://stackoverflow.com/comment/47689564
downvote count: 0
has comment: http://stackoverflow.com/comment/47689260
score: 5
has comment: http://stackoverflow.com/comment/47689334
has comment: http://stackoverflow.com/comment/47689291

http://stackoverflow.com/q/29785990
has comment: http://stackoverflow.com/comment/47701762
tagged with: javascript
has comment: http://stackoverflow.com/comment/47701743
score: 0
has title: Is there a good cross-browser way to export tables as CSVs with JavaScript?
tagged with: http://stackoverflow.com/tag/csv
linked to: http://stackoverflow.com/q/17836273
has body: I implemented a table-to-CSV download by changing an a link's href="download.csv" and download="data:application/csv;charset=utf-8,......" It works in Firefox and Chrome, but not in Safari, for some reason. I've not checked IE yet. Any idea what I should do to make it work cross browser?
linked to: http://stackoverflow.com/q/14964035
tagged with: download
type: UnansweredQuestion
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/47703085
has comment: http://stackoverflow.com/comment/47701737

http://stackoverflow.com/a/29759138
answers question: http://stackoverflow.com/q/29758990
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47651064
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/47650755
has comment: http://stackoverflow.com/comment/47651057
has body: One minimal change solution is to track the active button using a global variable, like this (the global is activeButton, code changes are in the onclick attributes for the a tags and the #fade tag, and there's a bit of JavaScript declaring the variable): var activeButton; .black_overlay{ display: none; position: fixed; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; z-index:1001; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80); } .black_overlay a { display:block; width:100%; height:100%; cursor:unset; } .white_content { display: none; position: fixed; top: 12%; left: 12%; width: 75%; height: 75%; padding: 16px; background-color: white; z-index:1002; overflow: auto; } Button One Button Two CLOSE BUTTON ONE CONTENT CLOSE BUTTON TWO CONTENT I would strongly suggest moving all of that JavaScript out of onclick=... attributes and into functions, though, not least because it would allow a lot less code duplication.
score: 2
accepted answer of: http://stackoverflow.com/q/29758990
upvote count: 2

http://stackoverflow.com/a/29736741
has body: The problem is that upon doing a "normal-reload" on the chrome browser, it's > still showing "from cache". Which is not grabbing the static images from the > server. Less compiles into static CSS, so you will need to recompile your CSS (changing the cache time) before reloading your browser. Also when you are using Less in browser does Less cache your Less files (and so uses possible the old cache time). For Less in browser set the environment option to debug to prevent caching.
upvote count: 1
score: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29736584

http://stackoverflow.com/q/29789609
has comment: http://stackoverflow.com/comment/47708938
has comment: http://stackoverflow.com/comment/47708342
has comment: http://stackoverflow.com/comment/47709029
type: UnansweredQuestion
score: -3
tagged with: css
has title: Best way for images css
has comment: http://stackoverflow.com/comment/47708617
downvote count: 3
has comment: http://stackoverflow.com/comment/47708387
has answer: http://stackoverflow.com/a/29789682
has comment: http://stackoverflow.com/comment/47708227
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47708235
has body: Oops, wrong snippet– had to change it back. Creating new question now
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/29790065
favorite count: 0

http://stackoverflow.com/comment/47733272
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29800837
type: Comment
has text: You choose the variation only after the DOM is complete. If installed as per documentation GA will track on page load. I guess if you put your code before the ga tag (without document.ready) the error will disappear.

http://stackoverflow.com/q/29706596
answer count: 1
tagged with: parallax
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47568106
has comment: http://stackoverflow.com/comment/47549340
tagged with: css
has title: Parallax image flies to the left
has answer: http://stackoverflow.com/a/29717411
has comment: http://stackoverflow.com/comment/47549767
has body: I found some problems with parallax, while resizing browser my parallax image flies to the left. I need to have it 50% width with pinned to the right side. http://jsbin.com/hukafomepi/1/edit?output Could You help me with this? Thanks in advance.
type: Question
tagged with: transform
has comment: http://stackoverflow.com/comment/47549383
has comment: http://stackoverflow.com/comment/47549872
tagged with: javascript
score: 0

http://stackoverflow.com/comment/47779597
comment on: http://stackoverflow.com/a/29825712
type: Comment
has text: It can be added any where but should be at top of the script
score: 0
type: AnswerComment

http://stackoverflow.com/a/29699631
has body: Try using this $(document).ready(function(){ $('.parent div').hide(); // hide div's on load using parent class as a starting point $('#nav a').click(function() { // on the anchor clicks that are inside div with id=nav var $div = $('.parent div').eq($(this).index('#nav a')); // get the relevant div $div.show(); // show the relevant div $('.parent div').not($div).hide(); // hide all but the relevant div });​ }):
has comment: http://stackoverflow.com/comment/47546583
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29699471
downvote count: 0

http://stackoverflow.com/a/29884250
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29836259
downvote count: 0
score: 1
has body: The best solution is always to replace jQuery with pure JavaScript (which executes faster too), here is how you can rewrite myScript.js to do so: document.getElementById("target").addEventListener('click', function() { var buttons = document.getElementsByTagName("button"); // get all buttons on the page if(buttons.length) { for (var i = buttons.length - 1; i &gt;= 0; i--) { buttons[i].click(); } } });

http://stackoverflow.com/comment/47606881
type: Comment
comment on: http://stackoverflow.com/a/29736754
has text: This is great! Thanks for the help. What aspect of it stops XSS or other potential hacks?
score: 0
type: AnswerComment

http://stackoverflow.com/q/29738673
possible better answer: http://stackoverflow.com/a/29738743
has comment: http://stackoverflow.com/comment/47610550
answer count: 3
has answer: http://stackoverflow.com/a/29738743
upvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29739198
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47610546
has body: I want the html button to look like the image below. Is there way to change its layout without using any html element? UPDATED: In the normal button, there is only one text node, but in this case there are two text nodes.
has comment: http://stackoverflow.com/comment/47610532
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29738740
downvote count: 1
type: Question
has title: Overriding the layout for HTML Buttons
has comment: http://stackoverflow.com/comment/47610511
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47610671
accepted answer: http://stackoverflow.com/a/29738740

http://stackoverflow.com/q/29754736
has comment: http://stackoverflow.com/comment/47642385
score: 0
tagged with: jquery
tagged with: meteor
has body: I am building an application using Meteor. I am using the jquery datatables plugin to render a table of data. https://www.datatables.net/ When my table loads, ALL of the data is loaded, instead of the default 'show 10 entries'. Furthermore, when I click on a column to sort, all of the data disappears and becomes "No data available in table". Here is my html: tires Brand {{#each products}} {{brand}} {{/each}} Here is my template helpers page: Template.Tires.onRendered(function() { $('#tires').DataTable(); alert('rendred!'); }); Note - for development purposes, I am only showing the "Brand" column for now... Does anyone have any idea what might be going on?
has comment: http://stackoverflow.com/comment/47641785
has comment: http://stackoverflow.com/comment/47642402
has title: jQuery datatable not showing data correctly
has comment: http://stackoverflow.com/comment/47641846
has comment: http://stackoverflow.com/comment/47642248
has comment: http://stackoverflow.com/comment/47641623
has comment: http://stackoverflow.com/comment/47683927
has comment: http://stackoverflow.com/comment/47641909
tagged with: datatable
has comment: http://stackoverflow.com/comment/47687207
has comment: http://stackoverflow.com/comment/47642363
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47641802
has comment: http://stackoverflow.com/comment/47655638
tagged with: spacebars
has comment: http://stackoverflow.com/comment/47641687
linked to: http://stackoverflow.com/q/14925420
tagged with: javascript
has comment: http://stackoverflow.com/comment/47643959
linked to: http://stackoverflow.com/q/29761749
type: Question

http://stackoverflow.com/q/29707434
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47565019
type: Question
has comment: http://stackoverflow.com/comment/47557873
tagged with: javascript
has comment: http://stackoverflow.com/comment/47553189
downvote count: 0
has comment: http://stackoverflow.com/comment/47557614
favorite count: 0
has body: I have a table in my popup and I save the values entered by a user to localStorage. Here are the snippets. popup.html &lt;table id="main_table"&gt; &lt;/table&gt; &lt;script src="popup.js"&gt;&lt;/script&gt; popup.js function create_row() { localStorage["last_session"] = true; var table = document.getElementById("main_table"); var n = table.rows.length; var m = table.rows[0].cells.length; var row = table.insertRow(n); if (!localStorage['use_storage']) { if (n === 1) { localStorage["cells"] = JSON.stringify([{}]); } else if (n &gt; 1) { var cells = JSON.parse(localStorage["cells"]); cells.push({}); localStorage["cells"] = JSON.stringify(cells); } } var cell = row.insertCell(0); cell.innerHTML = n; for (j=1; j&lt;m; j++) { create_cell(n-1, j, row); } return row } function create_cell(i, j, row){ var cell = row.insertCell(j); if (j == 1) { cell.innerHTML = "&lt;input size=10&gt;"; } else { cell.innerHTML = "&lt;input size=4&gt;"; } cell.addEventListener("change", function () { var cells = JSON.parse(localStorage["cells"]); cells[i.toString()][j.toString()] = cell.childNodes[0].value; localStorage["cells"] = JSON.stringify(cells); }) } document.getElementById('create_row').onclick = create_row; // restore a table if (localStorage["last_session"]) { localStorage["use_storage"] = true; try { var cells = JSON.parse(localStorage["cells"]); var n = cells.length; var table = document.getElementById("main_table") for (i=0; i&lt;n; i++) { var row = create_row(true); var cell = cells[i] for (var key in cell) { if (cell.hasOwnProperty(key)) { var col = parseInt(key); var val = cell[key]; row.cells[col].childNodes[0].value = val; } } } } catch (e) { console.log("Catched error"); console.log(e); } if (localStorage["results"]) { show_results(); } localStorage['use_storage'] = false; } In my browser it works as it is supposed, that is after refreshing a page popup.html I have the state where I left (number of rows and values are preserved). However, in my chrome extension, after clic…
has title: Reload popup with information
type: UnansweredQuestion
tagged with: google-chrome-extension
tagged with: http://stackoverflow.com/tag/html
tagged with: popup
answer count: 0

http://stackoverflow.com/a/29779230
has comment: http://stackoverflow.com/comment/47689609
answers question: http://stackoverflow.com/q/29779117
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47692356
type: AcceptedAnswer
downvote count: 0
has body: You can do something like this to achieve what you are asking: Note the anonymous function wrapping around the people assignment. APP.open = (function ($) { return { people: (function() { return { gender: function() {}, age: function() {} } })() }; }(jQuery));
has comment: http://stackoverflow.com/comment/47692238
type: Answer
accepted answer of: http://stackoverflow.com/q/29779117
has comment: http://stackoverflow.com/comment/47689740

http://stackoverflow.com/q/29784576
tagged with: responsive-design
linked to: http://stackoverflow.com/q/12158540
downvote count: 2
possible better answer: http://stackoverflow.com/a/29850803
has comment: http://stackoverflow.com/comment/47699249
has answer: http://stackoverflow.com/a/29850803
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47699305
has comment: http://stackoverflow.com/comment/47699373
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29784819
tagged with: image
has comment: http://stackoverflow.com/comment/47699414
score: 0
has title: Load images only in certains resolutions
has body: I have a header at the top of my page which have two images, one of them is only visible when the viewport is large ( > 940) and the other only showed on mobile. To achieve this behavior, I'm using Bootstrap 3 and their defined sets of media queries: So far, no big deal, the previous code does the job well, but what I want is prevent the load of the large image file itself on mobile to avoid unnecessary data consumption... so how to achieve that?
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 2
tagged with: css
has comment: http://stackoverflow.com/comment/47699241
has answer: http://stackoverflow.com/a/29784819
type: AnsweredQuestion

http://stackoverflow.com/comment/47790376
score: 0
has text: What browser are you using? If $val is truly '1234' then String.charAt(index) should for sure work.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29831861

http://stackoverflow.com/a/77802116
answers question: http://stackoverflow.com/q/29716543
score: 0
has body: Register Register Username Email Password Confirm Password mobileno date of birth Register
type: Answer
has comment: http://stackoverflow.com/comment/137185805

http://stackoverflow.com/comment/47660179
comment on: http://stackoverflow.com/a/29744960
score: 0
type: AnswerComment
type: Comment
has text: It works for above keys. However when I do `search(data, { "id":"6p263uh38xvnchmsrw2jn48ut"})` it returns no nodes, searching for `search(data, { "id": "2fywxwi93lg7fqggdqqpqxvpg"})` returns correctly though.

http://stackoverflow.com/q/29752824
tagged with: javascript
has comment: http://stackoverflow.com/comment/47642046
score: 0
has comment: http://stackoverflow.com/comment/47638653
tagged with: meteor
has comment: http://stackoverflow.com/comment/47638959
tagged with: iron-router
has body: I couldn't find anything regarding this topic. What I am trying to do is when the user refreshes the page, iron router reroutes the user to a different template. Something along the lines of Router.onBeforeAction(function(){ //If(refresh) reroute to home template //Else this.next() }); Does iron router have anything that does the functionality? Thank you for your time, LL
type: AnsweredQuestion
has title: Meteor JS: Iron Router Refresh Function
type: Question
has answer: http://stackoverflow.com/a/29756327
accepted answer: http://stackoverflow.com/a/29756327
answer count: 1

http://stackoverflow.com/q/29827361
has answer: http://stackoverflow.com/a/29827480
accepted answer: http://stackoverflow.com/a/29827400
tagged with: object
score: 2
type: AnsweredQuestion
has body: I have a javascript object and an html table. var myObj = [ { price: 1, label: "One" } ]; 100 product Is it possible to insert the table values in the object? In order to have updated properties { price: 100, label: "product" }
downvote count: 0
has comment: http://stackoverflow.com/comment/47782261
has answer: http://stackoverflow.com/a/29827400
type: Question
upvote count: 2
answer count: 2
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/12286975
tagged with: http://stackoverflow.com/tag/html
has title: Add html element values to javascript object properties
possible better answer: http://stackoverflow.com/a/29827480

http://stackoverflow.com/q/29802650
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29859879
tagged with: blackberry-10
tagged with: intervals
favorite count: 0
tagged with: cordova
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47827103
has answer: http://stackoverflow.com/a/30033219
has body: I'm experiencing rather weird behavior when trying to log a window object defined by $window.open() in AngularJS within an $interval self = this $scope.childWindow = $window.open(authService.buildAuthorizeUrl(), '_blank') console.log $scope.childWindow var1 = "I may not work" self.var2 = 'I should work' privateData.authInterval = $interval -&gt; console.log $scope.childWindow console.log var1 console.log self.var2 , 1000 Output Window {document: document, window: Window, frameElement: null, clientInformation: Navigator, onhashchange: null…} Window {} I may not work I should work Window {} I may not work I should work As you can see, the first console.log $scope.childWindow is outputting a fully defined window object. All others, inside the $interval, are outputting only {}. I've tried not attaching childWindow to the $scope object, and I've tried attaching it to self. I've also tried following this example too and experienced the same behavior. Anyone have any idea why this is happening? Thanks much. JSFiddle demo: http://jsfiddle.net/U3pVM/15124/
type: AnsweredQuestion
has title: Window object cleared on $Interval
has comment: http://stackoverflow.com/comment/47739872
type: Question
answer count: 2
score: 5
accepted answer: http://stackoverflow.com/a/30033219
upvote count: 5
has answer: http://stackoverflow.com/a/29859879
downvote count: 0

angularjs-service
tags question: http://stackoverflow.com/q/29779962
tag name: angularjs-service
tags question: http://stackoverflow.com/q/29819690
tags question: http://stackoverflow.com/q/29700783
type: Tag
tags question: http://stackoverflow.com/q/29761555
tags question: http://stackoverflow.com/q/29785070

http://stackoverflow.com/a/29781140
has body: There are a lot of mistakes in your code. First : you didn't include "app.js" file into index.html Second : $http.get('http://localhost:8983/solr/gettingstarted/select?q=:&amp;wt=json') should be $http.get('http://localhost:8983/solr/gettingstarted/select?q='+ $scope.searchString +'&amp;wt=json')
answers question: http://stackoverflow.com/q/29780563
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47757112

http://stackoverflow.com/comment/47598565
comment on: http://stackoverflow.com/q/29732640
has text: i'm a beginner : how do you remove the overlay ? i thought I was doing it by already putting data-backdrop="false" in my code ; and which class/div should I put on z property=-1 ?
type: Comment
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47617744
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/29742345
has text: `var charCode = (typeof e.which == "undefined") ? e.keyCode : e.which;` can be reduced further down to `var charCode = e.which || e.keyCode;`
type: Comment

http://stackoverflow.com/a/29785701
has comment: http://stackoverflow.com/comment/47701198
answers question: http://stackoverflow.com/q/29785639
has body: One other option is to store user A's data in localStorage, then regularly check if there is an internet connection. If a connection to your server can be made, sync all the data in user A's localStorage with your server, and then give user B access to it. Edit If browser compatibility is not very important, here is a "save as/open" solution that would work completely offline. Only tested in Chrome, based on this post window.upload = function(files) { var f = files[0]; if (f) { var r = new FileReader(); r.onload = function(e) { var contents = e.target.result; document.getElementById("result").innerHTML = contents; } r.readAsText(f); } else { alert("Failed to load file"); } } window.download = function(filename) { var data = { foo: 1, bar: 2 } var pom = document.createElement('a'); pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(JSON.stringify(data))); pom.setAttribute('download', filename); pom.style.display = 'none'; document.body.appendChild(pom); pom.click(); document.body.removeChild(pom); return false; } Save data Download data Read from file Result:
score: 0
type: Answer

http://stackoverflow.com/a/29794710
type: Answer
score: 1
has body: Have you tried this solution from this answer? : function delete_cookie( name, path, domain ) { if( get_cookie( name ) ) { document.cookie = name + "=" + ((path) ? ";path="+path:"")+ ((domain)?";domain="+domain:"") + ";expires=Thu, 01 Jan 1970 00:00:01 GMT"; } } Or: function delete_cookie( name ) { document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; } Also did you take a look at the developer.mozilla.org page about cookies? syntax: docCookies.removeItem(name[, path[, domain]])
downvote count: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/47719011
answers question: http://stackoverflow.com/q/29793768

http://stackoverflow.com/a/29778322
score: 4
upvote count: 4
answers question: http://stackoverflow.com/q/29778107
downvote count: 0
type: Answer
has body: .value is undefined for integers. Remove that and your code will work fine.

http://stackoverflow.com/comment/47665094
comment on: http://stackoverflow.com/q/29766991
has text: Why don't you simply put that string directly inside of the if statement (of course, not as a string)
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/a/29719739
has comment: http://stackoverflow.com/comment/47574195
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47574993
answers question: http://stackoverflow.com/q/29719678
has comment: http://stackoverflow.com/comment/47574166
has comment: http://stackoverflow.com/comment/47574062
has comment: http://stackoverflow.com/comment/47574635
has body: If your goal is convert ["Abdusalam Abubakar", "Mavissoulkin"] into ["Abdusalam", "Abubakar", "Mavissoulkin"] you can do it by looping through the array, splitting the entries, and adding them to a new array, like so: var myArray = ["Abdusalam Abubakar", "Mavissoulkin"]; function cutName(a){ var newArray = []; a.forEach(function(entry) { newArray.push.apply(newArray, entry.split(" ")); }); return newArray; } snippet.log("Before: " + JSON.stringify(myArray)); snippet.log("After: " + JSON.stringify(cutName(myArray))); &lt;!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 --&gt; &lt;script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"&gt;&lt;/script&gt; The formation newArray.push.apply(newArray, ...) is a bit odd-looking: What it does is call push with a series of arguments given in the array you pass as the second argument, in effect calling push repeatedly. Or if you like to make things really concise, you could use/abuse Array#reduce: var myArray = ["Abdusalam Abubakar", "Mavissoulkin"]; function cutName(a){ return a.reduce(function(newArray, entry) { newArray.push.apply(newArray, entry.split(" ")); return newArray; }, []); } snippet.log("Before: " + JSON.stringify(myArray)); snippet.log("After: " + JSON.stringify(cutName(myArray))); &lt;!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 --&gt; &lt;script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"&gt;&lt;/script&gt; Array#reduce calls the function you give it repeatedly, once for each entry in the array, passing in the "accumulator" you give it at the end as the first argument and the entry as the first. The value you return is used as the accumulator for the next call. It's possibly a bit OTT to use it for this, but...
upvote count: 1
has comment: http://stackoverflow.com/comment/47574913
has comment: http://stackoverflow.com/comment/47574116
type: Answer
has comment: http://stackoverflow.com/comment/47574408

http://stackoverflow.com/q/29834977
type: Question
has title: How can I get body parser to parse emoticons?
tagged with: javascript
tagged with: express
score: 0
has comment: http://stackoverflow.com/comment/47797097
tagged with: node.js
tagged with: body-parser
has comment: http://stackoverflow.com/comment/47802130
answer count: 0
type: UnansweredQuestion
has body: I have the following middleware in Express: app.use(morgan('combined', util.getLogStream())); app.use(bodyParser.urlencoded({ extended: false })); app.use(bodyParser.json({ limit: '50mb' })); app.use('/api', router); app.use(express.static(__dirname + '/server/landing')); When I try to POST emoticons to my server, the line app.use(bodyParser.json({ limit: '50mb' })); breaks and crashes the server to crash. I am searching for a way to handle emoticons in Express or body parser but there seems to be little support for this. How can I get body parser to parse emoticons? EDIT: This is the message payload I am sending via curl to my Express server curl --data '{"x": 10, "y":10, "z":10, "message": "", "userToken": "Marine"}' --header "Content-Type:application/json” localhost:3000/api/messages **Error message** Uncovery listening at http://:::3000 SyntaxError: Unexpected token at Object.parse (native) at parse (/Users/user/Documents/uncovery/node_modules/body-parser/lib/types/json.js:84:17) at /Users/user/Documents/uncovery/node_modules/body-parser/lib/read.js:102:18 at IncomingMessage.onEnd (/Users/user/Documents/uncovery/node_modules/body-parser/node_modules/raw-body/index.js:149:7) at IncomingMessage.g (events.js:199:16) at IncomingMessage.emit (events.js:104:17) at _stream_readable.js:908:16 at process._tickCallback (node.js:355:11) index.html var http = require('http'); var morgan = require('morgan'); var express = require('express'); var socketIO = require('socket.io'); var bodyParser = require('body-parser'); var util = require('./server/core/utilities.js'); var router = require('./server/routes/router.js'); var sockets = require('./server/routes/sockets.js'); var app = express(); var server = http.Server(app); app.use(morgan('combined', util.getLogStream())); app.use(bodyParser.urlencoded({ extended: false })); app.use(express.json); app.use('/api', router); app.use(express.static(__dirname + '/server/landing')); var io = socketIO(server); sockets.initialize(io); s…
has comment: http://stackoverflow.com/comment/47801852
has comment: http://stackoverflow.com/comment/47799609

http://stackoverflow.com/comment/47646825
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29757121
has text: In other words: you want to replace what's followed by `id=` ? Or is it the proposed solution?
score: 0

http://stackoverflow.com/comment/47544212
has text: I'm not sure what you mean
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29703361
type: AnswerComment

http://stackoverflow.com/q/29822128
tagged with: css
has comment: http://stackoverflow.com/comment/47770353
has answer: http://stackoverflow.com/a/29822555
has answer: http://stackoverflow.com/a/29822212
has answer: http://stackoverflow.com/a/29822256
has title: How to make JavaScript work when button is pressed?
score: 1
has comment: http://stackoverflow.com/comment/47770478
has comment: http://stackoverflow.com/comment/47770623
upvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47771030
has comment: http://stackoverflow.com/comment/47770640
downvote count: 0
linked to: http://stackoverflow.com/q/5235321
has body: I am a bit of a newbie in JS and not too sure what I'm doing. I have created a button ATTEMPT A QUIZ I want when the user presses the button, the JS dg-quiz-makes.js file appears. I'm not sure how to I do it. Please help.
favorite count: 0
answer count: 5
has answer: http://stackoverflow.com/a/40302045
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29822367

http://stackoverflow.com/a/29808878
downvote count: 0
has comment: http://stackoverflow.com/comment/47777492
answers question: http://stackoverflow.com/q/29802732
has comment: http://stackoverflow.com/comment/47776774
type: Answer
has body: Your code should work. But try this javascript:(function(){var loc=location.href;loc=loc.replace('dev.mysite.com/cf#/content/www/','preview2.mysite.com/'); location.replace(loc)})() Remember to copy this into the URL of a real bookmark - I normally send people a web page they can drag from so the quotes are indeed important: ReplaceUrlBM
score: 7
upvote count: 7
has comment: http://stackoverflow.com/comment/47776715
has comment: http://stackoverflow.com/comment/47777369
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29802732

http://stackoverflow.com/comment/47513717
type: Comment
type: QuestionComment
has text: I don't see content in either iframe in the jsfiddle. What is supposed to be there?
score: 0
comment on: http://stackoverflow.com/q/29688255

http://stackoverflow.com/a/29776829
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47684823
has comment: http://stackoverflow.com/comment/47685568
type: Answer
answers question: http://stackoverflow.com/q/29776775
has comment: http://stackoverflow.com/comment/47684244
has comment: http://stackoverflow.com/comment/47685473
has comment: http://stackoverflow.com/comment/47685404
has comment: http://stackoverflow.com/comment/47685539
has comment: http://stackoverflow.com/comment/47684366
has comment: http://stackoverflow.com/comment/47684161
has body: Take a look at the redraw() method.
has comment: http://stackoverflow.com/comment/47684507

angularjs-directive
tags question: http://stackoverflow.com/q/29720389
tags question: http://stackoverflow.com/q/29767476
tag name: angularjs-directive
tags question: http://stackoverflow.com/q/29707603
tags question: http://stackoverflow.com/q/29704596
tags question: http://stackoverflow.com/q/29813573
tags question: http://stackoverflow.com/q/29816293
tags question: http://stackoverflow.com/q/29800843
tags question: http://stackoverflow.com/q/29795203
tags question: http://stackoverflow.com/q/29747894
tags question: http://stackoverflow.com/q/29727322
tags question: http://stackoverflow.com/q/29767987
tags question: http://stackoverflow.com/q/29792811
tags question: http://stackoverflow.com/q/29819137
tags question: http://stackoverflow.com/q/29798877
tags question: http://stackoverflow.com/q/29737922
tags question: http://stackoverflow.com/q/29793650
tags question: http://stackoverflow.com/q/29836997
tags question: http://stackoverflow.com/q/29822351
tags question: http://stackoverflow.com/q/29767603
tags question: http://stackoverflow.com/q/29823311
tags question: http://stackoverflow.com/q/29831637
tags question: http://stackoverflow.com/q/29758326
tags question: http://stackoverflow.com/q/29802912
tags question: http://stackoverflow.com/q/29784751
tags question: http://stackoverflow.com/q/29724670
tags question: http://stackoverflow.com/q/29792248
tags question: http://stackoverflow.com/q/29689398
tags question: http://stackoverflow.com/q/29772573
tags question: http://stackoverflow.com/q/29744863
tags question: http://stackoverflow.com/q/29793316
tags question: http://stackoverflow.com/q/29774688
tags question: http://stackoverflow.com/q/29716696
tags question: http://stackoverflow.com/q/29769188
tags question: http://stackoverflow.com/q/29743931
tags question: http://stackoverflow.com/q/29830511
tags question: http://stackoverflow.com/q/29745058
type: Tag
tags question: http://stackoverflow.com/q/29838059
tags question: http://stackoverflow.com/q/29719200
tags question: http://stackoverflow.com/q/29761555
tags question: http://stackoverflow.com/q/29815138
tags question: http://stackoverflow.com/q/29751161
tags question: http://stackoverflow.com/q/29795998
tags question: http://stackoverflow.com/q/29838941
tags question: http://stackoverflow.com/q/29741944
tags question: http://stackoverflow.com/q/29810298
tags question: http://stackoverflow.com/q/29741112
tags question: http://stackoverflow.com/q/29705513
tags question: http://stackoverflow.com/q/29824815

http://stackoverflow.com/comment/47752928
comment on: http://stackoverflow.com/a/29812404
score: 0
type: AnswerComment
has text: k.. good to know. I have learned to stringify every model that gets passed into jQuery ajax calls or it doesn't work for me.. quite possible that's related to the web api i talk to.. why i said it was a guess.
type: Comment

http://stackoverflow.com/q/29828199
tagged with: javascript
tagged with: jquery
tagged with: title
has answer: http://stackoverflow.com/a/29828771
answer count: 1
has comment: http://stackoverflow.com/comment/47783031
favorite count: 0
tagged with: attributes
accepted answer: http://stackoverflow.com/a/29828771
has comment: http://stackoverflow.com/comment/47784266
type: AnsweredQuestion
has body: I have a div element blahblahblah After magic jQuery script I want that it will be like that blahblahblah So I tried to manipulate with this But it doesn't work properly, cause I have data-exit="fadeOut scaleOut" with two properties and my script is for div like that blahblahblah But I don't want it. Maybe you know right solution for this example. Maybe some find or replaceWith function will help for this. Thanks. I hope you understood my question.
has comment: http://stackoverflow.com/comment/47782988
has comment: http://stackoverflow.com/comment/47784434
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47784543
has title: from title to data-* by jQuery?
downvote count: 0

http://stackoverflow.com/q/29780264
has title: Process multiple AJAX or SOAP calls on an ordered array of objects
score: 2
type: AnsweredQuestion
downvote count: 0
type: Question
has body: Each object has to trigger multiple AJAX calls in cascade (each request is called in the callback of the preceeding), but the order here matter. The first object must have completed all its requests before the next object starts his requests and so on. Actually, in my code, all objects are processing their requests simultaneously even if I use a timeout in the waitForProcessFinish() function. //object properties function LayerQuery(objectDefinition) { this.class = "FilteredLayer"; this.alias = objectDefinition["alias"]; this.sourceLayerName = objectDefinition["sourceLayerName"]; this.sourceTableName = objectDefinition["sourceTableName"]; this.fieldName = objectDefinition["fieldName"]; this.operator = objectDefinition["operator"]; this.label = objectDefinition["label"]; this.layerStyle = objectDefinition["layerStyle"]; this.value = objectDefinition["value"]; this.layerVisible = objectDefinition["layerVisible"]; this.labelVisible = objectDefinition["labelVisible"]; this.zoomMin = objectDefinition["zoomMin"]; this.zoomMax = objectDefinition["zoomMax"]; this.position = objectDefinition["position"]; this.control = objectDefinition["control"]; this.info = objectDefinition["info"]; this.fieldsOrder = objectDefinition["fieldsOrder"]; this.fields = []; this.baseLayer = objectDefinition["baseLayer"]; } function LayerQueries(list) { this.queries = list; } LayerQueries.prototype.loadLayers = function(){ for (i=0; i&lt; this.queries.length; i++){ this.queries[i].loading = true; this.queries[i].addFilteredLayer(); this.queries[i].waitForProcessFinish(); //wait for object's requests done to start next object } this.waitForProcessesFinish(); // wait for all objects' requests done } LayerQuery.prototype.addFilteredLayer = function(){ var query = this; $.soap({ url: 'https://carto48dev.mels.gouv.qc.ca/pushnsee_4.8/services/MapService', method: 'addFilteredLayer', appendMethodToURL: false, data : { mapInstanceKey: mapKey, tablePath: this.sourceTableName, layerName: this.sourceLayerNam…
tagged with: javascript
upvote count: 2
has answer: http://stackoverflow.com/a/29801679
answer count: 1
accepted answer: http://stackoverflow.com/a/29801679
favorite count: 0
tagged with: ajax

http://stackoverflow.com/a/29825196
has body: bootstrap.js file is missing in your fiddle. Including it makes it working. see this http://jsfiddle.net/bfo38kb1/1
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29823971
answers question: http://stackoverflow.com/q/29823971
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/47749482
score: 0
has text: yep i understand that, thats i what i have going but I'm still getting that error
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29810754

http://stackoverflow.com/a/29704381
has comment: http://stackoverflow.com/comment/47544628
downvote count: 0
has body: You could use your existing function to get a sorted names array, then sort the people array by comparing the index in the sorted names array. var names = caseInsensitiveSort(people.map(function(person) { return person.name; })); people.sort(function (a, b) { return names.indexOf(a.name) - names.indexOf(b.name); }); But this is not efficient, you should try to abstract out the compare logic from the caseInsensitiveSort function into a caseInsensitiveCompare function. Then your example would become: people.sort(function (a, b) { return caseInsensitiveCompare(a.name, b.name); });
score: 4
has comment: http://stackoverflow.com/comment/47544342
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29704241
has comment: http://stackoverflow.com/comment/47544386
answers question: http://stackoverflow.com/q/29704241
has comment: http://stackoverflow.com/comment/47544483
has comment: http://stackoverflow.com/comment/47544418
type: Answer
upvote count: 4

http://stackoverflow.com/comment/47828666
type: Comment
has text: No wonder when you do `_paq.push(_paq);`… but that's not what the code in my answer does.
comment on: http://stackoverflow.com/a/29830983
score: 0
type: AnswerComment

web-services
type: Tag
tags question: http://stackoverflow.com/q/29770299
tags question: http://stackoverflow.com/q/29815232
tags question: http://stackoverflow.com/q/29709296
tags question: http://stackoverflow.com/q/29818027
tag name: web-services
tags question: http://stackoverflow.com/q/29838949

http://stackoverflow.com/a/29817574
answers question: http://stackoverflow.com/q/29816525
has comment: http://stackoverflow.com/comment/47788176
score: 0
has body: The JavaScript must be executed in the browser client. The flow would be: PHP generates HTML (wich includes the JS code) HTML is sent to the browser The browser renders the HTML and executes the JS The browser communicates with the server to tell the result Depending if the JS is a library or an script the precise steps would differ. But basically inside tags you will have to save the result to a variable and then make an AJAX call (easier with jQuery.ajax() ) to communicate that variable to the server and then the server can do something with it. I hope that helps puting you on the right track. If you expand the info in your question, I will try to update my answer :)
type: Answer

http://stackoverflow.com/a/29833324
type: Answer
has body: Your call back is executing immediately because you're calling it then and there. Change it to this.setTimeout(function() { getPC(lapetus,pc_id); }, 18000000); so that what you want to execute is in a function for setTimeout to call. ** Edit ** In relation to my last comment. You should move your "ok..." inside of the function you've put inside of setTimeout. This will cause the "ok..." to execute right before getPC is called. this.setTimeout(function() { console.log('ok... ' + new Date); getPC(lapetus,pc_id) }, 18000000); It is important to understand that setTimeout will only start a timer which will execute your code later. setTimeout is going to start that timer, and not wait for it to finish. It will move to the next bit of code once it is done starting that timer.
score: 12
upvote count: 12
accepted answer of: http://stackoverflow.com/q/29833232
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47793400
downvote count: 0
has comment: http://stackoverflow.com/comment/47793391
answers question: http://stackoverflow.com/q/29833232
has comment: http://stackoverflow.com/comment/47793517

http://stackoverflow.com/comment/47698250
type: Comment
has text: Do you mean you would end up with something like this: `eval('var scenario = ' + (serverdata[selected_id].jsobject + ';')`? And that you want a non-eval option to consider?
comment on: http://stackoverflow.com/q/29784108
type: QuestionComment
score: 0

http://stackoverflow.com/q/29703420
downvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47619060
has answer: http://stackoverflow.com/a/29748267
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47544717
favorite count: 0
has comment: http://stackoverflow.com/comment/47544119
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47580787
has title: Unlabeled break must be in loop in Coffeescript
score: -1
has body: sheet = [1,2,3,4,5,6,7,8,9,10] myArray = [] batchSize = 0 sheetSize = sheet.length eat = (item) -&gt; loop batchSize++ sheetSize-- myArray.push item break unless batchSize &lt; 2 or sheetSize &gt; 0 batchSize = 0 document.write "myArray", myArray myArray = [] eat item for item in sheet http://codepen.io/nottinhill/pen/dobXvE I want above code to print out: 1,2 3,4 5,6 7,8 9,10 However it does not work, failing with unlabeled break must be in loop
tagged with: coffeescript

http://stackoverflow.com/comment/47688577
comment on: http://stackoverflow.com/q/29776318
score: 0
has text: I think what you are looking for is adding a JavaScriptInterface to the WebView, this allows you to get results from JavaScript in your Java code, and you can send data to JavaScript by just loading a script in WebView. Does this help? http://stackoverflow.com/questions/10472839/using-javascript-in-android-webview
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47713385
score: 0
comment on: http://stackoverflow.com/q/29792042
has text: Hi there, I have tested this is running on resize by running an alert on the else statement and then resizing to the larger size, which successfully calls the alert. I have also done this in reverse, using an alert in the if block and resizing down from the larger size, so it appears to be running fine.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47705832
type: Comment
type: QuestionComment
has text: Getify is on Stackoverflow sometimes. I've tweeted him this question :)
score: 4
comment on: http://stackoverflow.com/q/29788181

http://stackoverflow.com/a/29760983
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47654169
downvote count: 0
has body: Use ng-options and bind the select to user.m. If you want to set a default selection, you simply need to set user.m to the appropriate value. For example, in your controller $scope.user.m = $scope.user.m || $scope.duringList[0]; Plunker
has comment: http://stackoverflow.com/comment/47654405
has comment: http://stackoverflow.com/comment/47654195
type: Answer
has comment: http://stackoverflow.com/comment/47654139
score: 4
has comment: http://stackoverflow.com/comment/47654114
has comment: http://stackoverflow.com/comment/47654461
accepted answer of: http://stackoverflow.com/q/29760873
upvote count: 4
answers question: http://stackoverflow.com/q/29760873

http://stackoverflow.com/comment/47552653
type: QuestionComment
comment on: http://stackoverflow.com/q/29708442
score: 0
has text: I don't think there's an event for that, but there is a getUserMedia() function that returns a constraints object containing the resolution, and you'd probably have to poll that in an interval or something
type: Comment

http://stackoverflow.com/q/29736439
has answer: http://stackoverflow.com/a/29736549
accepted answer: http://stackoverflow.com/a/29736549
type: AnsweredQuestion
type: Question
tagged with: javascript
tagged with: jquery
has body: I want to make input group inline in a list. I wrote the following code : Cart 0 Search I am not getting input group inline. Please help me to solve this.
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
has title: How to make input group inline to a list elements in bootstrap?
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/105464471
type: Comment
has text: OR: `Date.now = jest.fn(() => Date.parse('2017-02-14))`
score: 7
type: AnswerComment
comment on: http://stackoverflow.com/a/42787232

http://stackoverflow.com/a/29821687
answers question: http://stackoverflow.com/q/29821608
has comment: http://stackoverflow.com/comment/47771745
has comment: http://stackoverflow.com/comment/47773440
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47773072
score: 0
has comment: http://stackoverflow.com/comment/47771910
has body: Number of mistakes You should not pass $scope to $http.get You can not get $scope.songList value outside ajax directictly, the value is getting populated through ajax call, so you need to run for loop inside ajax success Code $http.get("Data/SongList.json").success(function(List){ $scope.songList = List.songs; console.log("The Length : " + $scope.songList.length); for(var i = 0; i&lt; $scope.songList.length; i++) { console.log("loop number" + i); } });
accepted answer of: http://stackoverflow.com/q/29821608
type: Answer

http://stackoverflow.com/comment/47708987
type: Comment
type: QuestionComment
has text: You code seems fine (except for a missing semicolon on line 3). Are you using any other React-dependent library? Make sure that only one version of React is bundled with your app.
score: 2
comment on: http://stackoverflow.com/q/29786154

http://stackoverflow.com/comment/47676828
has text: due to if else part. The controller does not need to know about these differences, It just need to execute with given value. You should make it more generic. So that tomorrow you do not have to add another else part
type: Comment
comment on: http://stackoverflow.com/a/29765791
score: 0
type: AnswerComment

http://stackoverflow.com/q/29688280
answer count: 4
has answer: http://stackoverflow.com/a/29688301
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29688309
type: Question
has comment: http://stackoverflow.com/comment/47513704
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29688312
has answer: http://stackoverflow.com/a/29688349
tagged with: jquery
has title: jQuery: Split divs to another divs
has answer: http://stackoverflow.com/a/29688309
has body: Is anybody know how can I split divs to another ones? Within divs there are img tags? This is the current state: What I need for result: Thanks
possible better answer: http://stackoverflow.com/a/29688301

image
tags question: http://stackoverflow.com/q/29722742
tags question: http://stackoverflow.com/q/29792208
tags question: http://stackoverflow.com/q/29839942
tags question: http://stackoverflow.com/q/29780729
tags question: http://stackoverflow.com/q/29814895
tags question: http://stackoverflow.com/q/29693785
tags question: http://stackoverflow.com/q/29742508
tags question: http://stackoverflow.com/q/29795542
tags question: http://stackoverflow.com/q/29703447
tags question: http://stackoverflow.com/q/29692327
tags question: http://stackoverflow.com/q/29793301
tags question: http://stackoverflow.com/q/29798607
tags question: http://stackoverflow.com/q/29770874
tags question: http://stackoverflow.com/q/29751502
tags question: http://stackoverflow.com/q/29765000
tags question: http://stackoverflow.com/q/29732805
tags question: http://stackoverflow.com/q/29720643
tags question: http://stackoverflow.com/q/29832706
tags question: http://stackoverflow.com/q/29752779
tags question: http://stackoverflow.com/q/29706124
tags question: http://stackoverflow.com/q/29755313
tags question: http://stackoverflow.com/q/29793624
tags question: http://stackoverflow.com/q/29792633
tags question: http://stackoverflow.com/q/29788922
tags question: http://stackoverflow.com/q/29735781
tags question: http://stackoverflow.com/q/29735157
tags question: http://stackoverflow.com/q/29784576
tags question: http://stackoverflow.com/q/29809397
tag name: image
tags question: http://stackoverflow.com/q/29780446
tags question: http://stackoverflow.com/q/29826614
tags question: http://stackoverflow.com/q/29843323
tags question: http://stackoverflow.com/q/29762362
tags question: http://stackoverflow.com/q/29754064
type: Tag
tags question: http://stackoverflow.com/q/29801078
tags question: http://stackoverflow.com/q/29833820

http://stackoverflow.com/comment/47552437
comment on: http://stackoverflow.com/a/29708314
has text: Hi Madhan, there is a lot of HTML inside, thats why I went for the innerHTML, will try the innerText and textContent and let you know.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29801524
has comment: http://stackoverflow.com/comment/47759213
type: Answer
has comment: http://stackoverflow.com/comment/47769184
score: 2
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/29800611
has body: You can't write CFML to the screen and hope that it'll magically execute! THat's your problem. This article "The CFML request/response process" explains it thoroughly, but - bottom line - CFML needs to be compiled before it's executed, and that needs to be done by the CFML server, not the client browser.

http://stackoverflow.com/comment/47807945
type: AnswerComment
has text: No problem. Let us know if any issues arise (and also if none do!).
comment on: http://stackoverflow.com/a/29840259
type: Comment
score: 1

header
type: Tag
tag name: header
tags question: http://stackoverflow.com/q/29741931

http://stackoverflow.com/a/29832581
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47791940
upvote count: 1
has comment: http://stackoverflow.com/comment/47792925
type: Answer
has comment: http://stackoverflow.com/comment/47792588
has comment: http://stackoverflow.com/comment/47792251
has comment: http://stackoverflow.com/comment/47792008
has comment: http://stackoverflow.com/comment/47792353
downvote count: 0
has comment: http://stackoverflow.com/comment/47793054
score: 1
accepted answer of: http://stackoverflow.com/q/29831406
has body: .NET is parsing dates (and numbers) according to the current culture set. The culture in ASP.NET depends not on the browsers culture but on the culture the ASP.NET thread is running. So if you want to pass dates in a specific format there are (at least) two options: Set the current thread's culture (or at least the date format) to a specific value. For example (this should match your example): protected void Application_BeginRequest(object sender, EventArgs e) { string cultureName = CultureHelper.GetImplementedCulture("de-DE"); Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureName); Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture; } please find CultureHelper from here and do not forget to add your supported languages (see list _cultures). Create a model binder that filters DateTime fields according to your needs. An example can be found here. EDIT: Updated example
answers question: http://stackoverflow.com/q/29831406

http://stackoverflow.com/comment/47761298
score: 0
type: Comment
has text: @DelightedD0D: Your code works fine. But in my question , at first, table was hidden and when the button clicked it must be visible.
comment on: http://stackoverflow.com/a/29815930
type: AnswerComment

http://stackoverflow.com/q/29798236
has comment: http://stackoverflow.com/comment/47724713
tagged with: wordpress
type: Question
tagged with: ios
answer count: 1
has answer: http://stackoverflow.com/a/29799662
tagged with: javascript
has body: I'm working on a wordpress website that uses the fullpage.js plugin. My main goal is to make it go fullscreen on iOS devices, latest versions are the main targets. By making it go fullscreen I mean getting rid of the ugly top and bottom bars, as you can see on this picture, in landscape mode those bars take up more than 25% of the space. I've tried this, but of course all browsers are compatible except safari iOS. I've also tried all tips I found on here like including the meta "apple-mobile-web-app-capable" but nothing seems to work.
score: 0
tagged with: fullpage.js
has title: How to make a website that uses fullpage.js go fullscreen on Safari for iOS
accepted answer: http://stackoverflow.com/a/29799662
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/a/29698598
type: Answer
accepted answer of: http://stackoverflow.com/q/29698466
score: 2
answers question: http://stackoverflow.com/q/29698466
downvote count: 0
has body: You are iterating over the blocks with a for...in, which also causes you to iterate over the "length" property. A better approach: var blocks = document.getElementsByClassName('block'); for (var i=0;i&lt;blocks.length;i++) { blocks[i].style.background = "rgb" + "(" + colors[random][0] + ", " + colors[random][1] + ", " + colors[random][2] + ")"; }
upvote count: 2
has comment: http://stackoverflow.com/comment/47533916
type: AcceptedAnswer

http://stackoverflow.com/comment/47686017
type: Comment
score: 0
has text: For simple values that identify resources (i.e. id) you should use [route parameters](http://docs.phalconphp.com/pl/latest/reference/routing.html). As for receiving and filtering JSON data, yes, AFAIK you have to do it on your own.
type: AnswerComment
comment on: http://stackoverflow.com/a/29723517

http://stackoverflow.com/comment/47761390
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29816715
has text: Yes i'm aware that. and i know it not valid, and already mentioned on my post, but it depend on @Mohammad Iqbal what he want and why. Maybe he doing that for a reason, otherwise he did't know how to code that. If so, then my mistake. Cheers.

http://stackoverflow.com/q/29797366
answer count: 2
has title: Truncating Subscribed Observable
tagged with: rxjs
type: Question
has answer: http://stackoverflow.com/a/29798562
score: 0
has body: I have an observable with a subscriber that that updates the ui. someObservable.forEach(function(item) { updateUI(item); }); My issue is that after some specific user actions I want to ignore N items from this stream, and handle it slightly differently (instead of the default handler). Say the user does an action which I know will produce four items in the observable, so I want to postpone updating until the last of these items has arrived. I was looking into merging this stream with a "control" stream, and use groupJoin or something to truncate it, but as far as I can see this will only work with a time window, and not a count of items, or even a specific order.
has answer: http://stackoverflow.com/a/29807642
has comment: http://stackoverflow.com/comment/47745307
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/107614927
type: AnswerComment
has text: I'm curious about the `useLayoutEffect`. I'm trying to see what you've mentioned.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/60819956

http://stackoverflow.com/q/29804075
has title: How to keep C# and Javascript Code in sync?
tagged with: cross-platform
upvote count: 1
tagged with: c#
tagged with: asp.net-mvc-5
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
score: 1
has body: I should think this problem could come to anyone, I'm interested in ways of making the best use of technology to keep my code-base DRY and in sync. I'm developing an ASP.NET MVC5 web application. I have several variables I need to be communicating to the client side. Say "PageType", which I need to be tracked on the client side using Google Analytics. The intent may be multifarious, this is a simple application with the same purpose, for illustration. I have a C# class which allows me to specify the various PageTypes and also switch between them for switch-casing, say: public static class PageTypes { public const String Home = "Home"; public const String AboutUs = "AboutUs"; public const String ContactUs = "ContactUs"; } This is useful when we check dynamic values, like: String pageType = ViewBag.PageType; if(!String.IsNullOrWhiteSpace(pageType)) { switch(pageType) { case PageTypes.Home: // do something here break; case PageTypes.AboutUs: // do something else here break; ... ... or even when doing comparisons. I hope you get the point. So, in a Razor View, I can output var pageType = '@ViewBag.PageType'; in a page in an inline script, and it will be present as var pageType = 'Home'; or some such as the case, in the inline javascript of the page. Now, just as I did with the C# code, I want to be able to switch-case the page type inside my javascript. // This part is dynamic so will be inline script of the razor view var pageType = 'Home'; // This part is logic so can reside in an external script // This part is just illustration, I will worry about naming and accessibility later // This will be in a separate script and will be included, and will be referenced, thereby providing Intellisense within Visual Studio var PageTypes = { Home: 'Home', AboutUs: 'AboutUs' }; // I should be able to do this, in an external script switch(pageType){ case PageTypes.Home: alert('Home!'); break; case PageTypes.AboutUs: alert('Not Home'); break; default: alert('Nothing'); break; } It c…
favorite count: 0
has answer: http://stackoverflow.com/a/29804498
tagged with: dry
type: Question
answer count: 1

http://stackoverflow.com/q/29796182
has answer: http://stackoverflow.com/a/29796440
has answer: http://stackoverflow.com/a/29796430
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29796430
has comment: http://stackoverflow.com/comment/47720738
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47720673
has comment: http://stackoverflow.com/comment/47720782
accepted answer: http://stackoverflow.com/a/29796440
has title: Edit table with a select box
has comment: http://stackoverflow.com/comment/47720790
tagged with: javascript
tagged with: sorting
has body: How can I only show the channel in the table that I pick from the select box? Channel All Online Butcher The Meat Site BBQ Online We Sell Meat These are my options so in the table below say I only wanted it to show rows with the channel Online Butcher? Niche ID Channel Customer Name Dispatch 012345678 Online Butcher Mr D Jones Dispatch 012345677 The Meat Site Mr C Jones Dispatch 012345676 BBQ Online Mr B Jones Dispatch 012345675 We Sell Meat Mr A Jones Dispatch Hope it makes sense. I used this to sort my table using the headers, maybe something similar but instead of order only show certain channel. function sortTable(table, col, reverse) { var tb = table.tBodies[0], // use ` ` to ignore ` ` and ` ` rows tr = Array.prototype.slice.call(tb.rows, 0), // put rows into array i; reverse = -((+reverse) || -1); tr = tr.sort(function (a, b) { // sort rows return reverse // `-1 *` if want opposite order * (a.cells[col].textContent.trim() // using `.textContent.trim()` for test .localeCompare(b.cells[col].textContent.trim()) ); }); for(i = 0; i < tr.length; ++i) tb.appendChild(tr[i]); // append each row in order } function makeSortable(table) { var th = table.tHead, i; th && (th = th.rows[0]) && (th = th.cells); if (th) i = th.length; else return; // if no ` ` then do nothing while (--i >= 0) (function (i) { var dir = 1; th[i].addEventListener('click', function () {sortTable(table, i, (dir = 1 - dir))}); }(i)); } function makeAllSortable(parent) { parent = parent || document.body; var t = parent.getElementsByTagName('table'), i = t.length; while (--i >= 0) makeSortable(t[i]); } window.onload = function () {makeAllSortable();};
tagged with: html-table
score: 0
answer count: 3
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29796458
has comment: http://stackoverflow.com/comment/47720544
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47578153
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29718750
has text: update your addRow function so that new row would have the diff ids for "keyword" and "chapter" and pass the values of these two field in CLO(key, chap) itself;

http://stackoverflow.com/comment/47521856
score: 1
has text: Perfect. it worked. It will be great if you can post this as an answer to my question so that i can accept the same. The question will still remain opened otherwise.
comment on: http://stackoverflow.com/q/29692155
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29719228
accepted answer of: http://stackoverflow.com/q/29718994
answers question: http://stackoverflow.com/q/29718994
has body: You should use $(this).removeAttr("disabled"); $(this).removeAttr("selected"); from jQuery documentation: http://api.jquery.com/removeattr/ and for setting an Attribute it take 1 attribute name at a time so you can use: $(this).attr("disabled", ""); $(this).attr("selected", true); https://api.jquery.com/attr/
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/29763557
has answer: http://stackoverflow.com/a/36365805
type: Question
has comment: http://stackoverflow.com/comment/47658803
downvote count: 0
has title: SyntaxError: Unexpected token o at Object.parse (native) AngularJS
tagged with: javascript
favorite count: 0
has body: Question from AngularJS noob. I am trying to use an asmx web service to display grid. I tested the web service and it correctly outputs the JSON data. Here is my controller app.controller('SetupController', ['$scope', '$http', function ($scope, $http) { var url = 'app/pricefilessetup/grid.asmx/getGridJson'; $http.get(url).success(function (data) { var myjson = JSON.parse(data); $scope.products= JSON.parse(myjson); }); }]); For some reason, SO is not allowing me to paste the html but it basically has a ng-controller directive and ng-repeat to loop through the JSON data. When I run this web app, I get the error SyntaxError: Unexpected token o at Object.parse (native) and it points to following line $scope.questions = JSON.parse(myjson); I tried checking the value of myjson using alert and it displays [object Object], [object Object], ... Is there anything I am missing here
tagged with: angularjs
answer count: 5
has answer: http://stackoverflow.com/a/29763622
tagged with: angularjs-http
upvote count: 31
has answer: http://stackoverflow.com/a/35875896
has comment: http://stackoverflow.com/comment/47658716
possible better answer: http://stackoverflow.com/a/29763780
has answer: http://stackoverflow.com/a/29763584
has answer: http://stackoverflow.com/a/29763780
score: 31
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29763622
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/29767153
has answer: http://stackoverflow.com/a/29767242
upvote count: 1
possible better answer: http://stackoverflow.com/a/29767249
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29767249
has answer: http://stackoverflow.com/a/29767297
favorite count: 0
has title: jQuery element somehow cached in setInterval
answer count: 5
has comment: http://stackoverflow.com/comment/47665825
has comment: http://stackoverflow.com/comment/47665695
has answer: http://stackoverflow.com/a/29767282
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/29767260
has comment: http://stackoverflow.com/comment/47665356
type: Question
has body: I'm trying to trigger a click on an element every x seconds. It's not the exact same element every time (depending on which tab a user has selected, it should click that tab), but they are all in the same container (with id #container. The selected element has the class .selected and gets that class when it has been clicked on by a user. This is the code I have: var feedContainer = $('#container'); window.setInterval(function () { var selectedTab = feedContainer.find('.selected'); selectedTab.trigger('click'); }, 10000); The problem is that between the timeouts, if a user clicks on another tab, this part doesn't pick up on that: var selectedTab = feedContainer.find('.selected');. It just gets the one that was selected before, not the new one that has the class. How do I avoid that? It works fine if I do the entire selection in the timer each time (var selectedTab = $('#container .selected');). It seems to be somehow caching the results from the last run. Why is this and how do I force it to fetch the correct element?
accepted answer: http://stackoverflow.com/a/29767242
score: 1
has comment: http://stackoverflow.com/comment/47665409

http://stackoverflow.com/comment/47569923
score: 0
type: AnswerComment
has text: Thanks! But the question is how I can transform the dataset to this array/JSON!
type: Comment
comment on: http://stackoverflow.com/a/29714128

http://stackoverflow.com/q/29699049
favorite count: 0
tagged with: jquery-select2
answer count: 0
tagged with: twitter-bootstrap
tagged with: angularjs-select2
type: UnansweredQuestion
upvote count: 1
score: 1
has title: 'No Matches found' message when i scroll the window up and down in Select2 Multiselect
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I am using Select2 for Multiselect , the issue that i am facing now it displays 'No Matches found' message when i scroll the window up and down. For example, If i Select, 3 values and delete those 3 values and then If I scroll Up and Down , then it dispalys 3 'No Matches found'. I tried to add .select2-no-results { display: none !important; } The problem here it will stop display even if there is no such result.

http://stackoverflow.com/comment/47722879
type: Comment
comment on: http://stackoverflow.com/q/29797187
score: 0
type: QuestionComment
has text: So what output you expected?

http://stackoverflow.com/a/29795032
has comment: http://stackoverflow.com/comment/47720905
downvote count: 1
has comment: http://stackoverflow.com/comment/47721991
score: -1
has comment: http://stackoverflow.com/comment/47720793
upvote count: 0
has comment: http://stackoverflow.com/comment/47721056
answers question: http://stackoverflow.com/q/29794765
type: Answer
has comment: http://stackoverflow.com/comment/47721997
has comment: http://stackoverflow.com/comment/47721096
has body: var txt; $(document).ready(function(){ setInterval(function(){ //code goes here that will be run every 5 seconds. $.ajax({ type: "POST", url: "checkfolder.php", success: function(result) { txt = result; if (txt === "1") { alert("Hi!"); } else{ alert(txt); } } }); }, 5000); });
has comment: http://stackoverflow.com/comment/47720578

http://stackoverflow.com/comment/47640005
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29753865
has text: Apart from your actual question, the problem with the example above is that it tries to grab the previously defined this.someFunction using just the name someFunction. That should be this.someFunction.

http://stackoverflow.com/comment/47690520
type: Comment
type: QuestionComment
has text: Does the last item not match the conditional whereas the others do?
comment on: http://stackoverflow.com/q/29780137
score: 0

http://stackoverflow.com/a/29750828
score: -1
downvote count: 1
has body: Try this: create a new common Js module in which you put each request handler you need for your routing: For example: routes.js (that you should call "handler.js" or something like this"): module.exports = { index : function(req,res){ }, about : function(req,res){ } }
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/29745544

http://stackoverflow.com/comment/47715103
score: 0
type: AnswerComment
type: Comment
has text: decodeEntities() function will convert html to text.And is very simple.
comment on: http://stackoverflow.com/a/29793276

http://stackoverflow.com/a/29704971
answers question: http://stackoverflow.com/q/29704943
upvote count: 2
downvote count: 0
type: Answer
score: 2
has body: Aside from putting the handler in the document ready, you should fix your syntax too. You need to use .on() to handle an event which is the first parameter to the method. Documentation here: https://api.jquery.com/on/ //alert if the js-script is succesfully loaded $( document ).ready(function() { alert("mailto script loaded!"); //eventhandler send-button $('#send').on('click',function() { alert( "Handler has beend called." ); }); }) Working Example: http://jsfiddle.net/5xn5tpq4/ The code in the javascript pane is already wrapped with the ready handler.

http://stackoverflow.com/q/29777703
has body: I would like to add something after the 2nd or 3d element of $(this). This is actually always a form, just to let you know. After this form there are some other elements and at the the end there is another form, where you can go back. After this form i would like to add a message, if a comment has been created, but how can i do something like: $(this).after.after(" The comment has been edited! "); or something like where i can also use the name of the class the form has? Actually the form to go back has the name back. I actually need to use $(this) because else the message is added for each comment.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29777773
tagged with: insertafter
has comment: http://stackoverflow.com/comment/47686365
has title: Add something after 2 elements using $(this)?
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47685554
has comment: http://stackoverflow.com/comment/47686413
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/29777900
has answer: http://stackoverflow.com/a/29777900
has comment: http://stackoverflow.com/comment/47685579
accepted answer: http://stackoverflow.com/a/29777773

http://stackoverflow.com/comment/47774837
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29824130
has text: @charlietfl how do I call it after the change?

http://stackoverflow.com/q/29726613
has comment: http://stackoverflow.com/comment/47587631
has answer: http://stackoverflow.com/a/29727710
has comment: http://stackoverflow.com/comment/47587422
has comment: http://stackoverflow.com/comment/47587401
tagged with: javascript
type: Question
score: 0
has comment: http://stackoverflow.com/comment/47588145
has comment: http://stackoverflow.com/comment/47587753
has comment: http://stackoverflow.com/comment/47587104
has comment: http://stackoverflow.com/comment/47587869
answer count: 1
has comment: http://stackoverflow.com/comment/47587420
has title: How to ask browser for geolocation on behalf of host domain?
has body: I'm making a JavaScript widget which will be included on other people's websites. On customer's website, let's say example.com, the setup will be: &lt;script type="text/javascript" src="https://cdn.mywidget.com"&gt;&lt;/script&gt; The widget has location-based functionality and makes a call to navigator.geolocation.getCurrentPosition() Unfortunately, the browser asks https://cdn.mywidget.com wants to use your computer's location. Allow or Block. This is confusing to the user since they have no idea what cdn.mywidget.com is, because they are currently visiting example.com. Is there a way to do http://example.com wants to use your computer's location?
has comment: http://stackoverflow.com/comment/47587112
tagged with: widget
type: UnansweredQuestion
tagged with: geolocation

http://stackoverflow.com/q/29765151
has comment: http://stackoverflow.com/comment/47661700
type: Question
has answer: http://stackoverflow.com/a/29765549
has answer: http://stackoverflow.com/a/29765236
has answer: http://stackoverflow.com/a/29765199
answer count: 8
has answer: http://stackoverflow.com/a/29765293
has answer: http://stackoverflow.com/a/29765303
tagged with: javascript
linked to: http://stackoverflow.com/q/6003819
has answer: http://stackoverflow.com/a/29765771
score: 43
upvote count: 43
has comment: http://stackoverflow.com/comment/47662275
downvote count: 0
has comment: http://stackoverflow.com/comment/47661905
has answer: http://stackoverflow.com/a/29765299
linked to: http://stackoverflow.com/q/12821650
favorite count: 0
has answer: http://stackoverflow.com/a/64049939
accepted answer: http://stackoverflow.com/a/29765293
has body: How do I check if a textbox is disabled or enabled in JavaScript? I just want to know if a textbox is enable or disabled on button click. If the textbox is disabled I want to alert the user with the message "disabled" and if it is enable, the alert message will be "enabled". &lt;script&gt; function CheckTextbox(){ if(textbox1 is disabled){ //here alert("disabled"); }else{ alert("enable"); } if(textbox2 is disabled){ //here alert("disabled"); }else{ alert("enable"); } } &lt;/script&gt; &lt;input type="text" id="textbox1" disabled="disabled"&gt; &lt;input type="text" id="textbox2"&gt; &lt;input type="button" onclick="CheckTextbox();"&gt;
linked to: http://stackoverflow.com/q/32716877
type: AnsweredQuestion
has title: Check if textbox disabled or enabled in JavaScript
possible better answer: http://stackoverflow.com/a/29765199

http://stackoverflow.com/a/32331744
has body: Go to Google Custom Search Control panel. Select the Search-engine where you generated the Key &amp; Code. Go to Look and Feel, from the sidebar. Change the Layout from 'Overlay'(Popup) to the desire style you need.
answers question: http://stackoverflow.com/q/29701977
score: 8
downvote count: 0
upvote count: 8
type: Answer

http://stackoverflow.com/comment/47796845
comment on: http://stackoverflow.com/a/29739052
type: AnswerComment
score: 0
type: Comment
has text: I tried to implement this string method into my app, but keep receiving "unhandled exception" errors. I then tried to bypass these errors by surrounding them with try/catch methods. The code compiles and loads onto my device, but upon opening the app, it crashes immediately. What am i doing wrong?

http://stackoverflow.com/comment/47560321
comment on: http://stackoverflow.com/a/29712410
type: Comment
has text: Please don't ask the OP to mark your answer as "accepted answer" in your answer or ask for an upvote.
score: 0
type: AnswerComment

http://stackoverflow.com/q/29793724
answer count: 1
downvote count: 0
has body: Is there a way to set the YSTEP of the graph? We are trying to show a chart with the below data g = new Dygraph( document.getElementById("graph"), [ [1,10,10], [2,20.11,20], **[3,10.111,10]**, [4,20,20]], {labels: [ "x", "A", "B" ]}); but the out put is rounded with 0.01, and we are getting as g = new Dygraph( document.getElementById("graph"), [ [1,10,10], [2,20.11,20], **[3,10.11,10]**, [4,20,20]], {labels: [ "x", "A", "B" ]}); How to correct it?
favorite count: 0
has title: Decreasing the stepsize of Y Axis
type: AnsweredQuestion
score: 2
tagged with: dygraphs
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/29799220
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29799220

http://stackoverflow.com/comment/47669588
comment on: http://stackoverflow.com/q/29769154
score: 0
type: Comment
has text: @David in the first variant I don't take any input from the user. It's when I need to form a predefined table and fill it with data from database.
type: QuestionComment

http://stackoverflow.com/comment/47781550
comment on: http://stackoverflow.com/q/29825455
score: 0
type: Comment
has text: I have added the code, and it recognizes the keystrokes/value correctly. With an error message after each value :-P
type: QuestionComment

http://stackoverflow.com/comment/48993567
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29747894
has text: In angular docs about directives, they say that: `templateUrl can also be a function which returns the URL of an HTML template to be loaded and used for the directive. Angular will call the templateUrl function with two parameters: the element that the directive was called on, and an attr object associated with that element. **Note: You do not currently have the ability to access scope variables from the templateUrl function, since the template is requested before the scope is initialized.**` could be this the problem?
score: 0

http://stackoverflow.com/comment/47784928
has text: I asked because italic property names indicate a getter function, but italic getters also cause the `(...)` behavior. If you had an italic property without `(...)`, then that would be unusual. You did have it, though, so it's perfectly normal. (I added a little to my answer about that.)
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29821843
type: QuestionComment

http://stackoverflow.com/q/29789946
score: 1
type: Question
has answer: http://stackoverflow.com/a/29792283
answer count: 2
tagged with: yii
tagged with: javascript
upvote count: 1
tagged with: submit
has title: Yii, attaching a javascript function on submit button
favorite count: 0
has answer: http://stackoverflow.com/a/29790075
downvote count: 0
type: UnansweredQuestion
has body: I want to attach a function to my submit button. But my code doesn't seem to be calling the function. Basically what I want it to do is, enabling all disabled field when the form is being submitted. This below is my code: &lt;script&gt; function enableField() { $("#Booking_clientPackagedService_id").prop("disabled", false); } &lt;/script&gt; &lt;?php echo CHtml::submitButton(Yii::t('app', 'Save')); $this-&gt;endWidget(); ?&gt; This #Booking_clientPackagedService_id initially is disabled after certain action being done. But when I click on submit, I would like to enable the field. How can I do it? Please advise, thanks! :D EDIT So I've removed onclick event on my submit button and added as per Kancho Iliev's comment. $( "#booking-form" ).submit(function() { $("#Booking_clientPackagedService_id").prop("disabled", false); }); But it is still not working. Where have I missed out?
tagged with: php

http://stackoverflow.com/q/29709438
tagged with: openshift
tagged with: git
has body: I am creating an a webpage with bootsrap signin/signup functionalities. In my Cloud9 IDE, the bootsrap css and js are loading properly and the page looks good. But, when I push the code to Openshift using: git commit -a -m 'newchange' git push the HTML code is rendering but with no Bootstrap css and JS. Here is my Openshift link: App link Any help would really be appreciated. Thanks.
has comment: http://stackoverflow.com/comment/47554939
score: 1
has title: CSS and JS not loading after pushing to Openshift from Cloud9 IDE
type: Question
tagged with: cloud9-ide
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47557332
has comment: http://stackoverflow.com/comment/47554667
has comment: http://stackoverflow.com/comment/47554911
tagged with: css
favorite count: 0
answer count: 0
has comment: http://stackoverflow.com/comment/47557468
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47561386
upvote count: 1

http://stackoverflow.com/q/29754815
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I have a SVG file I'm displaying and from which I want to get informations of when I click on specific element. Here is the part of the SVG : &lt;g id="group327-2702" transform="translate(1539.96,-1043.15)" v:mID="327" v:groupContext="group"&gt; &lt;v:custProps&gt; &lt;v:cp v:nameU="idApplication" v:lbl="idApplication" v:type="0" v:sortKey="1" v:langID="1036" v:val="VT4(143)"/&gt; &lt;v:cp v:nameU="labelFR" v:lbl="labelFR" v:type="0" v:sortKey="3" v:langID="1036" v:val="VT4(Carnet d&amp;#39;ordres)"/&gt; &lt;v:cp v:nameU="labelEN" v:lbl="labelEN" v:type="0" v:sortKey="4" v:langID="1036" v:val="VT4(Order Management System )"/&gt; &lt;v:cp v:nameU="type" v:lbl="Type" v:type="0" v:langID="1036" v:val="VT4(Business)"/&gt; &lt;v:cp v:nameU="appLevel" v:lbl="appLevel" v:type="0" v:langID="1036" v:val="VT4(3)"/&gt; &lt;v:cp v:nameU="name" v:lbl="name" v:type="0" v:sortKey="2" v:langID="1036" v:val="VT4(MCE Trading)"/&gt; &lt;v:cp v:nameU="External" v:lbl="External" v:type="0" v:langID="1036" v:val="VT4(FALSE)"/&gt; &lt;v:cp v:nameU="_VisDM_type" v:lbl="type" v:langID="1036" v:val="VT4(Business)"/&gt; &lt;v:cp v:nameU="_VisDM_status" v:lbl="status" v:type="2" v:langID="1036" v:val="VT0(1):26"/&gt; &lt;/v:custProps&gt; &lt;v:userDefs&gt; &lt;v:ud v:nameU="msvStructureType" v:prompt="" v:val="VT4(Container)"/&gt; &lt;v:ud v:nameU="msvSDContainerMargin" v:prompt="" v:val="VT0(0.078740157480315):24"/&gt; &lt;v:ud v:nameU="Label" v:prompt="" v:val="VT0(2):26"/&gt; &lt;v:ud v:nameU="ShapeVersion" v:prompt="" v:val="VT0(1):26"/&gt; &lt;v:ud v:nameU="LightColorText" v:prompt="" v:val="VT0(0):5"/&gt; &lt;/v:userDefs&gt; &lt;title&gt;Module.52.327&lt;/title&gt; &lt;g id="shape328-2703" v:mID="328" v:groupContext="shape"&gt; &lt;title&gt;Feuille.328&lt;/title&gt; &lt;v:userDefs&gt; &lt;v:ud v:nameU="visVersion" v:val="VT0(14):26"/&gt; &lt;/v:userDefs&gt; &lt;rect x="0" y="1652.6" width="93.5433" height="31.1811" rx="2.83465" ry="2.83465" class="st72"/&gt; &lt;/g&gt; &lt;g id="shape327…
tagged with: http://stackoverflow.com/tag/svg
tagged with: visio
tagged with: siblings
accepted answer: http://stackoverflow.com/a/29772670
has answer: http://stackoverflow.com/a/29755830
upvote count: 1
has title: Access attributes of a SVG node
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29772670
score: 1
answer count: 2
possible better answer: http://stackoverflow.com/a/29755830

http://stackoverflow.com/comment/47596344
comment on: http://stackoverflow.com/q/29729197
score: 0
type: Comment
type: QuestionComment
has text: Or use PHP `file_get_contents`.

http://stackoverflow.com/q/29836239
has comment: http://stackoverflow.com/comment/47800643
accepted answer: http://stackoverflow.com/a/29854647
type: Question
has answer: http://stackoverflow.com/a/29854647
linked to: http://stackoverflow.com/q/8839743
tagged with: ionic-framework
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47800668
tagged with: javascript
has comment: http://stackoverflow.com/comment/47800707
tagged with: angularjs
tagged with: sockets
type: AnsweredQuestion
has title: Socket.emit doesn't work with Ionic
tagged with: cordova
has body: I am trying to create a socket connection between my ionic application and a socket server that I've built. The socket connection won't work when running the app in iOS simulator using ionic run ios --target="iPhone-6-Plus" The socket connection works when serving the app in the browser using ionic serve. My Code I'm using btford's socket.io compontent I have a socket service in my app client that connects to my socket server: .factory('Sockets', function($http, socketFactory){ var myIoSocket = io.connect('localhost:5000'); var mySocket = socketFactory({ ioSocket: myIoSocket }); return mySocket; }) Here is what my client socket request looks like: angular.module('crewapp.chat', []) .controller('ChatController', function($scope, Auth, Sockets, $localStorage){ $scope.test = 'Chats'; Sockets.emit('join room', $localStorage.groupname) }); Here is what my socket server (in short) looks like io.sockets.on('connection', function(socket) { socket.on('join room', function(room) { socket.room = room; socket.join(room); console.log(room); }); What I've Tried I've tried seeing if Socket.emit is defined in the app which it is: I've generalized where the socket server should log by placing a console.log in socket.on('connection') callback's function body.

http://stackoverflow.com/a/29831493
has body: I ended up using their RESTful APIs. So I designed the search form myself and then query Google for the result. https://developers.google.com/custom-search/json-api/v1/overview
type: Answer
answers question: http://stackoverflow.com/q/29750874
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29750874

http://stackoverflow.com/q/29822707
type: Question
has answer: http://stackoverflow.com/a/29822778
has body: I have a php page where section is having a table. I have provided a delete button so that entry can be deleted after clicking on it. I make an Ajax call to delete the data from DB and then from UI. Here is part of my php page: Your Promotion History Col 1 Col 2 Col 3 Col 4 <?php $query1 = mysqli_query($con,"...some query here..."); while($row=mysqli_fetch_array($query1)) { ...some data fetched from DB here... ?> <div id="product_entry_<?php echo $id?>" class="product_class_entry_<?php echo $id?>"> <?php echo $date?> <?php echo $ProductName?> <?php echo $Category.' / '.$SubCategory?> <?php echo $MRP.' / '.$Price?> <button type="submit" class="btn btn-primary btn-xs" style="padding:2px 2px;font-size: 9px;line-height: 10px;" onClick="DirectPromoteSubmit(<?php echo $id?>)">Promote <button type="submit" class="btn btn-primary btn-xs" style="padding:2px 2px;font-size: 9px;line-height: 10px;" onClick="RePromoteSubmit(<?php echo $id?>)">Edit <button type="submit" class="btn btn-primary btn-xs" style="padding:2px 2px;font-size: 9px;line-height: 10px;" onClick="DelPromoteSubmit(<?php echo $id?>)">X <?php } ?> Col 1 Col 2 Col 3 Col 4 Here is my AJAX code: <?php include("../dbconnection.php"); include("session.php"); $error = ''; $success = ''; $response = array(); $promote_id=$_POST['id']; $id = isset($_REQUEST['id'])?trim($_REQUEST['id']):''; if($id){ $query = "delete from sellerpromotions where id = '$promote_id'"; if (!mysqli_query($con,$query)) { die('Error: ' . mysqli_error($con)); } else { $msg =" 1 record added"; } $success = 'Comment has been deleted successfully.'; } else $error = 'Promotions doesn\'t deleted successfully. Please try again later.'; $response = array('error' => $error, 'success' => $success, 'id' => $promote_id); echo json_encode($response); exit(); ?> and here is my JS: function DelPromoteSubmit(id){ var self = $(this); alert("in delete promote: " + self); var dataString = "id=" + id; alert(dataString); $.ajax({ url: "SellerPanel/delete_data2.php", t…
answer count: 3
has comment: http://stackoverflow.com/comment/47771635
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/29822777
score: 0
has comment: http://stackoverflow.com/comment/47771626
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29822776
has comment: http://stackoverflow.com/comment/47771738
tagged with: php
accepted answer: http://stackoverflow.com/a/29822777
has title: Ajax call not deleting div
possible better answer: http://stackoverflow.com/a/29822776

http://stackoverflow.com/q/29796303
has body: Background: I want to be able to create a custom error mask for ajax loading errors, for ex. in case of network problems. I am using the following code to create to create a a new Ext JS store, whose proxy I would like to extend with my own afterRequest function. The afterRequest function should send an afterload event, which is used by a utility function calling mask() on the widget. var settingsStore = new Ext.data.Store({ model: 'vmSettings', autoload: 'true', proxy: { type: 'ajax', url: 'ta-debian-7-wheezy-virtualbox.json', afterRequest: function(request, success) { this.fireEvent('afterload', this, request, success); return; }, reader: { type: 'json', rootProperty: 'variables', }, } }); Now this code is loading withour error with Ext JS but fails on 5.1 with the message: Cannot override method afterRequest on Ext.data.proxy.Ajax instance What could be wrong here ?
downvote count: 0
has title: Cannot override method afterRequest on Ext.data.proxy.Ajax instance when migrating an Ext JS 4 codebase
type: Question
tagged with: javascript
score: 4
tagged with: extjs
answer count: 2
favorite count: 0
has answer: http://stackoverflow.com/a/29798669
accepted answer: http://stackoverflow.com/a/29798669
possible better answer: http://stackoverflow.com/a/29801883
upvote count: 4
has answer: http://stackoverflow.com/a/29801883
type: AnsweredQuestion

http://stackoverflow.com/comment/47606034
type: AnswerComment
type: Comment
has text: DOWNLOAD HERE: http://we.tl/ha9JfggYvr OR: http://www.filedropper.com/01_3 http://www.filedropper.com/02_4
comment on: http://stackoverflow.com/a/29713877
score: 0

http://stackoverflow.com/q/29779700
answer count: 1
has body: Assuming I have a file data.txt and I want to send it using POST with XHR. I found this. All my google searches have led to the use of FormData object. &lt;input type="file" id="uploadfile" name="uploadfile" /&gt; &lt;input type="button" value="upload" onclick="upload()" /&gt; &lt;script&gt; var client = new XMLHttpRequest(); function upload() { var file = document.getElementById("uploadfile"); /* Create a FormData instance */ var formData = new FormData(); /* Add the file */ formData.append("upload", file.files[0]); client.open("post", "/upload", true); client.setRequestHeader("Content-Type", "multipart/form-data"); client.send(formData); /* Send to server */ } /* Check the response status */ client.onreadystatechange = function() { if (client.readyState == 4 &amp;&amp; client.status == 200) { alert(client.statusText); } } &lt;/script&gt; This example looks nice however I want the file to be uploaded without the pick of it which isn't the case in this code. So I thought about putting a custom value in the file input like this : &lt;input value = "data.txt" type="file" id="uploadfile" name="uploadfile" /&gt; But apparently we just can't do it. So how can I achieve this with or without using FormData knowing that I want to send this file without picking it ?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47689518
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29780171
has comment: http://stackoverflow.com/comment/47689710
has comment: http://stackoverflow.com/comment/47690000
has comment: http://stackoverflow.com/comment/47689677
tagged with: javascript
has comment: http://stackoverflow.com/comment/47689615
type: Question
score: 0
linked to: http://stackoverflow.com/q/1696877
has title: How to upload pre-defined file with XMLHttpRequest?

http://stackoverflow.com/a/29830944
downvote count: 1
has comment: http://stackoverflow.com/comment/47817430
has body: That's a very normal feature that can be handled entirely by ExtJS. There is no need of manually adding records to the combo store one by one. You just need to define a store with an ajax proxy and attach it to the combobox component instead. That store would be configured to pull and parse its own data. Here is a simple example of how you can do that.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29744200
has comment: http://stackoverflow.com/comment/47807024
upvote count: 1

http://stackoverflow.com/comment/47812619
comment on: http://stackoverflow.com/q/29840281
type: QuestionComment
has text: remove .style part and do a new select with new data. `svg.selectAll(".circle").data(mydata2).enter().style("fill", function(d) {return mycolor[whatever math with d]})`
score: 0
type: Comment

meteor-helper
tag name: meteor-helper
tags question: http://stackoverflow.com/q/29780299
tags question: http://stackoverflow.com/q/29729993
type: Tag

http://stackoverflow.com/q/29729472
answer count: 2
possible better answer: http://stackoverflow.com/a/29729677
has body: Inside div I am dynamically loading inner text and it also contains img tags. After rendering dynamically I want to add class to all images present insdie that div. I have tried this but its not working for me. src of every img tag inside div is starting from data:image function loadDiv() { // loading successfully div elements $("img[src*=data:image]").addClass("img-responsive"); }
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29729552
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
upvote count: 2
accepted answer: http://stackoverflow.com/a/29729552
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/29729677
type: Question
has title: How to Add class to all images inside div using jQuery?

http://stackoverflow.com/comment/47720345
comment on: http://stackoverflow.com/q/29796115
score: 0
type: Comment
type: QuestionComment
has text: what happens when you submit?

http://stackoverflow.com/q/29709334
has answer: http://stackoverflow.com/a/33261992
tagged with: javascript
upvote count: 13
has comment: http://stackoverflow.com/comment/47610155
has answer: http://stackoverflow.com/a/29753495
favorite count: 0
tagged with: angularjs
has title: Angular Rails Templates just not working
has answer: http://stackoverflow.com/a/39492693
downvote count: 0
has comment: http://stackoverflow.com/comment/47554572
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47555869
has body: I am following thinker's tutorials (https://thinkster.io/angular-rails/) on using angular+rails. everything is fine until I try to use angular-rails-templates to put templates in javascript folder. I am new to rails so I don't know how this gem works. but I did follow the tutorial multiple times and still not working. To sum up, it seems that the 'templates' module injected into angular app is not compiling those templates into templateCache, or the application.js file is ignoring all the files with .html extension. here is my code on github: https://github.com/collapsarzhang/demo-projects/tree/master/flapper-news
score: 13
tagged with: ruby-on-rails
type: Question
answer count: 3

http://stackoverflow.com/comment/47779687
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29813340
has text: @Xan, In the Chrome developer tools there is a `chrome.devtools.network.onRequestFinished` event that fires when a request completes and has the content of the request.
score: 0

http://stackoverflow.com/a/29751152
upvote count: 2
has comment: http://stackoverflow.com/comment/47634420
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29751094
downvote count: 0
answers question: http://stackoverflow.com/q/29751094
has body: Navigating to a javascript: URI will display the result of the script. The assignment operator evaluates to the value assigned, so you end up navigating to that chunk of HTML directly. To prevent this, wrap your expression in the void() operator so that it will have no value.
type: Answer
score: 2

infinite-loop
tags question: http://stackoverflow.com/q/29732103
type: Tag
tag name: infinite-loop

http://stackoverflow.com/comment/47634911
comment on: http://stackoverflow.com/q/29750169
has text: I am not sure if what you are doing is correct. You are not modifying your model i.e person, hence the filter still applying on the original model. You can just iterate over the person object once more to confirm the values currently present in your model. All you need to do is update your model.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29754657
has answer: http://stackoverflow.com/a/29760003
tagged with: javascript
tagged with: livescript
accepted answer: http://stackoverflow.com/a/29760132
answer count: 2
downvote count: 0
favorite count: 0
has body: I'm probably misunderstanding how LiveScript works, but how should I import another js file in an .ls file and make it compile? For instance I'd like to access the DOM document like: el = document.getElementById 'app' and load mithril.js (which is in the same local dir): require! 'mithril.js' But when compiling like: lsc -c file.ls this currently tells me that it can't find 'document' or any other mithril specific variables (such as 'm').
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29760132
has title: Compile LiveScript that imports other js files
score: 1
upvote count: 1
type: Question
tagged with: mithril.js
possible better answer: http://stackoverflow.com/a/29760003

http://stackoverflow.com/comment/47709138
comment on: http://stackoverflow.com/a/29789808
score: 1
has text: You're missing the point. He's attempting to turn a function (in this case `fullName`) into a partial function. Not simply writing a generator.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29791404
has body: I want to hide div element located in bootstraps radio or checkbox container, this is how it look using jquery: I can't post image, so prev is here: http://prntscr.com/6wrk2m 1 2 8-bit pork belly Echo Park scenester 3 2 display:none doesn't work too ...
has comment: http://stackoverflow.com/comment/47711784
upvote count: 0
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47712478
has answer: http://stackoverflow.com/a/29791562
tagged with: css
answer count: 4
has comment: http://stackoverflow.com/comment/47711654
has answer: http://stackoverflow.com/a/29791665
tagged with: twitter-bootstrap
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29791572
has answer: http://stackoverflow.com/a/29791484
downvote count: 1
type: Question
has title: how to really hide HTML div element using css or js
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47711760

http://stackoverflow.com/comment/79542740
has text: Also https://stackoverflow.com/q/10539938/632951
comment on: http://stackoverflow.com/q/29759480
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/29830235
tagged with: asp.net-web-api
favorite count: 0
linked to: http://stackoverflow.com/q/3957932
has body: I would like to pass a Dictionary> to client using JavaScript. I did look at this post and I didn't understand exactly how to proceed. In case I'm doing something wrong I'll explain what I want to do. The dictionary contains the 'name' key of all worksheets in the Excel file, and the 'value' is the column value of the first row in that worksheet. The UI of the client should have two "drop list", the first will contain the key which is all the names of the worksheet in the Excel file. The second contain all the column value of the first row of the worksheets that will choose in the first drop list – which is actually a List as the value in the dictionary. So all the back end C# code is working fine. Now I need help in the front end JavaScript. How do I parse the data to a key value so I can do a "search" on the keys as the client chooses some "key" in the first drop list so I can get back the relevant values as a list? Thanx! var ajaxRequest = $.ajax({ type: "POST", url: "http://localhost:1894/api/Values", contentType: false, processData: false, data: data, success: function(dataTest) { } }); This is the JSON that I get back from the server: {"First":["Name","Link","User","Pass"],"Sec":["test01"]} How would I perform a search on this like in C#? I want to be able to do something like this: "dict.TryGetValue(key, out value); and the out value would return as an array of string or as a List.
has title: Pass Dictionary<String,List<String>> to java script
accepted answer: http://stackoverflow.com/a/29831184
tagged with: dictionary
has comment: http://stackoverflow.com/comment/47787396
score: -1
has comment: http://stackoverflow.com/comment/47788220
linked to: http://stackoverflow.com/q/9847564
downvote count: 1
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47788946
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47788785
has comment: http://stackoverflow.com/comment/47788071
tagged with: javascript
has answer: http://stackoverflow.com/a/29831184
has comment: http://stackoverflow.com/comment/47788822
has comment: http://stackoverflow.com/comment/47786959
has comment: http://stackoverflow.com/comment/47787358
linked to: http://stackoverflow.com/q/13885236
upvote count: 0
has comment: http://stackoverflow.com/comment/47787249
answer count: 1

http://stackoverflow.com/a/29749410
score: 1
answers question: http://stackoverflow.com/q/29749239
upvote count: 1
has body: There are tree options for spellchecking : Using a jQuery plugin Using the build-in spell checker of your browser with the spellcheckattribute Using a spell checker in a WYSIWYG editor
type: Answer
downvote count: 0

http://stackoverflow.com/a/29755214
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29755052
answers question: http://stackoverflow.com/q/29755052
has body: try to put complete URI like, &lt;link href="http://localhost/repo/dashboard.css" type="text/css" rel="stylesheet"&gt; path is case sensitive Dashboard.css is different then dashboard.css on linux and unix based systems.
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/47549767
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29706596
score: 0
has text: well if you wanted to hack the plugin, turn `"+e.x+"` to `"0"` everywhere you see it. That will force the X to stay at 0

http://stackoverflow.com/a/42039244
answers question: http://stackoverflow.com/q/29707568
has comment: http://stackoverflow.com/comment/125059404
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/82406728
downvote count: 3
score: -1
has comment: http://stackoverflow.com/comment/109739384
has body: I think, in ES6, something is Array-like if it is iterable (has a [Symbol.iterator] property).

http://stackoverflow.com/a/29753187
has comment: http://stackoverflow.com/comment/47639261
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47638523
has body: See the fiddle You'll have to use the onchange listener for the ..So, the should be as follows How are you? I'm doing great, thanks! I'm fine, but could be better. I feel absolutely terrible today. and the script that is used is as follows function myFunction() { var x = document.getElementById("mood").value; alert(x); } This works with pure Javascript. No need for jQuery. UPDATE As @LyeFish mentioned in his comments you can code it like the one in this fiddle.. Here the is as follows How are you? I'm doing great, thanks! I'm fine, but could be better. I feel absolutely terrible today. and the javascript for this will be function myFunction(val) { alert(val); } UPDATE 2 function myFunction(val) { alert(val); window.location.href = "http://google.co.in/"; }
type: Answer
has comment: http://stackoverflow.com/comment/47638814
answers question: http://stackoverflow.com/q/29752910
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47639322
accepted answer of: http://stackoverflow.com/q/29752910
has comment: http://stackoverflow.com/comment/47639049
has comment: http://stackoverflow.com/comment/47638900
has comment: http://stackoverflow.com/comment/47639154

http://stackoverflow.com/a/29728406
accepted answer of: http://stackoverflow.com/q/29694415
score: 0
answers question: http://stackoverflow.com/q/29694415
type: AcceptedAnswer
type: Answer
has body: The problem was that the HTTP server was responding with the incorrect MIME for the JS file. It would be interesting to know why this would cause this particular problem.

http://stackoverflow.com/a/29694380
has body: In your CSS you've #Main-button { width:200px; } but the JS is adding dynamic inline style based on content. So it's having style attribute. So in terms of CSS specificity their CSS beats you. You must use !important in your rule to avoid overriding of your CSS. #Main-button { width:200px !important; }
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29694004
accepted answer of: http://stackoverflow.com/q/29694004
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/47581805
type: Comment
type: QuestionComment
has text: @lemieuxster, thanks, but unfortunately I'm already using the exact same solution provided in the accepted answer. My case is a bit different - while the basic paste function is working well, there's an issue with pasting from Finder.
comment on: http://stackoverflow.com/q/29721562
score: 0

http://stackoverflow.com/comment/47812941
type: Comment
comment on: http://stackoverflow.com/a/29841786
has text: @varun Try the script tag I posted in my answer.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47811165
type: AnswerComment
comment on: http://stackoverflow.com/a/29841940
type: Comment
has text: @TrueBlueAussie Oke thanks, I will abort the search through code jungle and return empty handed :)
score: 0

http://stackoverflow.com/comment/47624567
type: AnswerComment
score: 0
type: Comment
has text: Actually I don't have much idea about your scenario. But if I may suggest something, I would say, you should spyOn all methods that you invoke from any method (in this case from `action`) and check whether that method was invoked on not from `action` - because that's what `action` method's responsibilities are. And then, whatever that called method does, should be separately checked into that called method's unit tests.
comment on: http://stackoverflow.com/a/29743119

http://stackoverflow.com/a/29777620
has body: Doesn't seem you've understood the difference between client and server. The simplest way for you to accomplish this is using an xmlhttprequest ( seeing that jquery isn't linked ). setInterval(function () { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { console.log('ages: ' + xmlhttp.responseText); } } xmlhttp.open("GET", "php_ajax_handler_url_here", true); xmlhttp.send(); }, 3000); Now all you need to do is replace "php_ajax_handler_url_here" with the your php file name. And in your php all you need to do is echo your result: $res = ''; while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) { $res += $row['age'].' '; } echo $res; So what does this all do? Well the client loads your html file with your js. Your js (3 seconds later) will call your php file that handles ajax responses. It will searchin your db for the information, and echo it all out as one big string. Update: Demo without XHMLHttpRequest() I created a little library for you. I have tested it, so it should work. So how to use the library? It's really simple. var a = age('ajax_url_handler_here').load(function(){ console.log('done loading'); }); Then you start it a.start(function(age){ //do something with age //The callback is called every 3 seconds and updates age with new age }); Then to stop a.stop(); (function () { var age = function (url) { if (!(this instanceof age)) { return new age(); } if(!(typeof url === 'undefined')){ this.url = url; } this.ages = []; this.counter = 0; this.setIntervalId = -1; } age.fn = age.prototype = { init: function () {} }; //load unchainable age.fn.load = function (callback) { var xmlhttp = new XMLHttpRequest(), _this = this; xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { console.log('ages: ' + xmlhttp.responseText); //creating an array _this.ages = xmlhttp.responseText.split(' '); if(!(typeof callback === 'undefined'…
answers question: http://stackoverflow.com/q/29777380
has comment: http://stackoverflow.com/comment/47712513
has comment: http://stackoverflow.com/comment/47685482
downvote count: 0
has comment: http://stackoverflow.com/comment/47721425
has comment: http://stackoverflow.com/comment/47710971
has comment: http://stackoverflow.com/comment/47685531
upvote count: 2
has comment: http://stackoverflow.com/comment/47725559
has comment: http://stackoverflow.com/comment/47721729
type: Answer
has comment: http://stackoverflow.com/comment/47711317
score: 2
has comment: http://stackoverflow.com/comment/47711372

http://stackoverflow.com/a/29800098
answers question: http://stackoverflow.com/q/29799301
type: Answer
downvote count: 0
score: 1
type: AcceptedAnswer
upvote count: 1
has body: When you are calling the mixin and you are passing in bar. This is an undefined variable. If you were to change it to. +foo +foo('bar') +foo +foo('bar') You will find that you would get the expected result.
accepted answer of: http://stackoverflow.com/q/29799301

http://stackoverflow.com/a/29774322
score: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29773511
downvote count: 0
answers question: http://stackoverflow.com/q/29773511
type: Answer
has comment: http://stackoverflow.com/comment/47679666
has body: Try $x("//div[@class='change_language_div']//span[2][@class='k-dropdown']").
upvote count: 1

http://stackoverflow.com/comment/102625638
score: 1
has text: I know this is old but I keep finding drag&drop solutions while I simply want this dragging feature (so no dropEvents). So this is exactly what I've been looking for... The only issue I have (which also happens with your Fiddle/Codepen) is when you move too fast and your mouse get's outside the div, dragging stops... How do you prevent this?
comment on: http://stackoverflow.com/a/29705279
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29822765
tagged with: angularjs
has title: Duplication in ng-repeat with filter applied
has comment: http://stackoverflow.com/comment/47771951
has body: I am trying to output an object with specific blood group. I am using a Filter for it. I am getting duplication error on this. I used chrome debugger and found out that its executing multiple times. Data is passed to filter in each iteration and filter do its complete work from scratch each time. This is my Filter method Filters.filter('bloodFilter', function() { var i, filtered = []; return function(data, bloodGroup) { if (!data) { data = GitHub.USERS; } if (!bloodGroup) { bloodGroup = 'O+' } for (i = 0; i &lt; data.length; i += 1) { var value = data[i]; if (value.blood === bloodGroup) { filtered.push(value); } } return filtered; } }); This is My Data GitHub.USERS = [ { fname: "Usman", lname: "Tahir", blood: "O+" }, { fname: "Ali", lname: "Hassan", blood: "B+" }, { fname: "Aqib", lname: "Javed", blood: "AB+" } ]; This is my Controller Controllers.controller('BodyController', function($scope) { $scope.users = GitHub.USERS; }); and this is my index code &lt;body ng-controller="BodyController"&gt; &lt;ul&gt; &lt;li ng-repeat="item in users | bloodFilter"&gt; &lt;b&gt;{{item.fname}}&lt;/b&gt; {{item.lname}} {{item.blood }} &lt;/li&gt; &lt;/ul&gt; &lt;/body&gt;
type: UnansweredQuestion
upvote count: 1
type: Question
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47771931
has comment: http://stackoverflow.com/comment/47772358
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29823209
favorite count: 0

http://stackoverflow.com/q/29833443
type: Question
tagged with: pebble-js
has comment: http://stackoverflow.com/comment/47794285
has answer: http://stackoverflow.com/a/29900303
answer count: 1
tagged with: javascript
has title: Accessing firebase using cloud pebble (Pebble.js)
linked to: http://stackoverflow.com/q/23419315
score: 0
type: UnansweredQuestion
tagged with: cloudpebble
has body: I've been trying to figure out a way to access data from firebase to display in a pebble app, using cloud pebble. I'm not quite sure how to do so as I'm relatively new to javascript and the pebble platform.
tagged with: firebase
has comment: http://stackoverflow.com/comment/47835464
tagged with: pebble-watch

http://stackoverflow.com/comment/47798013
score: 0
type: AnswerComment
has text: yes, easier to remove than a text node, just add empty string
type: Comment
comment on: http://stackoverflow.com/a/29835504

http://stackoverflow.com/comment/47539811
type: Comment
comment on: http://stackoverflow.com/q/29701935
type: QuestionComment
score: 7
has text: It's like sql-injections' heaven.

http://stackoverflow.com/comment/47724918
has text: No, I literally just set one `header` and it was for the mime type.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29797825
score: 0

http://stackoverflow.com/comment/47752056
type: Comment
type: QuestionComment
has text: @Careen It's already there.
comment on: http://stackoverflow.com/q/29811934
score: 0

http://stackoverflow.com/comment/47791557
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29832007
has text: For me it worked when I used the inspect element mode (in chrome) for that tab. Seems to be a problem with focusing (not sure)..
score: 0

http://stackoverflow.com/a/29756600
upvote count: 2
answers question: http://stackoverflow.com/q/29755409
downvote count: 0
type: Answer
score: 2
has body: assuming you have JQuery since you mentioned in tags, use this to achieve what you want. $(document).ready(function() { //hiding initially $('.scene').hide(); //Fade In and delay 2.5 sec then Fade Out $('.splashscreenlogo').hide().fadeIn(function() { $(this).delay(2500).fadeOut(function() { //Fade In and delay 3 sec then Fade Out $('.scene').fadeIn(function() { $(this).delay(3000).fadeOut(function() { //Redirect to any location alert('redirecting to page'); window.location = 'http://google.com'; }); }); }); }); });

http://stackoverflow.com/q/29777080
has title: How to load fancybox when the visitor comes from a referer?
type: UnansweredQuestion
tagged with: referer
type: Question
has body: Update: Now it popups from a specific referer =) Here is my fancybox code: if (document.referrer) { //if for the referrer referrerone = /referrersite.com/; if (referrerone.test(document.referrer)) { $(document).ready(function(){ $(".fancybox").fancybox({ }); $(".various").fancybox({ hideOnContentClick: true, showCloseButton: false, transitionOut : 'none', transitionIn : 'none', }).trigger('click'); $('.fancybox-media').fancybox({ openEffect : 'none', closeEffect : 'none', helpers : { media : {} } }); }); } } I want to add some static rules like the Popup plug-in for wordpress allows: -Fancybox will auto close after some seconds. -Not from an internal link: Shows the PopUp if the user did not arrive on this page via another page on your site.
score: 0
has answer: http://stackoverflow.com/a/29777168
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: fancybox
tagged with: rules

http://stackoverflow.com/comment/47706054
type: QuestionComment
has text: @user2688337 thanks for your suggestion. But i am not trying to close the window i am trying to be notified when its closing by user.
comment on: http://stackoverflow.com/q/29788306
score: 0
type: Comment

http://stackoverflow.com/a/29793265
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/47753225
answers question: http://stackoverflow.com/q/29787211
has body: If you go into your Ember Inspector, you can click on container and see the names of all the templates ember knows about. I did a quick test with a new ember-cli app, and it looks like in your case it will be: components/modal-picker so your code should change to: showPicker: (name, model)-> @render('components/modal-picker' outlet: 'modal-picker' EDIT 1: you want some template to render into the modal, so you'll want to use the modal-picker component, but like so: routes/application.js showPicker: (templateName, model)-> @render(templateName into: 'application' outlet: 'modal-picker' model: model templates/template-with-modal-button: Car Then, when you call the modal-picker in the template, the modal-picker template is where your modal code goes, probably something like: components/modal-link/template {{yield}} templates/some-cool-template {{#modal-picker}} some text, probably some form elements too {{/modal-picker}} EDIT 2: this is a good reference for modals in ember (though it is incomplete)
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47775188
type: Answer
accepted answer of: http://stackoverflow.com/q/29787211

http://stackoverflow.com/comment/47762217
has text: 3 item in a row. If `margin:2%` for each item, so the width of the item should be `33%-2%-2%` = `29%`. `Margin` is something like spacing.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29816572

http://stackoverflow.com/q/29827533
type: Question
has comment: http://stackoverflow.com/comment/47781609
tagged with: prompt
tagged with: javascript
has body: I have a game that runs off of alerts, confirms and prompts to run the interface. I realized that this is not the best way to do this, and since I have no idea how to use jQuery and I don't have the time to go through and edit the whole thing, I could just convert it. I found one script below that converts alerts for me, but how do I do the same thing for prompts and confirms? jQuery: window.alert = function(message) { $('&lt;div /&gt;').text(message).dialog({ modal:true, title:'Message', buttons: { 'OK':function(){ $(this).dialog('close'); } }, close:function(){ $(this).dialog('destroy').remove(); } }); }; HTML: &lt;div id="overrideAlert"&gt;&lt;/div&gt;
answer count: 2
tagged with: confirm
has title: Convert alert, prompt and confirm to UI Dialog
upvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47782493
has answer: http://stackoverflow.com/a/29827643
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/47781674
has answer: http://stackoverflow.com/a/29828385
tagged with: alert
downvote count: 3

http://stackoverflow.com/comment/47635228
has text: Hey, `position: fixed` works for me :) I am not sure if thats the way I should go if I want responsive design but I will stick with this for a while until I figure out a better way. Thanks, you can edit your answer and I will accept it. Btw, what browser did you use to test a tooltip on project page?
comment on: http://stackoverflow.com/a/29750160
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29811178
has answer: http://stackoverflow.com/a/29811245
has body: I have a WP website and I use a plugin called "Contact Form 7" to create a form. They provide shortcodes but I had to use the html in order to work for my client's website. The form uses ARIA and role="alter" to display error messages when the validation fails. I need to change the design of the boxes that failed to validate, but I cannot find a way to add the class. Here's the HTML: Name* Company Email* Inquiry* I want to add class "form_error" to the "li" elements when the validation fails. How can I achieve this?
tagged with: css
has comment: http://stackoverflow.com/comment/47751577
score: 1
tagged with: forms
upvote count: 1
type: Question
tagged with: javascript
has title: How to add a class to "li" element using role="alter" as triger
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29756189
has comment: http://stackoverflow.com/comment/47644974
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29755769
type: Answer
accepted answer of: http://stackoverflow.com/q/29755769
upvote count: 2
score: 2
has body: Your code was not working because: You were using input type=submit [so you were getting a refresh page kind of feel], which should be type=button or return false; in click handler You were calling function ActivateOverlay which was defined later than the call itself. Find your solution here in jsFiddle http://jsfiddle.net/4queag8m/

http://stackoverflow.com/q/29827886
answer count: 1
has answer: http://stackoverflow.com/a/29839577
accepted answer: http://stackoverflow.com/a/29839577
has comment: http://stackoverflow.com/comment/47783009
tagged with: knockout-mapping-plugin
type: AnsweredQuestion
tagged with: knockout.js
has comment: http://stackoverflow.com/comment/47788617
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/47788786
has body: I have one page with a first request where I recover all the necessary data for my page. This information is like this one: "A1": 8, "A2": 61, "A3": 585, "A4": null.........etc Where every value is the id of a specific select which one is loaded in knockout: * A1 * A2 * A3 * A4 These select have Dependency On Each Other in function of the choice you choose: root.A2List = ko.observableArray([]); root.A2ListFuncion = ko.computed(function(){ $.ajax({ url: RUTA_GLOBAL + "/api/A2/", dataType: 'json', async: true, type:'GET', data: { A1: root.Data().A1() }, success: function(data) { root.A2List(ko.mapping.fromJS(data)()); } }); }, root); root.A3List = ko.observableArray([]); root.A3ListFuncion = ko.computed(function(){ $.ajax({ url: RUTA_GLOBAL + "/api/A3/", dataType: 'json', async: true, type:'GET', data: { A1: root.Data().A1() A2: root.Data().A2() }, success: function(data) { root.A3List(ko.mapping.fromJS(data)()); } }); }, root); root.A4List = ko.observableArray([]); root.A4ListFuncion = ko.computed(function(){ $.ajax({ url: RUTA_GLOBAL + "/api/A4/", dataType: 'json', async: true, type:'GET', data: { A1: root.Data().A1() A2: root.Data().A2() A3: root.Data().A3() }, success: function(data) { root.A4List(ko.mapping.fromJS(data)()); } }); }, root); I got all the values ​​of every select Correctly , but I lose the correct value or id Which one Should be selected the first time the user make the request . I understand due to computed list of my select , feature I want but I need the first time When the pre -selected value in every select the first time the page is loaded. Any idea?
has title: Select with Dependency On Each Other and values preselected in knockout

http://stackoverflow.com/q/29799316
upvote count: 0
tagged with: event-loop
has comment: http://stackoverflow.com/comment/47726903
has body: Was the event loop evaluation model used in web browsers to control interaction between DOM events (and later the network) concomitantly developed by Brendan Eich with JavaScript? Or did it pre- or post-date JavaScript? Edit: I am specifically asking about the placement of the event-loop inside browsers. I am aware the event loop is a long-standing invention.
has comment: http://stackoverflow.com/comment/47727018
tagged with: javascript
answer count: 1
accepted answer: http://stackoverflow.com/a/29799654
favorite count: 0
downvote count: 2
score: -2
has comment: http://stackoverflow.com/comment/47726872
has title: Was the event loop model used in web browsers to control interaction between DOM events concomitantly developed by Brendan Eich with JavaScript?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29799654
tagged with: dom
type: Question

http://stackoverflow.com/comment/47846273
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29819991
has text: Thanks, but this is the old way to solve this kind of problem. Creating a client-side router function is more reliable.

http://stackoverflow.com/comment/47630794
type: AnswerComment
comment on: http://stackoverflow.com/a/29748213
type: Comment
score: 2
has text: Now this won't remove "someClass" if it's at the end of the string. And it'll still remove "troublesomeClass ".

http://stackoverflow.com/q/29773007
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47676432
linked to: http://stackoverflow.com/q/19012495
has comment: http://stackoverflow.com/comment/47676735
linked to: http://stackoverflow.com/q/2905867
has comment: http://stackoverflow.com/comment/47676685
has comment: http://stackoverflow.com/comment/47676602
type: Question
has comment: http://stackoverflow.com/comment/47676415
has title: scroll to a certain ID in my page jquery
has answer: http://stackoverflow.com/a/29773120
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29773258
tagged with: javascript
tagged with: jquery
has body: I have a certain page which holds a iframe and gets submitted and then a new message is shown within the iframe, this is a lot shorter then the iframe before so it doesn't go to the point I want it on the page. Now I want to scroll to the new id using jQuery meaning the user can read it from the top and not have to scroll. My id of my iframe is "#iframe-container". if (window.location.pathname.split('/')[1] == "Test.aspx") { // jquery here. } thanks

http://stackoverflow.com/q/29707334
has answer: http://stackoverflow.com/a/29707391
accepted answer: http://stackoverflow.com/a/29707391
type: Question
answer count: 2
tagged with: javascript
has title: javascript jump to timestamp video button
score: 0
possible better answer: http://stackoverflow.com/a/29707385
tagged with: timestamp
tagged with: video
type: AnsweredQuestion
has body: I'd like to create either a button or a link that would jump to specific timestamp. So far I succeded with button I got: Go to 5 Sec The problem is that if I'd like to create lets say 5 timestamps I'd have to create 5 buttons (and that's ok) plus 5 functions, each jumping to given timestamp (which is bad). Is there a way to put a variable value after vid.currentTime= that would read a value set in button? So it would be something like Go to 5 Sec Go to 10 Sec Go to 20 Sec
has answer: http://stackoverflow.com/a/29707385

http://stackoverflow.com/comment/47720558
has text: Fantastic, you're a star! You always think it's going to be something complicated when you start using new frameworks, that you miss the obvious.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29795838
type: AnswerComment

http://stackoverflow.com/a/29830192
score: 6
type: Answer
has body: My guess on the limited information provided is you've not called the getValue() function. &lt;?php function getValue() { echo json_encode('84'); } getValue(); ?&gt;
has comment: http://stackoverflow.com/comment/47787911
has comment: http://stackoverflow.com/comment/47790302
upvote count: 6
answers question: http://stackoverflow.com/q/29830121
has comment: http://stackoverflow.com/comment/47822180
downvote count: 0

http://stackoverflow.com/comment/47587614
has text: `dataType : 'html'` should do the trick.
comment on: http://stackoverflow.com/q/29726770
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29762717
answers question: http://stackoverflow.com/q/29761669
score: 0
type: Answer
has body: You're getting dangerously close to what is known as 'callback hell'. You'll want to avoid that if you can. Since I'm not 100% sure why you need to pass around so many callback functions, you can achieve what you're looking for by doing the following: function increment(number, callback, callback2) { console.log('Incrementing number ' + number + ' by 1'); number++; callback(number, increment, callback2); } function verify(number, callback, callback2) { if (number &lt; 2) { callback(number, verify, callback2); } else { callback2(); } } var number = 0; increment(number, verify, function () { console.log('Hello world!'); }); You'll notice that I renamed some functions and excluded your a() function since it did nothing but execute the callback function passed to it. Unless that function is to serve another purpose, it is useless. You also don't need to create an anonymous function every time you are passing a callback. To pass a previously defined function as a parameter or callback, simply pass the function name without the (). If you are passing an undefined function as a callback, you will need to create the anonymous function which is what is being done with the console.log() callback. Here's a jsfiddle. You can open your console log and see what it's doing. jsfiddle Please also be sure to read up on callback hell and how to design your code in a way that it can be avoided. Call back hell

http://stackoverflow.com/q/29722175
has answer: http://stackoverflow.com/a/29722223
has answer: http://stackoverflow.com/a/29722252
has answer: http://stackoverflow.com/a/29722284
tagged with: javascript
has answer: http://stackoverflow.com/a/29722313
possible better answer: http://stackoverflow.com/a/29722313
answer count: 4
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29722252
has title: Running a loop in the background in Angular
score: 0
has body: Not certain what options I have, I want to run a loop within a controller that runs in the background and steps every n'th milli seconds, it will just change the colour on a button, want it to go from green to orange and then back using ng-style. What is a sensible approaches to running a loop in the background, for obvious reasons I would like to avoid locking up the whole page just to have a button changing colour.
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47585759

http://stackoverflow.com/comment/47541905
score: 0
type: Comment
type: QuestionComment
has text: @wahwahwah That is correct.
comment on: http://stackoverflow.com/q/29702583

http://stackoverflow.com/q/29767548
accepted answer: http://stackoverflow.com/a/29770604
score: 1
has comment: http://stackoverflow.com/comment/47696314
type: Question
has comment: http://stackoverflow.com/comment/47699809
has comment: http://stackoverflow.com/comment/47699669
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/q
linked to: http://stackoverflow.com/q/25446353
tagged with: yield
has body: I'm using io.js, a fork of node that already supports ES6 generators without the need for special flags, and Kris Kowal's Q library. What I'm making is a game script, where almost every single action is async, and I'm using Q.spawn to keep things sane. This is the current state of my code, and it works: var q = require('q'); var tw = require('./lib/typewriter'); q.spawn(function*() { tw.clear(); yield tw.type({d:100}, "August 3, 9:47 AM", {w:500}); yield tw.type("District Court"); yield tw.type("Defendant Lobby No. 2", {w:2000}); yield tw.breakLine(); yield tw.type({who:"Phoenix"}, {dh:true}, {d:30}, "(Boy am I nervous!)", {w:1500}); yield tw.breakLine().then(function(){ throw new Error("BOOM!"); }); yield tw.type({who:"Mia"}, {dh:true}, {d:40}, "Wright!", {w:1250}); yield tw.type({di:true}, {d:50}, "Did you", {w:1000}, {d:0}, " ", {d:30}, "turn off the lights?", {w:1000}); yield tw.type({di:true}, {d:400}, ". . .", {w:1000}); yield tw.type({di:true}, {d:40}, "I can't see a thing!", {w:1000}); yield tw.breakLine(); process.exit(); }); However, adding yield to every single line sucks. I'm almost making the jump towards Luvit to escape from this madness, but I'm giving JavaScript its chance. Under normal circumstances, I can omit most yielding, like this: var q = require('q'); var tw = require('./lib/typewriter'); q.spawn(function*() { tw.clear(); tw.type({d:100}, "August 3, 9:47 AM", {w:500}); tw.type("District Court"); tw.type("Defendant Lobby No. 2", {w:2000}); tw.breakLine(); tw.type({who:"Phoenix"}, {dh:true}, {d:30}, "(Boy am I nervous!)", {w:1500}); tw.breakLine(); tw.type({who:"Mia"}, {dh:true}, {d:40}, "Wright!", {w:1250}); tw.type({di:true}, {d:50}, "Did you", {w:1000}, {d:0}, " ", {d:30}, "turn off the lights?", {w:1000}); tw.type({di:true}, {d:400}, ". . .", {w:1000}); tw.type({di:true}, {d:40}, "I can't see a thing!", {w:1000}); yield tw.breakLine(); process.exit(); }); Only one yield is still there, just to be sure process.exit() won't execute too early.…
has comment: http://stackoverflow.com/comment/47671065
has title: Avoiding "yield" repetition in coroutine-like JavaScript function
has answer: http://stackoverflow.com/a/29770604
favorite count: 0
tagged with: io.js
upvote count: 1
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/a/29792238
has comment: http://stackoverflow.com/comment/47752314
upvote count: 2
answers question: http://stackoverflow.com/q/29792136
type: Answer
has comment: http://stackoverflow.com/comment/47713179
accepted answer of: http://stackoverflow.com/q/29792136
has comment: http://stackoverflow.com/comment/47781554
score: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47713170
has comment: http://stackoverflow.com/comment/47713620
has body: Here is a regex to get the &lt; symbol inside the single quotation marks: (?=[^']*'[^']*$)&lt; See demo here. Explanation: The positive lookahead checks if the &lt; symbol is followed by 1 ' and there are no other single quotation marks. So, this means, the regex will only work well if there is 1 group of words inside single quotation marks. To account for any other cases, this should be fine-tuned. You can replace the &lt;s with var str = '&lt;span class="k"&gt;function&lt;/span&gt; () { &lt;span class="k"&gt;this&lt;/span&gt;.test = \'&lt;p&gt;&lt;span&gt;test&lt;/span&gt;&lt;/p&gt;\'; }'; var result = str.replace(/(?=[^']*'[^']*$)&lt;/g, '&amp;lt;'); And later all &gt;s: result = result.replace(/(?=[^']*'[^']*$)&gt;/g, '&amp;gt;'); Snippet (you will see &lt; and &gt; symbols): var str = '&lt;span class="k"&gt;function&lt;/span&gt; () { &lt;span class="k"&gt;this&lt;/span&gt;.test = \'&lt;p&gt;&lt;span&gt;test&lt;/span&gt;&lt;/p&gt;\'; }'; var result = str.replace(/(?=[^']*'[^']*$)&lt;/g, '&amp;lt;'); document.getElementById("res").innerHTML = result.replace(/(?=[^']*'[^']*$)&gt;/g, '&amp;gt;'); &lt;div id="res"/&gt;
has comment: http://stackoverflow.com/comment/47758161
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47715000

http://stackoverflow.com/a/29783424
type: Answer
has comment: http://stackoverflow.com/comment/47697128
downvote count: 0
score: 6
upvote count: 6
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29783287
answers question: http://stackoverflow.com/q/29783287
has body: Perhaps Array.filter() method is what you are looking for. $scope.data[0].users = $scope.data[0].users.filter(function(val) { return (val.videoGame[0].isPlayer === true); });
has comment: http://stackoverflow.com/comment/47697320

http://stackoverflow.com/q/29839441
tagged with: javascript
has comment: http://stackoverflow.com/comment/47805361
has body: my string is {"message":"My name is "Joe"!"} I need to escape the double quotes in --> "Joe" so that it becomes: {"message":"My name is \"Joe\"!"} I can easily do an str_replace routine on the double quotes, but that will also mess with the legit quotes in the string. I could do some splitting and parsing and all that jazz but I was wondering if there was an easier way to do this? Perhaps regex?
upvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47805577
has comment: http://stackoverflow.com/comment/47805383
has comment: http://stackoverflow.com/comment/47805269
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/47805625
downvote count: 3
has title: What is the efficient way to target and replace or espace quotes within a quoted string?
has answer: http://stackoverflow.com/a/29839521
type: Question
has comment: http://stackoverflow.com/comment/47805260

http://stackoverflow.com/comment/47741611
score: 0
type: Comment
has text: Sorry about that, but how to generate KEYS and IV from normal strings? @ArtjomB.
comment on: http://stackoverflow.com/a/29766052
type: AnswerComment

http://stackoverflow.com/q/29829523
has comment: http://stackoverflow.com/comment/47786907
has title: Dgrid Locked column row height not equal in IE
has body: I use Dojo-1.10.4 with Dgrid-0.4.0. If the content of a column wraps to a second line, the entire layout of the grid breaks. It works fine in Chrome, but not in IE. I added css to sort of fix it but once a string is longer than the set row height it breaks. You can test this with the default dgrid component: http://dgrid.io/js/dgrid/test/complex_column.html
has comment: http://stackoverflow.com/comment/47785730
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: dojo
tagged with: dgrid
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: javascript

http://stackoverflow.com/a/29736789
upvote count: 1
answers question: http://stackoverflow.com/q/29714898
downvote count: 0
type: Answer
has body: Like LSletty said, if you want to know when it is called use the handler from .load() itself: $("#MainContent").load("path/content.html", function(){ // Do stuff when load is called ... }); More info here: jQuery load event To take action after completion I would use the .done() handler. Use it in the following way: $("#MainContent").load("path/content.html").done(function(){ // Do stuff when load is done ... }); From jQuery docs: Add handlers to be called when the Deferred object is resolved. More info here: deferred.done() jQuery
score: 1

http://stackoverflow.com/a/29787259
downvote count: 0
answers question: http://stackoverflow.com/q/29787241
upvote count: 2
has body: .each() is having 2 arguments, 1 the index of the current element, 2 the dom element reference of current element. $(".status").each(function (i, e) { $(e).data('options') }); Also you need access the jQuery wrapper to the element to call any jQuery methods on it by passing it to jQuery
type: Answer
score: 2

adobe
tags question: http://stackoverflow.com/q/29696993
tags question: http://stackoverflow.com/q/29755518
type: Tag
tag name: adobe

http://stackoverflow.com/comment/47676049
comment on: http://stackoverflow.com/q/29771245
has text: That sounds like a better way of doing it. :) I'll try that. Is there any good reason for creating views dynamically, though?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29734957
accepted answer of: http://stackoverflow.com/q/29731448
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/29731448
type: Answer
has body: I've managed to solve this with the following code: ** ** How are you today, ? How are you today, ? ** **

http://stackoverflow.com/a/29700767
has comment: http://stackoverflow.com/comment/47540527
has comment: http://stackoverflow.com/comment/47537836
score: 3
has comment: http://stackoverflow.com/comment/47538011
has comment: http://stackoverflow.com/comment/47540847
upvote count: 3
has comment: http://stackoverflow.com/comment/47538469
downvote count: 0
has comment: http://stackoverflow.com/comment/47538239
has comment: http://stackoverflow.com/comment/47540969
has comment: http://stackoverflow.com/comment/47537594
has comment: http://stackoverflow.com/comment/47538123
answers question: http://stackoverflow.com/q/29700565
has body: Check this out: for (q = 0; q &lt; 10; q++) { var select = document.getElementById(names[i]); //q should be i here... In fact you don't need the loop at all: var EachName= textFileData.split("\n"); var select = document.getElementById(names[i]); for (var j = 0, len = EachName.length; j &lt; len; j++) { var option = document.createElement('option'); option.text = option.value = EachName[j]; select.add(option, 0); } The problem is your adding the names to all selects every iteration of your outer loop the one with i. Try this update: for(i = 0; i &lt; 10; i++){ var names = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"] //window.alert(names[i]) document.write('&lt;tr&gt;'); document.write('&lt;td&gt;'); document.write('Enter name '+ names[i]); document.write('&lt;/td&gt;'); document.write('&lt;td&gt;'); document.write('&lt;select name=' + i + ' id=' + names[i] + '&gt;&lt;/select&gt;'); var textFile = "/names.txt"; var closure = function(counter, namesArray) { return function(textFileData) { var EachName= textFileData.split("\n"); var select = document.getElementById("" + namesArray[counter]); for (var j = 0, len = EachName.length; j &lt; len; j++) { var option = document.createElement('option'); option.text = option.value = EachName[j]; select.add(option, 0); } }; } jQuery.get(textFile, closure(i, names)); document.write('&lt;/td&gt;'); document.write('&lt;/tr&gt;'); }; I got the code from here
has comment: http://stackoverflow.com/comment/47538685
type: Answer
has comment: http://stackoverflow.com/comment/47539634
has comment: http://stackoverflow.com/comment/47537736

http://stackoverflow.com/q/29751887
has answer: http://stackoverflow.com/a/29755155
tagged with: checkbox
has comment: http://stackoverflow.com/comment/47636909
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has comment: http://stackoverflow.com/comment/47641204
has body: I am trying to achieve two things: Bind an array to a list of checkboxes (just a string array), and Limit the number of selections the user can make to a number between 1 and the number of available items less 1. I can get (2) to work until the user clicks the last item, at which point it loses track and the items remain selected. The interactive code is up here: http://codepen.io/adamcodegarden/pen/bdbQqe (forked from a similar example) My HTML/Angular code: &lt;p ng-repeat="item in allOptions" class="item" id="{{item}}"&gt; {{item}} &lt;input type="checkbox" ng-change="sync(bool, item)" ng-model="bool" ng-checked="isChecked(item)"&gt; Click this to sync this item with the target array. {{item}} Selected: {{bool}} and the JS: var myApp = angular.module("myApp", []); var maxItems = 1; myApp.controller('myController', function($scope) { $scope.isChecked = function(item){ var match = false; for(var i=0 ; i &lt; $scope.data.length; i++) { if($scope.data[i] === item) { match = true; } } return match; }; $scope.allOptions = [ 'one', 'two', 'three', 'four' ]; $scope.data = [ ]; $scope.sync = function(bool, item){ if (bool) { // add item $scope.data.push(item); // if we have gone over maxItems: if ($scope.data.length &gt; maxItems) { //remove oldest item $scope.data.splice(0,1); } } else { // remove item for (var i=0 ; i &lt; $scope.data.length; i++) { if ($scope.data[i] === item){ $scope.data.splice(i,1); } } } }; });
has comment: http://stackoverflow.com/comment/47637821
tagged with: javascript
has title: Limit checkbox selections and bind to an array in AngularJS
upvote count: 1
accepted answer: http://stackoverflow.com/a/29755155
tagged with: arrays
answer count: 1
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/q/29810209
tagged with: javascript
tagged with: kendo-ui
upvote count: 1
downvote count: 0
favorite count: 0
has body: I'm trying to find a solution to count invalid rows in Kendo Grid and show it footer. I tried with adding a display property in Messages but it's basically modifying right side footer message such as "1 - 6 of 6 items" Enclosed screen shot. I'm a quite a new in Kendo. Can anyone suggest me how I achieve that goal ? Here is how grid is initialized in DataTable.cshtml function initializeDetails(e) { var detailRow = e.detailRow; var datatableDetailsDataSource = new kendo.data.DataSource({ autoSync: true, batch: false, error: datatableDeletedErrorHandler, pageSize: 5, schema: { data: "Data", errors: "Error", model: { "Id": "ID", "RevisionDate": { "type": "date" }, "UserName": { "type": "string" }, "NewData": { "type": "string" } }, total: "Total" }, serverFiltering: true, serverPaging: true, serverSorting: true, sort: { field: "Audit_Date", dir: "desc" }, transport: { parameterMap: function(options) { options = refactorKendoDataSourceOptions(options); return $.extend({}, options, { ReportId: $("#reports").val(), AdviserId: $("#advisers").val(), FundId: $("#funds").val(), RecordId: e.data.ID, TableName: conceptSettings.tablename, TimeZoneOffset: getTimeZoneOffset() }); }, read: { cache: false, dataType: "json", type: "GET", url: "/RequestAction/ReadDetails" } }, type: "json" }); detailRow.find(".datatable_details").kendoGrid({ altRowTemplate: kendo.template($("#datatableDetailsRowTemplateAlt").html()), autoBind: true, columns: @{ ViewContext.Writer.Write(JsonConvert.SerializeObject(datatableDetailsColumns)); }, dataSource: datatableDetailsDataSource, pageable: { input: true, messages: { itemsPerPage: " items per page", }, pageSizes: [5, 10], refresh: true }, resizable: true, rowTemplate: kendo.template($("#datatableDetailsRowTemplate").html()), scrollable: true, sortable: true }); } &lt;/script&gt;
type: UnansweredQuestion
tagged with: kendo-asp.net-mvc
answer count: 0
score: 1
type: Question
has title: Add invalid Record count in Kendo Grid
tagged with: kendo-grid

http://stackoverflow.com/comment/47780298
comment on: http://stackoverflow.com/q/29826771
has text: @ScottKaye That is why I apologized and voted to reopen.
score: 1
type: QuestionComment
type: Comment

querystringparameter
tags question: http://stackoverflow.com/q/29834985
type: Tag
tag name: querystringparameter

http://stackoverflow.com/q/29729711
has comment: http://stackoverflow.com/comment/47592912
has title: Checkbox value not being set
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48140587
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/29729726
type: Question
score: -2
answer count: 1
has body: In my database there's a bool fiedd called IsAvailable.In my edit function i wanted to fill that checkbox is IsAvailable or not but in here always checkbox not filled. ($("#chkcomp").prop('checked') == msg._prodlng[0].IsAvailable); but msg._prodlng[0].IsAvailable // this one returns true or false correctly according to database value
tagged with: http://stackoverflow.com/tag/json
downvote count: 3
upvote count: 1
accepted answer: http://stackoverflow.com/a/29729726
tagged with: c#
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/47562964
comment on: http://stackoverflow.com/q/29713777
score: 0
type: Comment
type: QuestionComment
has text: I don't want to add carousel

http://stackoverflow.com/comment/47794139
type: Comment
score: 1
type: QuestionComment
has text: In the future, it can help to narrow down your if statement to see which part of the expression is failing. By doing that you would see that `$(this).attr('checked')` is returning false even when it was checked and been able to do a quick search to see what the proper way to get if a checkbox is checked... thereby saving yourself the time of asking a question.
comment on: http://stackoverflow.com/q/29833231

http://stackoverflow.com/a/29813097
upvote count: 1
score: 1
has body: Origin When you need to rotate something in canvas it will always rotate around origin, or center for the grid if you like where the x and y axis crosses. You may find my answer here useful as well By default the origin is in the top left corner at (0, 0) in the bitmap. So in order to rotate content around a (x,y) point the origin must first be translated to that point, then rotated and finally (and usually) translated back. Now things can be drawn in the normal order and they will all be drawn rotated relative to that rotation point: ctx.translate(rotateCenterX, rotateCenterY); ctx.rotate(angleInRadians); ctx.translate(-rotateCenterX, -rotateCenterY); Absolute angles and positions Sometimes it's easier to keep track if an absolute angle is used rather than using an angle that you accumulate over time. translate(), transform(), rotate() etc. are accumulative methods; they add to the previous transform. We can set absolute transforms using setTransform() (the last two arguments are for translation): ctx.setTransform(1, 0, 0, 1, rotateCenterX, rotateCenterY); // absolute ctx.rotate(absoluteAngleInRadians); ctx.translate(-rotateCenterX, -rotateCenterY); The rotateCenterX/Y will represent the position of the ship which is drawn untransformed. Also here absolute transforms can be a better choice as you can do the rotation using absolute angles, draw background, reset transformations and then draw in the ship at rotateCenterX/Y: ctx.setTransform(1, 0, 0, 1, rotateCenterX, rotateCenterY); ctx.rotate(absoluteAngleInRadians); ctx.translate(-rotateCenterX, -rotateCenterY); // update scene/background etc. ctx.setTransform(1, 0, 0, 1, 0, 0); // reset transforms ctx.drawImage(ship, rotateCenterX, rotateCenterY); (Depending on orders of things you could replace the first line here with just translate() as the transforms are reset later, see demo for example). This allows you to move the ship around without worrying about current transforms, when a rotation is needed use the ship'…
downvote count: 0
answers question: http://stackoverflow.com/q/29807957
type: Answer

ecmascript-harmony
tag name: ecmascript-harmony
type: Tag
tags question: http://stackoverflow.com/q/29759480
tags question: http://stackoverflow.com/q/29838052

http://stackoverflow.com/q/29841718
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47811400
linked to: http://stackoverflow.com/q/7629286
type: Question
has title: Angular ui bootstrap TimePicker shows different time in different browsers
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47819516
tagged with: angular-bootstrap
has body: I am using angularJS ui-bootstrap timepicker on client-side and ASP MVC Web API on server-side: &lt;timepicker ng-model="formData.NotificationSendingTime"&gt;&lt;/timepicker&gt; Client gets NotificationSendingTime from server in format like this: 2015-04-23T20:00:00. But different browsers show different time: Internet Explorer shows 20:00 (right), Chrome shows 23:00 (wrong). As I understand, Chrome changes the time according to my local timezone. So I've written angularJS filter to convert date to iso format: filter('toIso', [function() { return function(dateTime) { var localDate = new Date(dateTime); var localTime = localDate.getTime(); var localOffset = localDate.getTimezoneOffset() * 60000; var isoDate = new Date(localTime + localOffset); return isoDate.toISOString(); }; }]); And use it in my controller (setting of $scope.formData is not shown in code below): value.NotificationSendingTime = $filter('toIso')(value.NotificationSendingTime); After applying the filter Internet Explorer shows 17:00 (wrong), Chrome shows 20:00 (right). So my question is what do I do to achieve the same value in timepickers in different browsers? Thanks.
favorite count: 0
score: 2
tagged with: timepicker
tagged with: angularjs
answer count: 0
upvote count: 2

http://stackoverflow.com/a/29691237
has comment: http://stackoverflow.com/comment/47519246
has body: Your controller should like this,Try this "use strict"; define(['app-config', 'loginService'], function (app) { app.register.controller('LoginController', ['$scope', '$location', 'loginService', function (sc, loc, loginService) { console.log("LoginController calling"); sc.login = function () { console.log("Email Address = " + sc.EmailAddress); console.log("Password = " + sc.Password); }; }]); }); and loginService.js should be like this define(['app-config'], function (app) { app.register.factory('loginService', ['$resource', function ($resource) { return $resource( 'jbossews-1.0/login', {}, { login: { method: 'POST', cache: false, isArray: false } }); }]); }); Note: This is something which you are missing, Let me try to explain here in more detail.(Considering you have a basic knowledge of require and angularAMD) Controllers and services in the application rely on RequireJS to access the object representing the application’s module and then access the register property to register a controller script with AngularJS. This type of registration is required since using the standard angular.module(“ModuleName”).controller() code won’t work properly with dynamically loaded controller scripts. RequireJS’s define() function to get to the app object and then uses it to register the controller. The app.register.controller() function points to AngularJS’s $controllerProvider.register() function behind the scenes with app.js. All of the controllers,services in the application follow this pattern.
has comment: http://stackoverflow.com/comment/47520788
score: 1
upvote count: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29689324
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47520380
answers question: http://stackoverflow.com/q/29689324
has comment: http://stackoverflow.com/comment/47519792
has comment: http://stackoverflow.com/comment/47520230
type: Answer
has comment: http://stackoverflow.com/comment/47519433
has comment: http://stackoverflow.com/comment/47519928

http://stackoverflow.com/comment/47711511
comment on: http://stackoverflow.com/q/29787224
score: 1
has text: To answer to "why": this is because of the [TS inference](http://www.typescriptlang.org/Handbook#type-inference). The type of the variable `obj` is implicitly inferred from the empty object.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29716607
has title: Margin calculation with D3 JavaScript
tagged with: margin
has answer: http://stackoverflow.com/a/29717026
tagged with: d3.js
score: 1
upvote count: 1
type: Question
tagged with: javascript
tagged with: layout
answer count: 1
downvote count: 0
favorite count: 0
has body: I'm drawing couple of graphics on a webpage. Let's say I have 4 graphics (A-B-C-D). I would like to lay them out as follows: A B C D But currently they appear like this: A B C D I set the margin, width, and height for A as follows: var margin = {top: 20, right: 20, bottom: 30, left: 40}, width = 500 - margin.left - margin.right, height = 270 - margin.top - margin.bottom; Any ideas on how to set these (or some other) properties for B, C and D so that they appear as intended? Thanks!
type: UnansweredQuestion

http://stackoverflow.com/q/29743926
has comment: http://stackoverflow.com/comment/47621727
has answer: http://stackoverflow.com/a/29747075
has comment: http://stackoverflow.com/comment/47626162
favorite count: 0
has comment: http://stackoverflow.com/comment/47620633
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29744887
score: 1
has answer: http://stackoverflow.com/a/29744887
has comment: http://stackoverflow.com/comment/47626716
accepted answer: http://stackoverflow.com/a/29747075
has body: I want to change .style.backgroundColor of all &lt;time&gt; elements within some &lt;div id="div"&gt;. I resolved it like this: var times = div.getElementsByTagName("time"); for (var i = 0; i &lt; times.length; i++) { times[i].style.backgroundColor = "#d00"; } Is it possible to optimize the code so it will take as less variables as possible? Or maybe there is a way to do this with a single line? P.S.: Using no JQuery;
downvote count: 1
type: Question
tagged with: for-loop
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/47627180
has comment: http://stackoverflow.com/comment/47621384
has title: Changing CSS-property of all elements in array
answer count: 2
has comment: http://stackoverflow.com/comment/47628147
has comment: http://stackoverflow.com/comment/47627631

http://stackoverflow.com/comment/47711116
type: Comment
has text: @Veeru, So it is supposed to be the accepted answer, right?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29790757

http://stackoverflow.com/q/29692770
type: Question
score: 0
has title: Pause a Videojs on Slick carousel
answer count: 1
tagged with: video.js
has answer: http://stackoverflow.com/a/29700796
tagged with: slick.js
type: UnansweredQuestion
has body: 2I need some help, I'm using several videojs html players on slick slider sycing carousel. My problem is when I click on other carousel thumbnail to go to the other video the first video keeps playing. I'd like to pause any video on click any thumbnail. My html is: To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video I find this js: _V_("example_video_1").ready(function(){ var player = this; var pausebutton = document.getElementById("thumb"); pausebutton.onclick = function(event) { player.pause(); }; }); With this function I can pause only the first video, I'd like some help for a function when I click on single thumbnail I could pause any playing video and it should to work for all thumbnails too. Someone could help me?
tagged with: javascript

http://stackoverflow.com/a/29742465
accepted answer of: http://stackoverflow.com/q/29742350
type: Answer
answers question: http://stackoverflow.com/q/29742350
downvote count: 3
has body: You just have to set the canvas element to position: absolute or even position: relative, while having canvas as z-index: 1 and span as z-index: 2. Try this:- (0,0)
score: -2
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/47781220
has text: Nothing I do seems to work. Is there a very simple javascript I can try on a new page to see if it works at all? I can create a blank php page in the website.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29825420
type: AnswerComment

http://stackoverflow.com/q/29747183
has comment: http://stackoverflow.com/comment/47626713
type: Question
tagged with: javascript
tagged with: jquery
has title: Switch Content back and forth using Jquery
has answer: http://stackoverflow.com/a/29747864
answer count: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/29747756
favorite count: 0
upvote count: 1
has answer: http://stackoverflow.com/a/29747756
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29747864
has body: I have an app where when the user clicks on a table, assigned to btnAlternativeService, the content from this table swaps with another one. The jQuery I have used involves creating two variables for each piece of content in the table, one to act as a JS selector and another to retain the original content. It looks like this: // Switch between the two services btnAlternativeService.on('click', function(){ // Set original recommended text variables var serviceSubTextOriginal = $('.js-second-step .subtext-top').text(); var serviceProductTitleOriginal = $('.js-second-step .product-title').text(); var serviceMileageOriginal = $('.js-miles').text(); var serviceRecommendationOriginal = $('.js-second-step .full-rec').text(); // Set recommended text selector variables var serviceSubText = $('.js-second-step .subtext-top'); var serviceProductTitle = $('.js-second-step .product-title'); var serviceMileage = $('.js-miles'); var serviceRecommendation = $('.js-second-step .full-rec'); // Set original alternative variables var alternativeProductTitleOriginal = $('.js-alternative h3').text(); var alterativeMilageOriginal = $('.js-miles-alternative').text(); var alternativeSubTextOriginal = $('.js-alternative .alternative-subtext').text(); // Set alternative selector variables var alternativeProductTitle = $('.js-alternative h3'); var alterativeMilage = $('.js-miles-alternative'); var alternativeSubText = $('.js-alternative .alternative-subtext'); // Swap everything around serviceProductTitle.text(alternativeProductTitleOriginal); serviceMileage.text(alterativeMilageOriginal); serviceRecommendation.text(alternativeSubTextOriginal); alternativeSubText.text(serviceRecommendationOriginal); alternativeProductTitle.text(serviceProductTitleOriginal); alterativeMilage.text(serviceMileageOriginal); }); This seems very long winded - is there a better way for me to swap the content around?
score: 1
has comment: http://stackoverflow.com/comment/47627627

http://stackoverflow.com/a/29712365
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29712322
has body: You are creating many #circle-green divs that don't get removed, and you are calling $("#circle-green").click. Change the #circle-green to a class, not and id. Also, change the click handler and the CSS. Fixed! $(document).ready(function() { var puntuacion = 0; FadeDiv(); function FadeDiv() { var posx = Math.floor(Math.random() * 300); var posy = Math.floor(Math.random() * 300); $newdiv = $("&lt;div class='circle-green'&gt;&lt;/div&gt;").css({ 'left': posx + 'px', 'top': posy + 'px' }).click(function() { $(this).remove(); puntuacion += 300; $("#Points").text(puntuacion); }); $newdiv.appendTo('body').fadeIn(1000).delay(1000).fadeOut(1000, function() { FadeDiv(); }); } $("#Points").text(puntuacion); setTimeout(FadeDiv, 1000); setTimeout(FadeDiv, 500); setTimeout(FadeDiv, 100); }); body { background-color: #000; color: #FFF; font-family: Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 14px; } .circle-green { width: 50px; height: 50px; position: absolute; display: none; background-color: #00ff00; -webkit-border-radius: 25px; -moz-border-radius: 25px; border-radius: 25px; cursor: pointer; box-shadow: 1px 1px 5px 5px #00ff00; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="Points"&gt;&lt;/div&gt;
type: AcceptedAnswer
score: 4
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/29712322

http://stackoverflow.com/a/29730931
has comment: http://stackoverflow.com/comment/52560093
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29729993
has body: Variables declared with var have a file scope, and are indeed inside a closure like you mentioned. However, if you declare new variables without the var keyword, they are accessible throughout your project (given you load files in the right order), as Meteor declares these variables outside the closure. In your case the solution is to declare your form functions without var, or maybe better declare a new object without var and put them as methods in there: FormHelpers = {}; FormHelpers.ucwords = function(str) { return str.split(" ").map(function(i){return i[0].toUpperCase() + i.substring(1)}).join(" "); }; ... You can then use these helpers in both you add and edit tenplates, or anywhere else you need them. More info on namespacing in the Meteor docs.
accepted answer of: http://stackoverflow.com/q/29729993
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/47791636
type: QuestionComment
comment on: http://stackoverflow.com/q/29832438
score: 0
has text: @dystroy: ah yes, I guess it can be read that way...
type: Comment

http://stackoverflow.com/a/29820566
has comment: http://stackoverflow.com/comment/47767671
has body: //If this page has no POST data, then don't go any further if (!$_POST) { //Die with a "bad request" header http_response_code(400); die(); } It's worth adding that this kind of script gets abused by spam bots all the time, especially by replaying POST data. You might want to consider some additional security if this is being deployed. For starters, other than just checking for POST data - you should check each field you require is there and in a valid form.
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/47767742
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29820364

http://stackoverflow.com/comment/47649826
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29735746
has text: Yeah it is for SEO purpose. But it only works with phantomjs (or smth like that) because it doesn't render on server.
score: 1

http://stackoverflow.com/comment/47850890
type: Comment
comment on: http://stackoverflow.com/a/29815539
has text: True, it can also be done with one. As I said, it's a quick go and it's not perfect. Two loops are maybe easier to understand.
score: 0
type: AnswerComment

http://stackoverflow.com/a/29749625
answers question: http://stackoverflow.com/q/29749476
accepted answer of: http://stackoverflow.com/q/29749476
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has body: You have to use the document get element id and post like below var chart = new google.visualization.PieChart(document.getElementById('container')) Make sure you have the same id (container) html div tag, otherwise this will lead error
type: Answer

http://stackoverflow.com/q/29797533
has answer: http://stackoverflow.com/a/30165262
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/30165262
has comment: http://stackoverflow.com/comment/47724030
has comment: http://stackoverflow.com/comment/47723359
has comment: http://stackoverflow.com/comment/47723819
score: 2
has comment: http://stackoverflow.com/comment/47725095
has comment: http://stackoverflow.com/comment/47723625
has comment: http://stackoverflow.com/comment/47806574
has title: Show MODAL in onsen ui while data is fetching in angularjs
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47895861
has comment: http://stackoverflow.com/comment/47750336
has body: I am trying to fetch data from server. Since its fetching i want to show a modal till its not loaded completely. Here is what i am using. Please wait. Closing in 2 seconds. {{PostCategory.title}} There is how my modal looks like in angularjs. var module = angular.module('app', ['onsen']); module.controller('directoryControl', function($scope, $http) { ons.ready(function() { //console.log($scope.username + ", " + $scope.password); modal.show(); var responsePromise = $http.get("http://www.mywebsitepadth.com/api/get_category_index/"); responsePromise.success(function(data, status, headers, config) { modal.hide(); }); responsePromise.error(function(data, status, headers, config) { alert("ajax didnt work"); }); }); }); May i know why this is not displaying the modal when i am doing it modal.show();? Thank you!
has comment: http://stackoverflow.com/comment/47801685
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/47724091
has comment: http://stackoverflow.com/comment/47767186
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: onsen-ui

http://stackoverflow.com/q/29727981
type: Question
has answer: http://stackoverflow.com/a/29728036
has body: I want to get date Jan/1/2015. So, I tried this : new Date(2015,1,1) However,I got Jan/31/2015 or Feb/1/2015. What does it take for me to get date: Jan/1/2015? Chrome FireFox InternetExplorer
tagged with: date
has comment: http://stackoverflow.com/comment/47589736
has answer: http://stackoverflow.com/a/29728032
answer count: 2
accepted answer: http://stackoverflow.com/a/29728032
tagged with: javascript
has title: Date API with JavaScript doesn't work
score: 0
possible better answer: http://stackoverflow.com/a/29728036
has comment: http://stackoverflow.com/comment/47589779
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47589823

http://stackoverflow.com/a/29725715
upvote count: 3
has comment: http://stackoverflow.com/comment/47586555
answers question: http://stackoverflow.com/q/29725157
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29725157
has body: You're experiencing a race condition between when the "hide" event happens and when the "show" event happens. Per the documentation the "hide/show" events actually return to the caller before the "hidden/shown" events fire. http://getbootstrap.com/javascript/#tooltips Scroll down to the "Methods" section under tooltips ...Returns to the caller before the tooltip has actually been hidden... ...Returns to the caller before the tooltip has actually been shown... I'm not suggesting the code below is a solution (though, it might be good enough?), but an explanation as to what you're running into. Specifically the timeout value of 250ms will slow it down enough such that it works as you're intending. var toolTipData = { placement: 'right', title: 'Checkmark checked', trigger: "manual" }; $('#check').tooltip(toolTipData); $(document).on('change', '#check', function () { $('#check').tooltip("hide"); if (document.getElementById("check").checked) { setTimeout(function() { $('#check').tooltip("show"); }, 250); } }); Hope this helps.
type: Answer
has comment: http://stackoverflow.com/comment/47586400
score: 3

http://stackoverflow.com/a/29791576
has body: Yes, String is instanceof Object, because String is a function, and functions are objects in JavaScript. The prototype property of a function is not that function's prototype. It's the object that will be assigned as the prototype of objects created via new with that function. (The name may be a bit unfortunate, though in several years I haven't come up with a better one.) The prototype of String is Function.prototype (because String is a function), which we can see using ES5's getPrototypeOf: Object.getPrototypeOf(String) === Function.prototype // true We can also use ES6's __proto__ property (specified for browser-based engines only, but I suspect non-browser engines will support it anyway): String.__proto__ === Function.prototype // true So that tells us String is a function; but how do we know it's an Object? Because functions are objects, so: String.__proto__.__proto__ === Object.prototype // true Object.getPrototypeOf(Object.getPrototypeOf(String)) === Object.prototype // true So your .prototype.prototype would work with .__proto__.__proto__: snippet.log(String.__proto__ === Function.prototype); // true snippet.log(String.__proto__.__proto__ === Object.prototype); // true &lt;!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 --&gt; &lt;script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"&gt;&lt;/script&gt; Or here's a multi-level hierarchy example using a non-function object: // NOTE! Snippet requires a modern browser that has the ES6 __proto__ // property! Current Chrome, Firefox, and IE all do. function GrandParent() { } function Parent() { GrandParent.call(this); } Parent.prototype = Object.create(GrandParent.prototype); Parent.prototype.constructor = Parent; function Child() { Parent.call(this); } Child.prototype = Object.create(Parent.prototype); Child.prototype.constructor = Child; var c = new Child(); snippet.log(c.__proto__ === Child.prototype); // true snippet.log(c.__proto__.__proto__ ==…
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29791405
score: 3
upvote count: 3

http://stackoverflow.com/a/29803269
has body: Because you use global variable status, which appeared to be a property of the global object window, this property could only be string. The window.status. You could just change to an other variable name, but much better, avoid using global variable. (function(){ var status = str2bool('false'); console.log(typeof status); }());
accepted answer of: http://stackoverflow.com/q/29803136
has comment: http://stackoverflow.com/comment/47734523
upvote count: 1
has comment: http://stackoverflow.com/comment/47734448
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29803136
score: 1

http://stackoverflow.com/comment/47670830
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29764934
has text: Change `var url ="javascript:mobileApp.openLoginMenu()";` to this one `var url ="javascript:alert("My message")";` and see if it shows alert in your app.
score: 0

http://stackoverflow.com/a/34182403
downvote count: 0
answers question: http://stackoverflow.com/q/29786105
score: 4
has body: So this ticket is kind of old, but as Peng Lin so eloquently stated above, the selected answer is inadequate for most programmers since it requires too much manual adjustment. It's not maintainable. Grunt has a way of specifying where the extension dot is in file names. By default, it's set to the first one which effectively changes the file names on output. The property is called extDot. You can read about it Here if you want. If you set it to last, it will preserve your file names and your original example will work. Example: cssmin: { min: { files: [{ expand: true, cwd: 'css', src: [ 'selectize.default.css', 'selectize.pagination.css', 'selectize.patch.css', '!*.min.css' ], dest: 'release/css', ext: '.min.css', extDot: 'last' // Extensions in filenames begin after the last dot }] } } Hope this helps someone in the future.
type: Answer
upvote count: 4

http://stackoverflow.com/q/29708542
favorite count: 0
has answer: http://stackoverflow.com/a/29781710
downvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29709778
score: 2
tagged with: row
type: Question
upvote count: 2
tagged with: html-table
has title: Add row by clicking on button
tagged with: function
has comment: http://stackoverflow.com/comment/47553607
tagged with: javascript
has body: I have table with two buttons to add different rows and I tried this code but it doesn't work. This is my script code: function addRow(tableID) { var table = document.getElementById(tableID); var rowCount = table.rows.length; var row = table.insertRow(rowCount); var colCount = table.rows[1].cells.length; var cell1 = row.insertCell(0); cell1.innerHTML = rowCount; for (var i = 0; i &lt; colCount; i++) { var newcell = row.insertCell(i + 1); newcell.innerHTML = table.rows[1].cells[i + 1].innerHTML; } } &lt;table&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td width="550"&gt; &lt;p&gt;&lt;strong&gt;Content&lt;/strong&gt; &lt;/p&gt; &lt;/td&gt; &lt;td width="50"&gt; &lt;p align="center"&gt;&lt;strong&gt;CLO&lt;/strong&gt; &lt;/p&gt; &lt;/td&gt; &lt;td width="50"&gt; &lt;p align="center"&gt;&lt;strong&gt;PLO&lt;/strong&gt; &lt;/p&gt; &lt;/td&gt; &lt;td width="60"&gt; &lt;p align="center"&gt;&lt;strong&gt;Weeks&lt;/strong&gt; &lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr id="module"&gt; &lt;td colspan="4" style="width:710; background-color:#A7B8D4; color:white;"&gt; &lt;p class="modulenum"&gt;&lt;strong align="center"&gt;MODULE 1&lt;/strong&gt; &lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="550"&gt; &lt;p&gt; &lt;input type="text" value="" maxlength="255" class="textborder" class="table" id="dataTable2" /&gt; &lt;/p&gt; &lt;/td&gt; &lt;td width="50"&gt; &lt;p align="center"&gt; &lt;input type="text" value="" maxlength="255" class="textbordersmall" /&gt; &lt;/p&gt; &lt;/td&gt; &lt;td width="50"&gt; &lt;p align="center"&gt; &lt;input type="text" value="" maxlength="255" class="textbordersmall" /&gt; &lt;/p&gt; &lt;/td&gt; &lt;td width="60"&gt; &lt;p align="center"&gt; &lt;input type="text" value="" maxlength="255" class="textbordersmall" /&gt; &lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr style="border:0px;"&gt; &lt;p&gt; &lt;input type="button" value="Add row" onclick="addRow1('dataTable2')"&gt;&amp;nbsp; &amp;nbsp; &lt;input type="button" value="Add Module" onclick="a…
answer count: 3
has answer: http://stackoverflow.com/a/29710163
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/54591197
downvote count: 2
answers question: http://stackoverflow.com/q/29721610
score: -2
upvote count: 0
type: Answer
has body: let arry=[1,2,4,........etc];//large number of array while (arry.length) { //I splice the arry 0,10...so you can change the limit as your //wish(note your server should be handle your limit Promise.all(arry.splice(0, 10).map(async (eachArryElement) =&gt; { let res = await yourAsyncMethod(eachArryElement); })) } function yourAsyncMethod(data){ return new Promise((resolve, reject) =&gt; { //your logic resolve('your output') }) }

http://stackoverflow.com/comment/47665772
comment on: http://stackoverflow.com/a/29767446
has text: You have unnecessary white spaces in your code pls use above code with example URL.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47777499
comment on: http://stackoverflow.com/a/29823718
has text: @TrueBlueAussie - checking
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29712197
score: -1
favorite count: 0
has comment: http://stackoverflow.com/comment/47560371
type: Question
answer count: 2
tagged with: sockets
tagged with: node.js
has comment: http://stackoverflow.com/comment/47560001
has title: How to run server.js written in js with Node.js
has answer: http://stackoverflow.com/a/29712235
has answer: http://stackoverflow.com/a/29712894
downvote count: 1
upvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47560294
has body: i have a file with nodejs language which i found in the internet, i want to run it, but i don't know how to run it. i tryed to run with cmd command: node server.js but it not work. file server.js var port = process.env.PORT || 3000; server = require('http').createServer(), io = require('socket.io').listen(server), users = {}, socks = {}; function Uid() { this.id = ++Uid.lastid; } Uid.lastid = 0; //Handle users io.sockets.on('connection', function (socket) { // Event received by new user socket.on('join', function (recv) { if (!recv.user) { socket.emit('custom_error', { message: 'User not found or invalid' }); return; } // The user already exists if (users[recv.user]) { socket.emit('custom_error', { message: 'The user '+ recv.user +' already exists' }); return; } // If there is users online, send the list of them if (Object.keys(users).length &gt; 0) socket.emit('chat', JSON.stringify( { 'action': 'usrlist', 'user': users } )); // Set new uid uid = new Uid(); socket.user = recv.user; // Add the new data user users[socket.user] = {'uid': Uid.lastid, 'user': socket.user, 'name': recv.name, 'status': 'online'} socks[socket.user] = {'socket': socket} // Send new user is connected to everyone socket.broadcast.emit('chat', JSON.stringify( {'action': 'newuser', 'user': users[socket.user]} )); }); // Event received when user want change his status socket.on('user_status', function (recv) { users[socket.user].status = recv.status; socket.broadcast.emit('chat', JSON.stringify( {'action': 'user_status', 'user': users[socket.user]} )); }); // Event received when user is typing socket.on('user_typing', function (recv) { var id = socks[recv.user].socket.id; io.sockets.socket(id).emit('chat', JSON.stringify( {'action': 'user_typing', 'data': users[socket.user]} )); }); // Event received when user send message to another socket.on('message', function (recv) { var id = socks[recv.user].socket.id; var msg = {'msg': recv.msg, 'user': users[socket.user]}; io.sockets.socket(id).emit('cha…

http://stackoverflow.com/q/29764926
downvote count: 0
score: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29765317
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has title: How to get dropdown values in php
has answer: http://stackoverflow.com/a/29766023
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47661714
has answer: http://stackoverflow.com/a/29765344
has body: Hi everyone I'm working on PHP appliaction where I populate a dropbox based on another drop box selection using javascript- everything works fine but the second dropbox values is numbers, my question is How can I set the values of the second dropbox to be text not numbers which is I get. I have the following code for dropdown box: Select a Food Group Fruit Vegetables Meat Dairy Grains Here is the function that populates the second dropdown function selectFoods(foodGroup) { // Get a reference to the foods select. var foodsSelect = document.getElementById("foods"); // Create a two dimension array containing foods for each group. var foods = [["Banana","Grapes","Oranges","Watermelon"], ["Brocolli", "Califlower","Spinach","Tomatoes"], ["Beef", "Chicken", "Turkey", "Tuna"], ["Cheese", "Ice Cream", "Milk", "Yogurt"], ["Bread", "Pasta", "Rice", "Quinoa"]]; if ((foodGroup >= 0) && (foodGroup <= foods.length)) { foodsSelect.options.length = 0; // Index was in range, so access our array and create options. for (var i = 0; i < foods[foodGroup - 1].length; i++) { foodsSelect.options[foodsSelect.options.length] = new Option(foods[foodGroup - 1][i], i); } } } I tried to access the value in php $val = $_POST['selectedFoodItem']; I get the index Thank you!
tagged with: javascript
answer count: 3

http://stackoverflow.com/a/29786418
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29786101
answers question: http://stackoverflow.com/q/29786101
type: AcceptedAnswer
downvote count: 0
has body: Your new window will not get blocked by the browser if window.open was called as a result of user action. Example: // Find the button you want to bind to var button = document.getElementById('test'); // Add a click event listener button.addEventListener('click', function(){ window.open('http://www.google.com'); }); All major browsers will allow the above to open a new window / tab. JSFiddle
type: Answer

http://stackoverflow.com/comment/47618245
comment on: http://stackoverflow.com/q/29742605
has text: have a look at this if it helps http://stackoverflow.com/questions/7853904/how-to-detect-when-a-youtube-video-finishes-playing
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47733718
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29802832
has text: the problem is that it wont load the stylesheets ))

http://stackoverflow.com/comment/47751313
comment on: http://stackoverflow.com/a/29810927
type: AnswerComment
score: 0
type: Comment
has text: Correct - if you pass `$scope.form`, then you can modify the *contents* of that object, and they will update. See [this answer](http://stackoverflow.com/a/13104500/1299394).

http://stackoverflow.com/comment/47747151
type: QuestionComment
score: 0
has text: Why not use basic string methods? I'm sure JS has a reasonable set of those.
comment on: http://stackoverflow.com/q/29809409
type: Comment

http://stackoverflow.com/q/29796728
has title: Highstock.js diagram is working strange?
has comment: http://stackoverflow.com/comment/47766668
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47773689
answer count: 0
has comment: http://stackoverflow.com/comment/47721483
type: Question
has comment: http://stackoverflow.com/comment/47813475
has body: The problem is that if I turn off TB1S1 off before I turn TB2S1 and TB3S1 the dynamic line changes its shape, very strange. But if I let TB1S1 be on, and turn off TB2S1 and TB3S1, then the dynamic line stays perfect. To see the problem, just turn off TB1S1, and look at the lines TB2S1 and TB3S1 changing its shape. How can I solve this problem that the diagram holds its shape without being attached to TB1S1..? [JSFiddle - Demo][1] [1]: http://jsfiddle.net/2jccfson/1/ Kind regards, Dler H.
tagged with: highcharts
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/47660202
has text: you got it yes, but from here comes up another problem. i can't put an id on my anchor tag, i reference that id to show my div overlay which has an id to be passed on showOverlay() function
score: 0
comment on: http://stackoverflow.com/a/29764219
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/47572626
has text: That's true, but because your callback doesn't *know* what will happen, it has to be written as if it were called asynchronously.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29718779

http://stackoverflow.com/a/29738139
downvote count: 0
type: Answer
score: 3
has body: The reason it does not fire is, media events( those specifically belonging to audio or video like play, pause, timeupdate, etc) do not get bubbled. you can find the explanation for that in the answer to this question. So using their solution, I captured the ended event, and this would allow setting triggers for dynamically added audio elements. $.createEventCapturing(['ended']); // add all the triggers for which you like to catch. $('body').on('ended', 'audio', onEnded); // now this would work. JSFiddle demo the code for event capturing( taken from the other SO answer): $.createEventCapturing = (function () { var special = $.event.special; return function (names) { if (!document.addEventListener) { return; } if (typeof names == 'string') { names = [names]; } $.each(names, function (i, name) { var handler = function (e) { e = $.event.fix(e); return $.event.dispatch.call(this, e); }; special[name] = special[name] || {}; if (special[name].setup || special[name].teardown) { return; } $.extend(special[name], { setup: function () { this.addEventListener(name, handler, true); }, teardown: function () { this.removeEventListener(name, handler, true); } }); }); }; })();
upvote count: 3
answers question: http://stackoverflow.com/q/29728327

http://stackoverflow.com/comment/47705489
score: 1
has text: You can use xpath based node selection. `document.evaluate` in Chrome & FF and `document.selectNodes` in IE
comment on: http://stackoverflow.com/q/29787964
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29711800
score: 0
type: Answer
has body: Is this what you want? https://jsfiddle.net/a4nmto6t/1/ Just get the value of the first textarea and change the value of the second to that: $(document).ready(function(){ $("#submit").click(function(){ var postCrudoVal = $("#postcrudo").val(); $("#posthecho").val(postCrudoVal); console.log("OK!"); }); }); Neither postHecho nor postCrudo are declared (by you**), and even if they were, assigning one of them to the other does not do what you want. You have to assign the value of the first textarea to the value of the second textarea using (in this case) jQuery selectors, because they ARE the ones referencing the DOM elements (the textareas). ** Elements that have an id are set as global 'variables' by default, but you shouldn't use them; it is instead suggested that you either use the DOM API to find elements or use jQuery (which uses the DOM API behind the scenes).
accepted answer of: http://stackoverflow.com/q/29711725
answers question: http://stackoverflow.com/q/29711725
has comment: http://stackoverflow.com/comment/47607264
type: AcceptedAnswer

http://stackoverflow.com/q/29738737
tagged with: throws
tagged with: php
type: Question
has title: Can't compile shared extension on PHP
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/c
has comment: http://stackoverflow.com/comment/47611690
has answer: http://stackoverflow.com/a/42934953
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/55443699
score: 0
has body: I have a file with PHP extension I've been maintaining for a while now and it has everything in one directory. Then I moved some of the files into a new directory wb/, and added the sources appropriately, but compiling the extension throws this error: Creating library Release_TS\php5ts.lib and object Release_TS\php5ts.exp wb_winsys.obj : error LNK2019: unresolved external symbol _wbError referenced in function _wbInit wb_bitmap.obj : error LNK2001: unresolved external symbol _wbError wb_control.obj : error LNK2001: unresolved external symbol _wbError wb_control_toolbar.obj : error LNK2001: unresolved external symbol _wbError wb_generic.obj : error LNK2001: unresolved external symbol _wbError wb_winsys.obj : error LNK2019: unresolved external symbol _wbMalloc referenced i n function _wbInit wb_control_toolbar.obj : error LNK2001: unresolved external symbol _wbMalloc wb_font.obj : error LNK2001: unresolved external symbol _wbMalloc wb_generic.obj : error LNK2001: unresolved external symbol _wbMalloc wb_window.obj : error LNK2001: unresolved external symbol _wbMalloc wb_bitmap.obj : error LNK2001: unresolved external symbol _wbMalloc wb_control.obj : error LNK2001: unresolved external symbol _wbMalloc wb_control_calendar.obj : error LNK2001: unresolved external symbol _wbMalloc wb_control_menu.obj : error LNK2001: unresolved external symbol _wbMalloc wb_window.obj : error LNK2019: unresolved external symbol _wbFree referenced in function _wbSetTimer wb_winsys.obj : error LNK2001: unresolved external symbol _wbFree wb_bitmap.obj : error LNK2001: unresolved external symbol _wbFree wb_control.obj : error LNK2001: unresolved external symbol _wbFree wb_font.obj : error LNK2001: unresolved external symbol _wbFree wb_generic.obj : error LNK2001: unresolved external symbol _wbFree wb_bitmap.obj : error LNK2019: unresolved external symbol _WideChar2Utf8 referen ced in function _ReadBitmap wb_winsys.obj : error LNK2001: unresolved external symbol _WideChar2Utf8 wb_control.obj : …
accepted answer: http://stackoverflow.com/a/42934953

http://stackoverflow.com/q/29802078
has comment: http://stackoverflow.com/comment/47732862
tagged with: forms
has comment: http://stackoverflow.com/comment/47733968
type: Question
has comment: http://stackoverflow.com/comment/47732366
has answer: http://stackoverflow.com/a/29802140
answer count: 2
has comment: http://stackoverflow.com/comment/47732815
has comment: http://stackoverflow.com/comment/47733012
tagged with: javascript
has comment: http://stackoverflow.com/comment/47733112
has title: Increase serial number in php posting
has comment: http://stackoverflow.com/comment/47732735
has comment: http://stackoverflow.com/comment/47733308
has body: I am using one HTML form to fetch the data in php code. Below is the PHP code: for ($i = 0; $i &lt; count($sl); $i++) { $email_body .= "SL:" . $sl[$i] . "NAME:" . $name[$i] . "EMAIL:" . $mail[$i] . "\n"; } This gives the output in he following format: SL NAME EMAIL 0 Peter peterxyz@xyz.com 1 Purker purker234@xyz.com But what I need it in following format: SL NAME EMAIL 1 Peter peterxyz@xyz.com 2 Purker purker234@xyz.com I can rectify the code by writing "$i=1;" but it is not the correct solution, as this is code again being used in javascript. Hence, please advise me how can I make SL as 1 when $i =0. Kindly help me please?
type: UnansweredQuestion
score: 0
has answer: http://stackoverflow.com/a/29802198
tagged with: php

http://stackoverflow.com/comment/47590064
type: QuestionComment
score: 1
has text: Use array for basket, and push the fruits there.
comment on: http://stackoverflow.com/q/29728169
type: Comment

http://stackoverflow.com/comment/47615435
comment on: http://stackoverflow.com/a/29740946
score: 0
type: AnswerComment
has text: Just don't do anything on click, you will get redirected by the href. I just put an alert for demonstration purposes (Remove -> alert('clicked!!');).
type: Comment

http://stackoverflow.com/q/29718170
tagged with: factory
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: error-handling
type: Question
accepted answer: http://stackoverflow.com/a/29718215
tagged with: javascript
upvote count: 1
has answer: http://stackoverflow.com/a/29718215
answer count: 1
favorite count: 0
tagged with: angularjs
has title: Angular Error and Timeout Factory
has body: Throughout my project I have a piece of code that performs CRUD with Parse.com via the REST API. I would like to insert a function in the error handler that is a universal (project wide) error function. I have considered a factory / service or possibly passing something via $rootScope. Secondly I would like to wrap all my api calls in a timeout function so that if there is no response in a certain time then I can notify the user with a useful notification. ParseFactory.provider('Programme').getAll().success(function(data){ $scope.programmes = data.results; }).error(function(response){ $ionicPopup.alert({ title: 'Unable to load - Please check your connection ' }); }); Any examples of how to best achieve this would be greatly received. === EDIT - adding ParseFactory Code === .factory('ParseFactory',['$http','PARSE_CREDENTIALS',function($http,PARSE_CREDENTIALS){ var baseUrl = 'https://api.parse.com/1/classes/'; return { provider:function(type) { var userQuery = {'userId': Parse.User.current().id}; return { getAll:function(){ return $http.get(getUrl(type),getUserParams()); }, get:function(id){ return $http.get(getUrl(type)+id,getParams()); }, create:function(data){ return $http.post(getUrl(type),data,getParams()); }, edit:function(id,data){ return $http.put(getUrl(type)+id,data,getParams()); }, delete:function(id){ return $http.delete(getUrl(type)+id,getParams()); } } function getUrl(type) { return baseUrl+type; } function getParams() { return { headers:{ 'X-Parse-Application-Id': PARSE_CREDENTIALS.APP_ID, 'X-Parse-REST-API-Key':PARSE_CREDENTIALS.REST_API_KEY, 'X-Parse-Session-Token': PARSE_CREDENTIALS.PARSE_SESSION, 'Content-Type':'application/json' } } } } } }]) Many thanks

http://stackoverflow.com/comment/47771793
comment on: http://stackoverflow.com/q/29821946
has text: Added a second (really simple) answer based on my suggested alternative. Hope that matches you needs better :)
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47601037
comment on: http://stackoverflow.com/a/29732075
score: 0
type: AnswerComment
type: Comment
has text: The code works perfectly with IE aich Firefox but not with Chrome.

http://stackoverflow.com/comment/136681730
has text: @pilchard: yes.. Ascending: arr.sort((a, b) => (a ?? Infinity) - (b ?? Infinity)); Descending: arr.sort((a, b) => (b ?? -Infinity) - (a ?? -Infinity)); Note that this will only work in ES2020 and later as nullish coalescing operator is very new
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/58748962
type: Comment

http://stackoverflow.com/q/29737502
score: -1
has comment: http://stackoverflow.com/comment/47608254
type: Question
has comment: http://stackoverflow.com/comment/47608159
has title: Why isn't my span being displayed? Simple password matching
answer count: 2
has comment: http://stackoverflow.com/comment/47608169
upvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47608248
has comment: http://stackoverflow.com/comment/47608228
possible better answer: http://stackoverflow.com/a/29737569
has comment: http://stackoverflow.com/comment/47608179
has body: So I have a simple HTML form for users to enter username and passwords and I'm validating that the passwords match using JavaScript. However for some reason I can't get the span to display whether or not the passwords match. window.onload = init; function init(){ function passMatch(){ console.log("Matching words."); var pwd1 = document.getElementById("pwd1").value; var pwd2 = document.getElementById("pwd2").value; var output1 = document.getElementById("pwd1Hint"); var output2 = document.getElementById("pwd2Hint"); if (pwd1 === pwd2){ output1.innerHTML = "Yes!"; console.log(output1.textContent); } else { output1.innerHTML = "No!"; console.log(output1.textContent); } } // event handlers document.getElementById("pwd1").onchange = passMatch; document.getElementById("pwd2").onchange = passMatch; } And here is the relevant HTML... Password: Password is too short (must be at least 8 characters) Repeat Password: Passwords don't match
has answer: http://stackoverflow.com/a/29737569
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29737615
has comment: http://stackoverflow.com/comment/47608280
has comment: http://stackoverflow.com/comment/47608284
has comment: http://stackoverflow.com/comment/47608250
downvote count: 1
has comment: http://stackoverflow.com/comment/47608275
has comment: http://stackoverflow.com/comment/47608283
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29737615

http://stackoverflow.com/comment/47628222
score: 0
type: AnswerComment
type: Comment
has text: Do you have list of hotels in this XML file OR you have one XML file for 1 hotel??
comment on: http://stackoverflow.com/a/29744891

http://stackoverflow.com/comment/47706870
type: Comment
comment on: http://stackoverflow.com/a/29788496
has text: but my url is looking like this http://localhost:14605/Home.aspx?id=mELirpUhRYksFj7k8%2fXBcQ%3d%3d#activityfeeds------activityfeeds is my div
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47725896
type: Comment
comment on: http://stackoverflow.com/a/29798420
has text: have dare to face then comment here.....without giving Explanation You have no right to do this.....
score: 0
type: AnswerComment

http://stackoverflow.com/a/29758054
answers question: http://stackoverflow.com/q/29757869
type: Answer
score: 1
upvote count: 1
downvote count: 0
has body: Using the javascript Date object. If you want to format it MM/DD/YYYY, I suggest you going that way: function formatDate(d) { var dd = d.getDate() if ( dd &lt; 10 ) dd = '0' + dd var mm = d.getMonth()+1 if ( mm &lt; 10 ) mm = '0' + mm var yy = d.getFullYear() % 100 if ( yy &lt; 10 ) yy = '0' + yy return mm+'/'+dd+'/'+yy } Then, you can go that way: var now = new Date(); formattedDate = formatDate(now); $('#dteStartDate').val(formattedDate); Here is a good ressource for Date in javascript: http://javascript.info/tutorial/datetime-functions

http://stackoverflow.com/a/29725844
has body: It may be because the page is allowed to resize the lengths of divs. A few suggestions that might work is: Quick Fixes: Hiding your footer until the person is at the bottom of the screen Making your footer a static size and maybe even making the footer position final. Adding a fixed size container around your objects as mentioned in a previous comment. This way atleast it won;t bother the footer in any way. Fix without changing footer: It is obviously a load problem when the button itself is pressed. Because as I understand from your code when the button is pressed and then you are adding this new content to your page right before using the slide effect. I would suggest you preload the content when first opening the page and then just use the .slide() when the button is pressed.
score: -1
downvote count: 1
answers question: http://stackoverflow.com/q/29725696
type: Answer
upvote count: 0

http://stackoverflow.com/q/29762033
type: Question
linked to: http://stackoverflow.com/q/3509756
accepted answer: http://stackoverflow.com/a/29763328
tagged with: javascript
linked to: http://stackoverflow.com/q/8970880
has body: I'm able to send socket.io connections from my extension to my server, but I cannot hear emits from my server inside my extension. I've found conflicting answers regarding this question: Opening a Socket.IO connection in a google chrome extension says this can't be done; and Cross-domain connection in Socket.IO says it can. Is there any special configuration I must change in order to accept emits from my socket server? EDIT: (Note: I'm using AngularJS, but it shouldn't be relevant to this question) socketFactory.js: myApp.factory('socketFactory', function($rootScope) { var socket = io.connect('//dev.mydomain.com', {'path': '/api/socket'}); return socket; } inject.js: var packetData = { 'some':'data', 'roomId':'123abc' }; socketFactory.emit('room:join', packetData); ... socketFactory.on('room:update', function (data) { console.log('Received data from socket server'); console.log(data) } socket.js (server-side): socket.on('room:join', function ( data ) { // Setting socketId to detect disconnect data.user.socketId = socket.id; socket.join( data.roomId, function() { // Some code ... io.sockets.to(data.roomId).emit('room:update', {'some':'data', 'roomId': '123abc'}); } }); That's the basic setup of my connection. This system works perfectly when I launch the app in non-extension mode (we're making an extension to emulate our webapp), but when in the extension, room:update is never triggered. EDIT 2: We did a console.log on the socket object (generated on connect) in socket.js. Inside the headers, it appears the host is dev.mydomain.com, while the referrer is www.othersite.com. Could this be the problem? What does "host" refer to? Host of the socket server, or host of the socket listener? In the latter case, it would make sense it's not reaching www.othersite.com over which we have the extension running. EDIT 3: ...And it started working out of nowhere. Must be a race condition somewhere. Closing the question as no longer relevant.
tagged with: google-chrome-extension
answer count: 1
has title: Listen for socket.io connection inside chrome extension
tagged with: sockets
has answer: http://stackoverflow.com/a/29763328
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47656491
score: 0
tagged with: socket.io

http://stackoverflow.com/a/29745245
has comment: http://stackoverflow.com/comment/47623342
downvote count: 0
has body: The CSS version and icon name you're using seem to be outdated. If you get the latest CSS version (or via CDN) You'll see that the class name of the icon you wish to use has changed from: ion-ios7-minus-outline to: ion-ios-minus-outline
has comment: http://stackoverflow.com/comment/47623386
score: 1
has comment: http://stackoverflow.com/comment/47623102
answers question: http://stackoverflow.com/q/29745058
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29745058
upvote count: 1
type: Answer

http://stackoverflow.com/a/29822840
type: Answer
answers question: http://stackoverflow.com/q/29822746
has body: You can do like: var classes = document.styleSheets[0].rules || document.styleSheets[0].cssRules; for (var x = 0; x &lt; classes.length; x++) { }
has comment: http://stackoverflow.com/comment/47772674
score: 0

http://stackoverflow.com/comment/47528530
has text: @IanFraser How do you know, are you monitoring the request in the console? Note that you are not doing anything with the output of your php script, you just show a success message.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29696020
type: Comment

http://stackoverflow.com/comment/47847762
score: 0
type: AnswerComment
has text: Is so strange a img tag without identifier. Hehe
type: Comment
comment on: http://stackoverflow.com/a/29838887

http://stackoverflow.com/comment/47527333
type: Comment
type: AnswerComment
has text: This just seems to animate the cart further to the left? Do you have any idea why this might be?
comment on: http://stackoverflow.com/a/29694979
score: 0

http://stackoverflow.com/comment/47786623
score: 0
has text: Is your plugin running in Synchronous mode??
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29824269

http://stackoverflow.com/q/29780315
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
tagged with: jackson
score: 0
has comment: http://stackoverflow.com/comment/47690756
accepted answer: http://stackoverflow.com/a/29780414
answer count: 1
tagged with: jquery
has title: What is the HTML form input equivalent for a JSON array?
type: AnsweredQuestion
has body: I am trying to send a JSON array in the request body of an HTTP POST endpoint which returns a CSV file. var config = { foo: ['bar'] } $http.post(url, config).success(...).error(...); The Java class representing this config input looks like this: @JsonProperty List&lt;String&gt; foo; The above $http.post works fine, except that I need to open a download prompt for the CSV file. I need to support IE8 so I am constructing a form similar to this gist. var form = $("&lt;form&gt;&lt;/form&gt;").attr("action", url) .attr("method", "post"); form.append($("&lt;input/&gt;").attr("type", "hidden") .attr("name", "foo[]") .attr("value", "bar")); form.appendTo($("body")) .submit() .remove(); The above code does not seem to send a properly formatted JSON array for Jackson to deserialize. According to Chrome dev tools, the $http.post version sends foo: ["bar"] but the form version sends foo[]: "bar". How can I POST the JSON array I want using HTML forms?
tagged with: java
has answer: http://stackoverflow.com/a/29780414
type: Question

http://stackoverflow.com/q/29780235
type: Question
score: -2
has body: In my project, I want to place an event within time range. For example 09:00 am to 10:00 am. I Googled many times, but not links found.
tagged with: javascript
tagged with: jquery
tagged with: jquery-events
downvote count: 2
answer count: 1
linked to: http://stackoverflow.com/q/14527260
favorite count: 0
type: UnansweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/47697118
has answer: http://stackoverflow.com/a/29780382
has title: How to render a event within time slot in full calendar?

http://stackoverflow.com/comment/47780294
type: Comment
comment on: http://stackoverflow.com/q/29827005
has text: `checkmousepos(e,id)` expects 2nd argument to be `id`. But in your call you are passing one arg. So `id` will be undefined
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47678905
type: Comment
has text: I wanted it on all levels, your answer was really helpfull! Thanks!
type: AnswerComment
comment on: http://stackoverflow.com/a/29774209
score: 0

http://stackoverflow.com/comment/47550817
type: AnswerComment
has text: Thanks, it worked, but how can I count the amount of IP's during that specific day? so the stats are correctly linked? because I want to display in total a month, but all days.
type: Comment
comment on: http://stackoverflow.com/a/29707050
score: 0

http://stackoverflow.com/comment/47563063
type: Comment
has text: Sure, it can be more angular, I'll leave it that as an exercise for someone else
comment on: http://stackoverflow.com/a/29713760
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47632406
type: Comment
has text: You do not have default values for the first two cookies in case those are not set.
score: 0
comment on: http://stackoverflow.com/q/29749973
type: QuestionComment

http://stackoverflow.com/comment/47787358
type: QuestionComment
has text: Call the service in your browser and look at the returned response. Just enter `http://localhost:1894/api/Values` in your browser and see what the response is...
score: 0
comment on: http://stackoverflow.com/q/29830235
type: Comment

http://stackoverflow.com/comment/47768186
has text: would wrapping the string in parseInt() work? like parseInt($(a).attr('id'))
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29820873
type: Comment

html5-canvas
tags question: http://stackoverflow.com/q/29766083
tags question: http://stackoverflow.com/q/29715132
tags question: http://stackoverflow.com/q/29785566
tags question: http://stackoverflow.com/q/29732410
tags question: http://stackoverflow.com/q/29783420
tags question: http://stackoverflow.com/q/29738649
tags question: http://stackoverflow.com/q/29831437
tags question: http://stackoverflow.com/q/29741391
tags question: http://stackoverflow.com/q/29807957
tags question: http://stackoverflow.com/q/29711487
tags question: http://stackoverflow.com/q/29790832
tags question: http://stackoverflow.com/q/29795899
tags question: http://stackoverflow.com/q/29829106
tags question: http://stackoverflow.com/q/29760686
tags question: http://stackoverflow.com/q/29812524
tags question: http://stackoverflow.com/q/29785623
tags question: http://stackoverflow.com/q/29827291
tags question: http://stackoverflow.com/q/29759329
tags question: http://stackoverflow.com/q/29765790
tags question: http://stackoverflow.com/q/29831756
tags question: http://stackoverflow.com/q/29730192
tags question: http://stackoverflow.com/q/29731191
tag name: html5-canvas
tags question: http://stackoverflow.com/q/29722882
type: Tag
tags question: http://stackoverflow.com/q/29770122
tags question: http://stackoverflow.com/q/29837239

http://stackoverflow.com/q/29843222
has body: I'm using the sweet alert library and I have a problem with the cancel button. This is my code for the sweet alert: sweetAlert({ title: title, text: text + ' ' + courseList, type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: confirmButtonText, cancelButtonText: "Continue with purchase", closeOnConfirm: false, closeOnCancel: false, html: true }, function(isConfirm) { if (isConfirm) { angular.forEach(repeatedCourses, function(repeatedCourse) { $rootScope.$apply(function() { this.removeCoursePurchase(repeatedCourse); }.bind(this)); }.bind(this)); $rootScope.$broadcast('uncheckCheckboxes'); swal("Deleted!", "Your purchase has been refreshed.", "success"); } else { swal("Cancelled", "Your imaginary file is safe :)", "error"); } }.bind(this)); When the user click on the confirm button, works fine, but If the cancel button is clicked doesn't do anything, it doesn't appear the "Cancelled" box and I don't know why!
favorite count: 0
has title: Sweet alert no works with cancel button
tagged with: angularjs
type: UnansweredQuestion
tagged with: bind
has comment: http://stackoverflow.com/comment/47813004
has comment: http://stackoverflow.com/comment/47812757
has comment: http://stackoverflow.com/comment/47812706
type: Question
upvote count: 4
downvote count: 0
tagged with: sweetalert
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/37130562
has comment: http://stackoverflow.com/comment/76882280
answer count: 1

http://stackoverflow.com/q/29841241
has answer: http://stackoverflow.com/a/29841723
has title: How to maintain states of selection on back button
type: Question
has body: I am using HTML and JavaScript to write Android APP, but I have a problem that when go back from current page to the previous page, the page is reloaded and the selection and setting when I made in the first goes to default. For example: On the first page user can select country and city and then navigate to second page. If user clicks on back button (which calls window.history.back(); or href="javascript:history.back(-1);") , then all the selection he made are lost and default selections are shown. It works fine in native browser of Android. How to maintain state of selection? Thanks in advance!
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47808944
has answer: http://stackoverflow.com/a/29944508
type: UnansweredQuestion

http://stackoverflow.com/a/29762004
has body: .nvd3 .nv-axis.nv-x path.domain { stroke-opacity: 1; stroke: red; } CSS is probably the way to go. (NVD3 makes the x-axis invisible by default, so you first want to set its opacity to 1.) Example in this Plunker.
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29736374
type: Answer

http://stackoverflow.com/comment/47674106
type: QuestionComment
has text: Unclear and useless question, but there is a [documentation](http://www.codeigniter.com/docs) for code igniter where they speak about caching. And there is [APC](http://php.net/manual/en/book.apc.php) to run php code faster (caching OP code).
score: 3
comment on: http://stackoverflow.com/q/29771401
type: Comment

http://stackoverflow.com/comment/47802201
type: Comment
has text: To elaborate on what EBrown is saying, in your ajax url, you are invoking a method called 'CreateDraft'. The c# code you showed us has a method called 'SomeMethod'. So, your ajax call will complete without error which is why you are getting your ajax alert. But you until you change your url to invoke the correct method, your c# code will do nothing.
type: QuestionComment
comment on: http://stackoverflow.com/q/29835507
score: 0

http://stackoverflow.com/comment/83206353
has text: @GuifanLi I guess you were using a dist version of jquery, which is mangled and compressed. Load a sourcemap may fix the debugging issue.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29727074

http://stackoverflow.com/a/29766979
type: Answer
has body: Usually the screen resolution is near 100dpi, usualy a bit lower, so you cannot capture a higher resolution, because it's not available. The capture is a pixel by pixel capture of what's in the screen. I don't know if yu can do so, but the only way to get a higher resolution is to cheat by zooming in in your browser, and capture the zoomed in div content. If you need 300 dpi you have to zoom at least x3. The only other solution is to get the original capture, and use some library that can increase the resolution using interpolation, but you're not going to get a good quality.
has comment: http://stackoverflow.com/comment/47667697
upvote count: 0
answers question: http://stackoverflow.com/q/29765790
has comment: http://stackoverflow.com/comment/58537284
score: -1
downvote count: 1

http://stackoverflow.com/a/29724865
score: 1
has body: Does this do what you're looking for? http://plnkr.co/edit/rORuEK7kL8v3Feya8up2?p=preview angular.module('app', []) .directive("artboard", function(){ return { restrict: 'E', link: function (scope, element) { var tmpl = "Please append oldValue here:"; var end = "\&lt;br\&gt;\&lt;br\&gt;\&lt;br\&gt;" + "End appendage"; scope.$watch("scoped.value", function(newValue, oldValue){ while(element[0].firstChild){ element[0].removeChild(element[0].firstChild) } element.append(tmpl+newValue+end) }); element.append(tmpl+end); } }; });
answers question: http://stackoverflow.com/q/29724670
upvote count: 1
has comment: http://stackoverflow.com/comment/47584040
type: Answer
downvote count: 0

http://stackoverflow.com/comment/47762147
type: Comment
comment on: http://stackoverflow.com/a/29816977
has text: Your post mentions iterating through a pre-defined whitelist of tag and attribute names. In a way that sounds like writing your own code to handle XSS vulnerabilities.
score: 0
type: AnswerComment

http://stackoverflow.com/a/29817872
answers question: http://stackoverflow.com/q/29800127
score: 0
type: Answer
has body: My problem was simply solved by using LocalStorage in javascript to save the value this surprisingly worked. Thanks for the help @SnoApps

http://stackoverflow.com/comment/47618393
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29742473
has text: Your code seems to be working fine check here: http://jsfiddle.net/w30jpdk2/
type: Comment

http://stackoverflow.com/comment/47719794
comment on: http://stackoverflow.com/a/29795633
score: 0
type: AnswerComment
has text: Thanks, alot for your really quick reply, what your answer does is great but it completely clones the thumbnail. I'm looking to put a larger version of the image in the large-image div. But thanks for your reply it's a great start for me to get going with.
type: Comment

http://stackoverflow.com/q/29696512
accepted answer: http://stackoverflow.com/a/29697617
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47529258
possible better answer: http://stackoverflow.com/a/29696550
downvote count: 0
has answer: http://stackoverflow.com/a/29696550
favorite count: 0
has body: I have two date inputs &amp; one drop down with first option "All".. My problem is when I select dates, if both dates are same, then the first option of select should become blank. &lt;script type='text/javascript'&gt; jQuery(document).ready(function () { var first = jQuery('#category').find('option').first(); jQuery('#date_to').on('change', function (e) { if($('#date_to').val == $('#date_from').val) { first.remove(); }) }); &lt;/script&gt;
upvote count: 2
has comment: http://stackoverflow.com/comment/47529076
has answer: http://stackoverflow.com/a/29697617
has comment: http://stackoverflow.com/comment/47529019
has title: Change first option of select
score: 2
type: AnsweredQuestion
type: Question
answer count: 2

http://stackoverflow.com/q/29756893
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29757067
type: Question
tagged with: regex
accepted answer: http://stackoverflow.com/a/29757067
possible better answer: http://stackoverflow.com/a/29757101
score: 0
answer count: 2
has body: I have functions that I am converting into strings. How would i use regex to insert 'use strict' inside the function. original. function test() { //some code... } final. function test() { 'use strict'; //some code }
has answer: http://stackoverflow.com/a/29757101
has title: Javascript Regex to insert
has comment: http://stackoverflow.com/comment/47646124
tagged with: javascript

http://stackoverflow.com/comment/47694051
has text: I'm not familiar with touch events but I would not make that assumption. https://developer.mozilla.org/en-US/docs/Web/Events/touchcancel suggests that `touchcancel` is implementation specific and has less to do with leaving a particular element/window than the user invalidating a touch event. `touchend` might be of interest to you but I can't really elaborate any more than a quick Google search.
comment on: http://stackoverflow.com/a/29779273
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29748838
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47631164
answers question: http://stackoverflow.com/q/29748535
has body: You can use jQuery's scrollTo() to scroll to the area on the page, then use the complete function to call you ajax after the scroll has finished. Detailed Description here $('body').scrollTo('#target', function() { // Do your AJAX Thaaang });
accepted answer of: http://stackoverflow.com/q/29748535
has comment: http://stackoverflow.com/comment/47630881

http://stackoverflow.com/comment/47526544
comment on: http://stackoverflow.com/q/29694784
score: 0
type: Comment
has text: You can add soft hyphenation marks on your words with `&shy;`. Does this help?
type: QuestionComment

http://stackoverflow.com/q/29721214
tagged with: angularjs-controller
tagged with: angularjs-scope
tagged with: code-reuse
has body: I am working with the project. I am using pagination, checkAll, deleteAll like functionalities that are common between all controllers. I wish to move the code to factory or service so can be utilize to all controllers. I tried but not clear with perfection. I want hint. I know to create factory or service, and how to intefrate it controller but bit confuse with logic of moving similar code. I give example that I use to write in all controller, Logic for Sorting and pagination as well. $scope.bigCurrentPage = 1; $scope.editIndex = ""; var sortKey = "name"; var sortDirection = "ASC"; $scope.filterObj = {order: [sortKey + " " + sortDirection], limit: CONFIG.limit, offset: 0}; $scope.filterObj.offset = ($scope.bigCurrentPage - 1) * CONFIG.limit; $scope.sortList = function (inputSort) { if (sortKey === inputSort) { sortDirection = (sortDirection === "ASC") ? "DESC" : "ASC"; } else { sortKey = inputSort; } $scope.filterObj.order = [sortKey + " " + sortDirection]; $scope.pageChanged(); } $scope.getSongs = function () { $scope.filterObj.offset = ($scope.bigCurrentPage - 1) * CONFIG.limit; Song.find({filter: $scope.filterObj}) .$promise .then(function (data) { $scope.items = data; $scope.maxSize = 5; $scope.size = $scope.filterObj.limit; $scope.countingIndex = ($scope.bigCurrentPage - 1) * $scope.filterObj.limit; //Its idea to implement counting. Variable is not part of pagination..//// }); }; $scope.pageChanged = function () { $scope.getSongs(); }; $scope.pageChanged(); This way, suppose I am doing this for Albums and I would change sortKey as 'id', Will use services with 'Album.find', would change 'filter' object and I am done, but fact is I am using common code in all controllers. How would I write it in better way.
downvote count: 1
accepted answer: http://stackoverflow.com/a/29721270
type: Question
has comment: http://stackoverflow.com/comment/47577069
has title: Combining common function in controllers AngularJS
tagged with: javascript
score: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29721270
tagged with: angularjs
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/a/29818030
upvote count: 1
has body: Answer at here dude: http://jsfiddle.net/5adjhd1x/6/ Give me a like ! .key {overflow: hidden; display: block; background: grey; padding: 0;} .key li {width: 32%; margin-right: 2%; margin-bottom: 10px; float: left; display: inline-block; background: red;} .key li:nth-child(3n) {margin-right: 0%;}
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47763530
score: 1
answers question: http://stackoverflow.com/q/29816572

zooming
tags question: http://stackoverflow.com/q/29710839
tag name: zooming
type: Tag
tags question: http://stackoverflow.com/q/29809065
tags question: http://stackoverflow.com/q/29721284

http://stackoverflow.com/a/29761876
answers question: http://stackoverflow.com/q/29761837
upvote count: 2
type: Answer
score: 2
has body: First, always specify the radix (second parameter) to avoid guessing. Second, parseInt expects a string, so add quotes around your number. parseInt("123123123123123123123123123123", 10) 1.2312312312312312e+29 Mozilla developer reference has good documentation of this function and examples. Regarding the radix, they say: Always specify this parameter to eliminate reader confusion and to guarantee predictable behavior. Different implementations produce different results when a radix is not specified.
downvote count: 0

http://stackoverflow.com/comment/47532831
type: AnswerComment
score: 0
type: Comment
has text: @CasparWylie correct, although `false` may also be the default (not sure).
comment on: http://stackoverflow.com/a/29698406

http://stackoverflow.com/comment/47805577
type: QuestionComment
comment on: http://stackoverflow.com/q/29839441
type: Comment
has text: `JSON.stringify( theStringWithMixedQuotes)` will do you right with ease since it always output a valid string.
score: 0

http://stackoverflow.com/q/29811667
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29812352
has body: I'm building an app in django that lets users create and edit flowcharts for the purpose of process/procedure control. There are three basic models: Procedure, Step, and Transition. I've created and debugged all the model relationships and through the admin interface and shell, I can create Procedures with several Steps and Transitions. It's functional but not intended for the end user. I need to create a browser-based jgraphical interface. Enter visjs, a javascript visualization library. Using visjs, I've created a basic block-diagram editor that lets users add/edit/delete nodes and edges (this is my first javascript attempt ever). I can load data from the database and post data back to the database through a couple of custom views and JSON serialization. However, it feels kludgey and hard to maintain. For example, it's not integrated into django's forms framework at all. At the moment, when submitted, the javascript does the serialization to post JSON data and JSON data only. I'd really like this to be a standard form submission but I can't figure out how to structure the form. How would you go about building a form to do handle this? I'm basically trying to get my javascript block diagram to be the form, if that makes any sense. Is this the use-case for a custom widget? Another wrinkle here is that the editor needs to create/update/delete the top-level procedure, the steps, and the edges. Thanks for your help
answer count: 1
downvote count: 0
has title: Django, javascript, and complex forms
favorite count: 0
tagged with: flowchart
tagged with: django
tagged with: python
type: AnsweredQuestion
score: 2
upvote count: 2
tagged with: django-forms
type: Question
has answer: http://stackoverflow.com/a/29812352

http://stackoverflow.com/a/29834702
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29833852
answers question: http://stackoverflow.com/q/29833852
type: AcceptedAnswer
downvote count: 0
has body: Change the type of the jquery Ajax code from post to get since you want to use the response, else I can't see something wrong there
type: Answer

http://stackoverflow.com/a/29828771
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47785267
type: Answer
score: 1
answers question: http://stackoverflow.com/q/29828199
accepted answer of: http://stackoverflow.com/q/29828199
has comment: http://stackoverflow.com/comment/47799572
has body: I think this is job for regular expressions. Something like this: $("[title*='space']").each(function() { var title = this.title, enter = this.title.match(/enter=(.*?)(\s|$)/), exit = this.title.match(/exit=(.*?)(\s|$)/), duration = this.title.match(/dur=(.*?)(\s|$)/) $(this).attr("data-enter", enter[1]); $(this).attr("data-exit", exit[1].replace(/,/, ' ')); $(this).attr("data-duration", duration[1]); $(this).removeAttr('title'); }); blahblahblah

http://stackoverflow.com/q/29775797
has comment: http://stackoverflow.com/comment/120723919
downvote count: 0
has title: Fetch: POST JSON data
has body: I'm trying to POST a JSON object using fetch. From what I can understand, I need to attach a stringified object to the body of the request, e.g.: fetch("/echo/json/", { headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, method: "POST", body: JSON.stringify({a: 1, b: 2}) }) .then(function(res){ console.log(res) }) .catch(function(res){ console.log(res) }) When using jsfiddle's JSON echo I'd expect to see the object I've sent ({a: 1, b: 2}) back, but this does not happen - chrome devtools doesn't even show the JSON as part of the request, which means that it's not being sent.
tagged with: javascript
has answer: http://stackoverflow.com/a/67558064
has answer: http://stackoverflow.com/a/74094146
has answer: http://stackoverflow.com/a/45345813
has answer: http://stackoverflow.com/a/50500959
has answer: http://stackoverflow.com/a/49517293
favorite count: 0
answer count: 19
has answer: http://stackoverflow.com/a/63571682
possible better answer: http://stackoverflow.com/a/42493030
has comment: http://stackoverflow.com/comment/47682200
has comment: http://stackoverflow.com/comment/47685109
has answer: http://stackoverflow.com/a/67280672
linked to: http://stackoverflow.com/q/41984893
tagged with: fetch-api
has comment: http://stackoverflow.com/comment/47683028
has answer: http://stackoverflow.com/a/45154118
has answer: http://stackoverflow.com/a/76732024
has answer: http://stackoverflow.com/a/46861052
has answer: http://stackoverflow.com/a/42312303
has answer: http://stackoverflow.com/a/29823632
accepted answer: http://stackoverflow.com/a/29823632
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29778812
has answer: http://stackoverflow.com/a/42493030
has answer: http://stackoverflow.com/a/67449137
has answer: http://stackoverflow.com/a/79276117
has comment: http://stackoverflow.com/comment/47683962
has comment: http://stackoverflow.com/comment/47682261
has answer: http://stackoverflow.com/a/52227451
tagged with: http://stackoverflow.com/tag/json
score: 1135
has comment: http://stackoverflow.com/comment/47683363
has answer: http://stackoverflow.com/a/64766708
has comment: http://stackoverflow.com/comment/47682471
upvote count: 1135
type: Question
has answer: http://stackoverflow.com/a/49240442

http://stackoverflow.com/a/65155672
type: Answer
has body: A suggestion is using typescript, like so: function test( options: { /** * @deprecated use newName instead */ name?: string, newName?: string }) { }
downvote count: 6
upvote count: 19
score: 13
has comment: http://stackoverflow.com/comment/122273591
has comment: http://stackoverflow.com/comment/118300896
has comment: http://stackoverflow.com/comment/139049271
has comment: http://stackoverflow.com/comment/130705464
answers question: http://stackoverflow.com/q/29763919

http://stackoverflow.com/q/29726652
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47587891
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29727514
favorite count: 0
has title: Create and manipulate underlined objects in JavaScript
tagged with: http://stackoverflow.com/tag/svg
type: Question
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/47587215
score: 0
has body: There is an idea to create an online music theory quiz. I have created a drawing in Inkscape and saved it in svg format. The file is used as an external source and has been added to HTML code. The challenges I have are as follows: 1) How to make lines below treble staff activate (selected)? 2) How to put the names of the notes (A, B, C, D, E, F, G) into the underlined spaces? 3) How to name the repeated notes with the same letter (e.g. "F" is repeated 2 times in my sample)? &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;body&gt; &lt;img src="image_library/grandstaff_drawing.svg" /&gt; &lt;/body&gt; &lt;/html&gt; 4) I have converted svg into png to show a quiz draft.
downvote count: 1
has comment: http://stackoverflow.com/comment/47587395

http://stackoverflow.com/comment/47514748
comment on: http://stackoverflow.com/q/29688718
type: Comment
has text: http://jsfiddle.net/sx6tsygd/
type: QuestionComment
score: 1

http://stackoverflow.com/comment/47670851
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29769515
has text: @Katrin sorry for that. i just mistype the code. yeah my variable didnt change
score: 0

http://stackoverflow.com/comment/47764419
score: 0
has text: its fine if its javascript or jquery or angular but strpos is php function right ?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29818689

http://stackoverflow.com/comment/47775558
type: Comment
score: 0
has text: You can add the onclick event to resize. it is not going to work automatically. like $('#example thead').click(function() { code to resize })
type: QuestionComment
comment on: http://stackoverflow.com/q/29824453

http://stackoverflow.com/q/29695002
type: Question
tagged with: automated-tests
tagged with: javascript
answer count: 1
has title: Checking a checkbox with dalekjs
has body: This feels like the stupidest question ever asked on SO, but I'm having no luck with things I've tried to check a simple checkbox within a DalekJS test. So far I have tried clicking it:- .click('#checky') I've tried checking it:- .execute(function() { document.getElementById('checky').checked = true; } I've tried setting it:- .setValue('#checky', true) Which got dalek very upset... I've tried shouting at it and swearing at it. But no dice. I've looked through the dalek library and there doesn't seem to be an action to suit. So I'm hoping someone will have any suggestions or help... Please accept my apologies for the lameness of this question...
has answer: http://stackoverflow.com/a/29696093
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/54145766
accepted answer: http://stackoverflow.com/a/29696093
score: 0
tagged with: dalekjs

http://stackoverflow.com/q/29803634
has answer: http://stackoverflow.com/a/29804004
tagged with: javascript
tagged with: jquery
has title: Smart Modal disabling window?
tagged with: jquery-plugins
score: 0
tagged with: modal-dialog
answer count: 1
accepted answer: http://stackoverflow.com/a/29804004
type: AnsweredQuestion
type: Question
has body: The contractor that did our site used a version of smart modal jQuery plugin, not the one from Ben Marshall but this one: https://code.google.com/p/esp1179/source/browse/trunk/smart-modal/jquery.smartmodal.js?r=22, on our login dialogs. When an invalid login happens, the form seems to be disabled and I can't figure out why as I DO NOT explicitly disable the form or any of it's controls, with the exception of hiding the login button and showing the spinner. https://www.scic.com/schedule Click any of the register links that have a price showing for the course and then enter jibberish in the Username and password inputs. The file that is calling the dialog is loadpopups.js. Can someone check it out and help me figure out why it is happening? I'm about to pull out the only hair I have remaining.

http://stackoverflow.com/q/29693612
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47523782
has comment: http://stackoverflow.com/comment/47523944
has title: Time format in javascript
downvote count: 3
has body: I use AngularJs. In a controller I get time. Then I want to show it in view with 2 textview. The first is dd:mm:yy the second is hh:mm:ss but when I use it return wrong result. How can I get time without date.
type: Question
linked to: http://stackoverflow.com/q/12920892
upvote count: 0
has comment: http://stackoverflow.com/comment/47523567
tagged with: javascript
has comment: http://stackoverflow.com/comment/47523622
has answer: http://stackoverflow.com/a/29693874
score: -3
answer count: 1
favorite count: 0

cakephp
tags question: http://stackoverflow.com/q/29751038
type: Tag
tag name: cakephp

http://stackoverflow.com/comment/47573807
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29719615
score: 0
has text: @Barmar yep, fixed ;)

http://stackoverflow.com/a/29801057
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29800534
downvote count: 0
has body: If you're using jquery, you can clear the contents of the div using its id $("#divID").empty(); And then append some kind of sub-element for each entry you retrieve from the db $("#divID" ).append(" Element #1 ");

http://stackoverflow.com/comment/47760666
type: Comment
type: QuestionComment
score: 0
has text: Post some code so we can see what you have tried. A fiddle would also help a lot
comment on: http://stackoverflow.com/q/29816795

http://stackoverflow.com/a/29738794
answers question: http://stackoverflow.com/q/29738684
score: 3
type: Answer
has comment: http://stackoverflow.com/comment/47639086
downvote count: 1
has comment: http://stackoverflow.com/comment/47638620
has body: You're problem does lie in the fact that you are not returning a promise but as you stated in @maxenglander's post you may have multiple http calls involved which means you should start creating and resolving your own promise using $q: .service('dataService', ['$http', '$q', function($http, $q) { return $http.get('assets/scripts/data/products.json') .then(function(data) { //possibly do work on data return &lt;&lt;mutated data&gt;&gt;; }); }]; or if you have multiple http calls and need to do some combination work you can do something $q.all: .service('dataService', ['$http', '$q', function($http, $q) { var p1 = $http.get('assets/scripts/data/products.json'); var p2 = $http.get('assets/scripts/data/products2.json'); return $q.all([p1, p2]).then(function(result){ //do some logic with p1 and p2's result return &lt;&lt;p1&amp;p2s result&gt;&gt;; }); }]; then in your controller you will need to do: .controller('StoreController', ['$scope', 'dataService', function ($scope, dataService) { dataService.getData().then(function(result){ $scope.products = result; }); }]); What this allows in your service is now you can do complex calls like say call two webservices inside and wait till they are both complete then resolve the promise. What I'm trying to express here is that you don't need to return the promise provided by the $http.get function, but since you are doing an async action you DO need to return some promise that will be later fulfilled and acted on.
has comment: http://stackoverflow.com/comment/47611672
upvote count: 4
has comment: http://stackoverflow.com/comment/47638451

http://stackoverflow.com/a/29826225
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29825908
upvote count: 3
has comment: http://stackoverflow.com/comment/124095740
accepted answer of: http://stackoverflow.com/q/29825908
type: Answer
has comment: http://stackoverflow.com/comment/47779430
score: 3
has body: I don't know how efficient a regular expression would be at handling this, but something like this could work (however slow it may be) http://jsfiddle.net/vdugk40m/1/: var info="fill:#010011;fill:#010012;fill:#010013;fill:#010014;"; var m, regex = /fill\:\#(\[A-F0-9]+)[;]/gi; var colors = []; do { m = regex.exec(info); if (m) colors.push(m[1]); } while (m); alert(colors); If you need the # in the string, move the open parenthesis before the \#. If you want to then reduce the array to only unique values (lifted from https://stackoverflow.com/a/14438954/579148): colors = colors.filter( onlyUnique ); function onlyUnique(value, index, self) { return self.indexOf(value) === index; }
downvote count: 0
has comment: http://stackoverflow.com/comment/47779120

http://stackoverflow.com/a/29792391
score: 0
type: Answer
has body: To complete the answer of MaxArt The code to receive the data in Php would be : $file = $_POST['theFile'];//sent from javascript $filePath = "/your_destination_directory/filename.ext"; if(file_put_contents($filePath,$file)) { //OK }else{ //ERROR }
answers question: http://stackoverflow.com/q/29791961

http://stackoverflow.com/q/29823223
accepted answer: http://stackoverflow.com/a/29823567
tagged with: javascript
has title: Form Validation
tagged with: validation
has comment: http://stackoverflow.com/comment/47772746
has comment: http://stackoverflow.com/comment/47772644
has comment: http://stackoverflow.com/comment/47773069
has comment: http://stackoverflow.com/comment/47772688
has comment: http://stackoverflow.com/comment/47772722
has answer: http://stackoverflow.com/a/29823567
has body: I am creating a basic form validator but for some reason it never initiates the else statement if anyone could help. I am sure it is something silly but I am under the impression that on click it will run through the conditionals and if all fails the return false; will return it to the start. $('.get-results').click(function(e) { e.preventDefault(); var get_results = $('.get-results'), input_h8_val = $('.input_h8_val'), input_h10_val = $('.input_h10_val'), input_h12_val = $('.input_h12_val'), input_h14_val = $('.input_h14_val'), input_h16_val = $('.input_h16_val'), input_h20_val = $('.input_h20_val'), input_h21_val = $('.input_h21_val'), input_h23_val = $('.input_h23_val'); if (input_h8_val.val() == 0) { $(input_h8_val).next('.error').show(); } else if (input_h10_val.val() == 0) { $(input_h10_val).next('.error').show(); } else if (input_h12_val.val() == 0) { $(input_h12_val).next('.error').show(); } else if (input_h14_val.val() == 0) { $(input_h14_val).next('.error').show(); } else if (input_h16_val.val() == 0) { $(input_h16_val).next('.error').show(); } else if (input_h20_val.val() == 0) { $(input_h20_val).next('.error').show(); } else if (input_h21_val.val() == 0) { $(input_h21_val).next('.error').show(); } else if (input_h23_val.val() == 0) { $(input_h23_val).next('.error').show(); } else { console.log("worked"); $('#first-wrapper').hide(); $('.predicted').addClass('active'); $('.predicted').addClass('no-left-radius'); $('.orders').addClass('no-right-radius'); $('#second-wrapper').show(); $('#third-wrapper').hide(); do_calculations(); } }); JSFiddle
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/47772813
tagged with: forms
possible better answer: http://stackoverflow.com/a/37459345
type: Question
has answer: http://stackoverflow.com/a/37459345
answer count: 2

http://stackoverflow.com/a/29697965
type: Answer
has comment: http://stackoverflow.com/comment/47537403
upvote count: 1
has comment: http://stackoverflow.com/comment/47538576
score: 1
answers question: http://stackoverflow.com/q/29697836
has comment: http://stackoverflow.com/comment/47555269
downvote count: 0
has body: The second way you have shown it is the correct way to do this. Promises are used to clearly organize asynchronous callback behavior. The sendKeys asynchronous callback cannot be captured unless the Promise resolves before you expect. Also, it looks like it is actually returning a Promise, in which case it seems that it is wise to use what is provided by the function. If you don't prefer to use two thens, you can always just expect: elem.clear().sendKeys('Message') .then(function(){ expect(elem.getAttribute('value')).toBe('Message'); });

http://stackoverflow.com/a/29746266
has body: a b c You should pass x,y,z ..why 1,2,3
has comment: http://stackoverflow.com/comment/47626864
score: 0
has comment: http://stackoverflow.com/comment/47625513
has comment: http://stackoverflow.com/comment/47625263
type: Answer
answers question: http://stackoverflow.com/q/29745857

http://stackoverflow.com/comment/67871157
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29692412
has text: That's interesting, @Benjamin Gruenbaum. Because for me the solution does not work in the browser. This is probably because I use webpack and a shim for process. It seems initEmitRejection (using when.js 3.7.7) would skip emitting an event in this case. Can you comment on that?
score: 0

http://stackoverflow.com/comment/47636584
comment on: http://stackoverflow.com/q/29709874
type: QuestionComment
type: Comment
has text: @scrappedcola Yes I am aware of the presence of the server. It is on a server. What I am saying though is that the specific page(s) that I created for *after* the login part to the website does not use any language beyond HTML and JS. I am not sure what you mean by "No actually it can't add whatever you want to a url and expect it to not error out." What I mean is you *can* type in google.com?p=Dallas and google.com *will still load*. /Clients/CMCDFMIS/gateway.htm is the page that loads after login. /Clients/CMCDFMIS/FOLDER/anotherpage.htm is where *../gateway.html?p=Dallas* link is located.
score: 0

http://stackoverflow.com/comment/47803109
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29837980
has text: When the javascript code executes, by default the selectors will assumed to be in that frame if any element is in a different frame it wont be selected. Better to qualify the selectors from the respective iframe windows. I guess this is where the problem is.
score: 0

http://stackoverflow.com/q/29796416
type: UnansweredQuestion
tagged with: node.js
answer count: 0
score: 1
has title: Cant set header after they are sent
has comment: http://stackoverflow.com/comment/47723145
has comment: http://stackoverflow.com/comment/47722956
tagged with: coffeescript
upvote count: 1
type: Question
tagged with: javascript
downvote count: 0
favorite count: 0
has body: I m actually trying to work with a complex function un an express route callback and I get a Error: Can't set headers after they are sent. when spamming the refresh button. The fact is that I cant find the problem in my coffeescript file neither in the javascript file. This is the only function that throw me out with my application, so the code executed before is not a problem (tested in fact) Here's my coffeescript file : traitementPrestationSiteAction: (idSites)-&gt; agency = if @qParams.agency then @qParams.agency else undefined if !idSites || !agency @response.status(400).end() else endDate = new Date() startDate = new Date() start = if @qParams.start then new Date(@qParams.start) else startDate end = if @qParams.end then new Date(@qParams.end) else endDate start.setHours(0) start.setMinutes(0) start.setSeconds(1) end.setHours(23) end.setMinutes(59) end.setSeconds(59) @TraitementNettoyage.find({'dateEntre': {$gt: start, $lte: end}, 'site': idSites, 'agency': agency},'zone objectsControlled dateEntre dateSortie') .populate('zone', 'zoneName') .populate('objectsControlled.listePrestations.prestation', '_id prestationName') .populate('objectsControlled.object', 'typeobjectName') .sort('-_id') .exec((err, result)=&gt; if err @response.status(500).end() else if !result @response.status(204).end() else @response.send(result)) And the javascript associated : TraitementNettoyageController.prototype.traitementPrestationSiteAction = function(idSites) { var agency, end, endDate, start, startDate; agency = this.qParams.agency ? this.qParams.agency : void 0; if (!idSites || !agency) { return this.response.status(400).end(); } else { endDate = new Date(); startDate = new Date(); start = this.qParams.start ? new Date(this.qParams.start) : startDate; end = this.qParams.end ? new Date(this.qParams.end) : endDate; start.setHours(0); start.setMinutes(0); start.setSeconds(1); end.setHours(23); end.setMinutes(59); end.setSeconds(59); return this.TraitementNettoyage.find({ 'dateEntre…

http://stackoverflow.com/q/29694722
has answer: http://stackoverflow.com/a/29694830
type: UnansweredQuestion
has title: To make div visible using jQuery
type: Question
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47525878
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47525898
has comment: http://stackoverflow.com/comment/47525830
has answer: http://stackoverflow.com/a/29695176
has body: In the below code I have a div I have set to false and I want to make visible true using jQuery. If I remove visible false in div I can make visible. Please help me to do this. JavaScript: $('#<%=divmaterialconsumption.ClientID %>').show();

http://stackoverflow.com/comment/47711654
has text: try `opacity:0;` or `height:0;width:0`
comment on: http://stackoverflow.com/q/29791404
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/29789884
has comment: http://stackoverflow.com/comment/47710555
accepted answer of: http://stackoverflow.com/q/29789386
has comment: http://stackoverflow.com/comment/47710782
has body: If you want to check whether a checkbox is selected use is(':checked') like this $('input[name=vehicle]').is(':checked') it returns boolean - so true or false. In order to check which one you select use .val() like this: $('input[name=vehicle]').val() It returns the value of an checkbox. You should put id on each option of select in order to put class just on the one option you want. Here is NEW WORKING jsFiddle. Let me know if i helped you. I just suggested the right way so i didnt put the ids on all options ... So the html code looks like: Hello Hi Bye Volvo Saab Opel Audi And js like this: $('input[name=vehicle]').click(function(){ if($(this).is(':checked') && $(this).val() == 'Bike'){ $('#opel').addClass('Bike'); } else if ($(this).is(':checked') && $(this).val() == 'Car'){ $('#saab').addClass('Car'); } else if ($(this).is(':checked') == false && $(this).val() == 'Bike'){ $('#opel').removeClass('Bike'); } else if ($(this).is(':checked') == false && $(this).val() == 'Car'){ $('#saab').removeClass('Car'); } }); NOTE: I used jquery because you mentioned it in the tags. EDIT: Also if you dont want any more classes to be inside of the select you can remove the class attribute with this .removeAttr('class'). EDIT2: Editted the answer to work on options instead of whole select. Provided new jsfiddle. EDIT3: I used your code from your jsFiddle and rewrite it so it works now as you wanted it in comment.
has comment: http://stackoverflow.com/comment/47709321
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47710889
has comment: http://stackoverflow.com/comment/47710970
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29789386
has comment: http://stackoverflow.com/comment/47709278
has comment: http://stackoverflow.com/comment/47710471

http://stackoverflow.com/q/29778823
has answer: http://stackoverflow.com/a/29778899
has answer: http://stackoverflow.com/a/29778902
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/8118489
has answer: http://stackoverflow.com/a/29778888
score: 0
has title: Prevent event from triggering
answer count: 3
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29778902
has body: I got two functions, one that collapses stuff when someone clicks the header of that collapsable, and I got a function that opens a modal, but the open modal icon that I use as a trigger to open the modal, is on the header of the collapsable, so when someone clicks the icon, it both opens the modal, and does the collapse stuff, but I just want to open the modal and not do the collapse stuff, so how can I prevent it from triggering my collapse? Collapse $(document).on('click', '.panel-heading', function () { var valgtElement = $(this).next(); $.each($('.panel-collapse'), function (index, value) { if ($(this).attr('id') == valgtElement.attr('id')) { $(this).collapse('toggle'); } else { if ($(this).hasClass('in')) { $(this).collapse('toggle'); } } }); }); Icon click $('body').on('click', '.fa-trash-o', function () { $('#slettModal').modal(); });
accepted answer: http://stackoverflow.com/a/29778899
type: AnsweredQuestion
tagged with: twitter-bootstrap

http://stackoverflow.com/q/29701643
has title: HTML5 audio, testing if playing with javascript
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
has body: Alright so I have audio on my site, and I want a user to only be able to play one audio at a time, regardless of how many tabs or windows the user has open. So if the user starts a new song in a different tab, the other one stops playing. Quick disclaimer: I have it working right now, but it's not a good method. Right now I have it so that when the user starts an audio file, it creates a php session with a random id for the instance of the playback. Then if a song is playing, it constantly sends ajax to the server to see if the session id is the same as the song's playback id. if the id is not the same, the playback stops. So right now it's working 100% how I want it, but it's sending so many requests to the server so I know there has to be a better way with using cookies or something. Please help if you can.
favorite count: 0
has answer: http://stackoverflow.com/a/29701884
tagged with: php
tagged with: audio
type: AnsweredQuestion
tagged with: cookies
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29701884

http://stackoverflow.com/comment/47804998
comment on: http://stackoverflow.com/a/29839296
type: Comment
has text: I tried adding this, but nothing happens when I click on the thumbnail. So, you're saying it's impossible without classes being added?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47665160
has text: did you call the `ExpenseOverviewController` scripts in main screen?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29766903

http://stackoverflow.com/q/29739110
upvote count: 1
has comment: http://stackoverflow.com/comment/47612792
accepted answer: http://stackoverflow.com/a/29838231
type: Question
has comment: http://stackoverflow.com/comment/47611387
downvote count: 0
tagged with: javascript
answer count: 1
favorite count: 0
tagged with: phpexcel
has body: I would like to know how to redirect the page after creating a file using PHPExcel. File created is ok but redirection to another page is not. Below are some codes. $excel -&gt; setActiveSheetIndex(0); $_SESSION["information"] = "Motor Line Checking Completed."; header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); header("Content-Disposition: attachment;filename='".$report_name.".xlsx'"); header("Cache-Control: max-age=0"); $writer = PHPExcel_IOFactory::createWriter($excel, "Excel2007"); $writer -&gt; save('php://output'); exit; header("Location: ".$_SERVER["HTTP_HOST"]."/../../"); exit; NOTES: If I remove exit;after save();, xlsx file will be corrupted. If I move header("Location:...");before save();, it will redirect but will not create xlsx. I also tried redirecting using javascript. What I want is to create xlsx and redirect the page after.
has title: PHPExcel Redirect Page After Creating Excel File
has comment: http://stackoverflow.com/comment/47611521
tagged with: http-redirect
tagged with: php
linked to: http://stackoverflow.com/q/31593588
linked to: http://stackoverflow.com/q/822707
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29838231
score: 1

http://stackoverflow.com/comment/47689284
has text: @LelioFaieta You're not clear on ajax. Even though the page reloads, *there has been an ajax request*. Wether the page reloads or not is not relevant. AJAX is ajax by itself.
score: 0
comment on: http://stackoverflow.com/q/29779134
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29829451
possible better answer: http://stackoverflow.com/a/29829716
has comment: http://stackoverflow.com/comment/47785327
has answer: http://stackoverflow.com/a/29829716
downvote count: 3
has answer: http://stackoverflow.com/a/29829677
upvote count: 1
type: Question
score: -2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29830506
has body: Is there a way with to get multiple languages in one page? So if I had something like this: &lt;div id="content-English"&gt; Hello, user &lt;/div&gt; &lt;div id="content-Dutch"&gt; Hallo, gebruiker &lt;/div&gt; Is it possible to only show the English when I have selected English in my Language Selector and hide the Dutch but when I have selected Dutch display the Dutch and hide the English? I know this can be done with JavaScript but I don't know how, Can anyone help me out?
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/29829796
has comment: http://stackoverflow.com/comment/47785382
answer count: 4
has title: Multiple Languages in one page
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29830506

http://stackoverflow.com/comment/47638913
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29753272
score: 0
has text: `input.addEventListener('focus', focus, false);` and use `this` in the function.

http://stackoverflow.com/a/29711605
upvote count: 1
answers question: http://stackoverflow.com/q/29711544
score: 1
downvote count: 0
has body: You need something to append your created div element to. var div = document.createElement('div'); div.innerHTML = preambula; document.getElementById('append-table').innerHTML = ''; document.getElementById('append-table').appendChild(div); I created a fiddle for you here: http://jsfiddle.net/6x7jd5od/
type: Answer

http://stackoverflow.com/a/29782210
downvote count: 0
answers question: http://stackoverflow.com/q/29782152
type: Answer
has body: A jQuery alternative could be crafted as follows. Note that nth-of-type is not zero index based $('p.para:nth-of-type(3)').css('color', 'red') JSFiddle Link
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47694744

http://stackoverflow.com/q/29836283
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/47828830
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47799583
has comment: http://stackoverflow.com/comment/47799453
has body: How can I make the current Bootstrap carousel image stay still while the next slide moves in over the top of it? The text can slide off like normal, but I would like for the image to stay put. Here's an example on bootply: http://www.bootply.com/mfKPouoFhH
favorite count: 0
has title: Bootstrap custom slide transition
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47799561
tagged with: css
has comment: http://stackoverflow.com/comment/47799516
tagged with: twitter-bootstrap-3

http://stackoverflow.com/q/29808983
tagged with: php
tagged with: css
score: 2
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/47746038
downvote count: 1
has comment: http://stackoverflow.com/comment/47746484
accepted answer: http://stackoverflow.com/a/29809068
type: Question
possible better answer: http://stackoverflow.com/a/29809740
has comment: http://stackoverflow.com/comment/47746356
has answer: http://stackoverflow.com/a/29809740
tagged with: javascript
has title: How do you make an html code snippet only show up for desktop searches?
answer count: 3
has answer: http://stackoverflow.com/a/29809030
linked to: http://stackoverflow.com/q/13023157
has comment: http://stackoverflow.com/comment/47746047
favorite count: 0
has answer: http://stackoverflow.com/a/29809068
has comment: http://stackoverflow.com/comment/47746049
tagged with: http://stackoverflow.com/tag/html
has body: I am using little HTML boxes on my work's website. The thing is, we need to have HTML that will be shown to computer browsers, but we don't want this to show up on mobile devices because the HTML snippets are out of order when mobile devices pick them up. Does anyone have any ideas?

http://stackoverflow.com/comment/47639503
has text: @Madizm: Would have been much sooner if we'd had example HTML to begin with :)
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29750953
type: AnswerComment

http://stackoverflow.com/comment/47598570
comment on: http://stackoverflow.com/q/29732180
score: 0
type: QuestionComment
has text: normal in what way? i took that code from https://support.microsoft.com/en-us/kb/278469 which is supposed to do a adaptive resize on the client website, in which it is not doing so.@Shaun Loftin
type: Comment

http://stackoverflow.com/comment/47758400
comment on: http://stackoverflow.com/q/29815549
has text: It's JS syntax limitation. You can't do so.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47710838
comment on: http://stackoverflow.com/q/29790977
has text: ... what's wrong with what you have at the moment? Does that work? You've not really [asked a question](http://stackoverflow.com/help/how-to-ask).
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47959358
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29799662
has text: Just remove the option from your initialization.
score: 0

http://stackoverflow.com/comment/47762073
has text: Okey, so how shall i do it? I have never done something with script before...
comment on: http://stackoverflow.com/q/29817181
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47571080
score: 0
has text: I have edited the answer. You can use my last example.
type: Comment
comment on: http://stackoverflow.com/a/29717937
type: AnswerComment

http://stackoverflow.com/comment/47784434
type: QuestionComment
comment on: http://stackoverflow.com/q/29828199
score: 0
has text: @ShaunakD Thanks it was helpful but If I replace values in title it will doesn't work for me properly. And in title I want to change exit=fadeOut,scaleOut to data-exit="fadeOut scaleOut". But in real life it seems like data-exit="fadeOut,scaleOut" =((
type: Comment

http://stackoverflow.com/a/29778039
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48308209
accepted answer of: http://stackoverflow.com/q/29777439
answers question: http://stackoverflow.com/q/29777439
type: Answer
score: 6
upvote count: 6
downvote count: 0
has comment: http://stackoverflow.com/comment/48306959
has body: The validate option is only to be used for client side validation, so the if (value == 'bob') bit is alright, but you shouldn't fire the ajax post in the else block. You should make the url option do the ajax post, then you can leverage the success and error options to handle async callback properly. For example: $('#name').editable({ type: 'text', title: 'Name', url: function () { return $.post('/echo/json/', { json: 'false', delay: .5 }); }, pk: 123, validate: function (value) { if (value == 'bob') { return 'bob is not allowed'; } }, success: function (response) { if(response === false) { console.log('remote error from success'); return 'remote error'; } }, error: function (response) { console.log('remote error from fail'); return 'remote error'; } }); jsfiddle: https://jsfiddle.net/x0bdavn7/
has comment: http://stackoverflow.com/comment/47688096

http://stackoverflow.com/q/29731686
type: Question
downvote count: 2
tagged with: brackets
upvote count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/29733071
has body: I am trying to parse a formula, and display it on screen. For example I should be able to take &lt;path&gt;T Q, where &lt;path&gt;T cannot change, and Q is a variable. It accepts it,however when printing it on screen again the only thing that will appear is T Q. I want &lt;path&gt;T Q to appear fully. Other examples of accepted formulae are (B &amp; A) ~A ~(B&amp;A) &lt;path&gt;T (B &amp; A) etc My code is something like this var beginPartBUC = '^&lt;path&gt;\\(', beginPart = '^\(', unaryPart = '(?:~|&lt;path&gt;T)', propOrBinaryPart = '(?:\\w+|\\(.*\\))', subwffPart = unaryPart + '*' + propOrBinaryPart, endPart = '\\)$'; // binary connective regexes var conjRegEx = new RegExp(beginPart + '(' + subwffPart + ')&amp;(' + subwffPart + ')' + endPart), // (p&amp;q) implRegEx = new RegExp(beginPart + '(' + subwffPart + ')-&gt;(' + subwffPart + ')' + endPart), // (p-&gt;q) equiRegEx = new RegExp(beginPart + '(' + subwffPart + ')&lt;-&gt;(' + subwffPart + ')' + endPart); // (p&lt;-&gt;q) // untilRegEx = new RegExp(beginPartBUC + '(' + subwffPart + ')U(' + subwffPart + ')' + endPart); //&lt;path&gt;(p U q))
has comment: http://stackoverflow.com/comment/47596685
answer count: 1
tagged with: regex
has comment: http://stackoverflow.com/comment/47596711
has answer: http://stackoverflow.com/a/29733071
has comment: http://stackoverflow.com/comment/47597608
type: AnsweredQuestion
has title: Trouble with regex in javascript; any content within <angular> brackets disappear
score: -1

http://stackoverflow.com/a/29824521
score: 1
upvote count: 1
type: Answer
has body: You can detect which key is pressed, and then edit the array accordingly: $("textarea").keydown(function(e){ switch(e.keyCode){ // Backspace case 8: // Remove word from array if necessary break; // Delete button case 46: // Remove word from array if necessary break; // Anything else default: // Add timestamp to array break; }; }); In this example code, it won't add timestamps to your array for the backspace or delete buttons.
downvote count: 0
answers question: http://stackoverflow.com/q/29823661

http://stackoverflow.com/q/29780376
has title: Differences between angular.copy() and JSON.parse(JSON.stringify())?
tagged with: object
type: AnsweredQuestion
upvote count: 9
tagged with: clone
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/29780884
score: 9
type: Question
possible better answer: http://stackoverflow.com/a/29780441
answer count: 2
has answer: http://stackoverflow.com/a/29780441
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/728360
favorite count: 0
has body: Can someone explain the differences between angular.copy() and JSON.parse(JSON.stringify())? Are there any? What you will recommend to use? Is angular.fromJson(angular.toJson()) the same as JSON.parse(JSON.stringify())? Just to mention, I've read How do I correctly clone a JavaScript object? for JSON.parse(JSON.stringify()) and angular.copy() reference for angular.copy().
has answer: http://stackoverflow.com/a/29780884
tagged with: angularjs

http://stackoverflow.com/q/29805011
has body: I am working with HTTP API for sending SMS. I am trying to decode this json file which i actually receive after i made a post URL. Now i want to know is how can i decode the thing.. if this is static then i can decode but the fact is it have number key which may increase to any extension. In that case what i will do and how will i decode that post and also i need to save in mysql. Please anyone help me out of this problem. {"msg_id":"4396-7666-1337896-1dc5c765ad7-5537bb07-123638242","SenderId":"EXECUT","linecount":"1","billcredit":"0.00","message":"Hello+Test+Message","sendondate":"2015-04-22 20:45:00","seq_id":{"**1**":{"valid":"true","billcredit":"1.00","id_provider":"24","providerkey":"HUTCH","regionKey":"WB","originalnumber":"1234567890","validnumber":"1234567890","mnpID":"106","dlr_seq":1},"**2**":{"valid":"true","billcredit":"1.00","id_provider":"24","providerkey":"HUTCH","regionKey":"WB","originalnumber":"1234567890","validnumber":"1234567890","mnpID":"106","dlr_seq":2}}} I actually did the following $json = file_get_contents($daat); $obj = json_decode($json); $num= $obj-&gt;seq_id-&gt;{'1'}-&gt;validnumber; But this will be valid only if i am having static json what to do incase of dynamic one.
has comment: http://stackoverflow.com/comment/47739330
has title: decode json with number object in php
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47739464
has comment: http://stackoverflow.com/comment/47740694
tagged with: php
has comment: http://stackoverflow.com/comment/47757974
has comment: http://stackoverflow.com/comment/47738904
has comment: http://stackoverflow.com/comment/47738568
linked to: http://stackoverflow.com/q/17016506
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47739414
has comment: http://stackoverflow.com/comment/47740469
has comment: http://stackoverflow.com/comment/47739499
has comment: http://stackoverflow.com/comment/47737998
type: Question
has comment: http://stackoverflow.com/comment/47740035
has comment: http://stackoverflow.com/comment/47742548
tagged with: arrays
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47756241
has answer: http://stackoverflow.com/a/29805265
score: 0
has comment: http://stackoverflow.com/comment/47737786
tagged with: sms-gateway

http://stackoverflow.com/q/29737634
score: 0
answer count: 1
tagged with: parsing
tagged with: http://stackoverflow.com/tag/xml
has body: Ok, I am doing my nut trying to figure this out... I have a page that pulls up a bunch of XML data and it is working fine. I then decided to add a search box on this and other pages that will make this page only show the results of my search. I know that the page is receiving the form data and that it is being correctly stored in variables. I want to use those variables to then filter the results of my xml file. What I have currently is; var x=xmlDoc.getElementsByTagName("ResidentialProperty"); mySearch = location.search.substr(1).split("&amp;") function getFromSearch() { var x = 0 mySearch = location.search.substr(1).split("&amp;") for (x=0;x&lt;=mySearch.length;x++) { eval("document.forms.myNewForm."+mySearch[x]) } } document.write(mySearch); for (i=0;i&lt;x.length;i++) { var item = x[i]; document.write("&lt;div class='property'&gt;&lt;div class='list_name'&gt;"); if(item !== undefined) { var itemElements = item.getElementsByTagName("StreetNumber"); if(itemElements.length &gt; 0) { if(itemElements[0].childNodes.length &gt; 0) { document.write(x[i].getElementsByTagName("StreetNumber")[0].childNodes[0].nodeValue+' '); } } } if(item !== undefined) { var itemElements = item.getElementsByTagName("StreetDirPrefix"); if(itemElements.length &gt; 0) { if(itemElements[0].childNodes.length &gt; 0) { document.write(x[i].getElementsByTagName("StreetDirPrefix")[0].childNodes[0].nodeValue+' '); } } } etc. This is all working but every time I try to filter it just stops all results returning. Please help.
type: AnsweredQuestion
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29738435
has title: Using Javascript/JQuery to Filter XML results
accepted answer: http://stackoverflow.com/a/29738435

http://stackoverflow.com/comment/47719337
score: 0
type: AnswerComment
has text: Thanks a lot for the hint. I could be able to get the index by using this.cellIndex as following code. function clickSchedule(){ var t = document.getElementsByClassName("table") for(i=0; i<t.length; i++) { t[i].onclick= function() { alert(this.cellIndex); // cellindex property }; } } window.onload = function(){ clickSchedule(); };
type: Comment
comment on: http://stackoverflow.com/a/29775997

http://stackoverflow.com/q/29712915
answer count: 2
has title: Combining Array with Array of Arrays
score: 2
tagged with: arrays
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47561220
has answer: http://stackoverflow.com/a/29712966
possible better answer: http://stackoverflow.com/a/29713003
has answer: http://stackoverflow.com/a/29713003
favorite count: 0
upvote count: 2
accepted answer: http://stackoverflow.com/a/29712966
has comment: http://stackoverflow.com/comment/47561200
has body: I have the following arrays of arrays w a little overlapping of elements: arr1 = [[a,b], [c,d], [e,f], [g, h]] arr2 = [[a, 1, 2, 3], [c, 4, 5, 6], [e, 7, 8, 9], [g, 10, 11, 12]] How can I get to arr1 = [[a, b, 1, 2, 3], [c, d, 4, 5, 6], [e, f, 7, 8, 9], [g, h, 10, 11, 12]] I have tried looping this and using splice, split, concat but am having some issue with the logic. Thanks in advance. Here is an idea of where I'm at (this has been modified a little from the last version that was kind of close to working): for(var x = 0; x &lt;arr2.length; x++){ arr1[x] = arr2[x][0].split(" "); // arr1 = arr1[x].concat(2,0,arr2[x+1]); }
tagged with: node.js
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/29716098
has body: I'm starting a project which requires me to create a service which will return a JS file. The JS file I return will be injected into a containing HTML page which I know nothing about. My service will get parameters in the query string which will affect the result returned, in addition I'd like to unify files for easier work. In other words the returned response is dynamic rather than a statically served js file. I was thinking of using an MVC engine (doesn't matter which one), since it simplifies just that - the ability to dynamically edit responses. But trying out different kind of view engines for node and for asp.net mvc, they made all kind of problems since I guess I'm not using them the way they were meant for. Do you know of a solution that can help my needs? maybe a view engine that supports such option, or maybe an entirely different approach. I was thinking maybe I should even write my own view engine, but I'd much rather finding an easier way.
score: 0
linked to: http://stackoverflow.com/q/16092473
has comment: http://stackoverflow.com/comment/47569058
duplicate of: http://stackoverflow.com/q/16092473
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
downvote count: 1
tagged with: node.js
tagged with: model-view-controller
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/47569078
type: Question
has title: A web MVC platform that can dynamically serve js files?
has comment: http://stackoverflow.com/comment/47566963
tagged with: javascript

http://stackoverflow.com/a/29797336
accepted answer of: http://stackoverflow.com/q/29787301
upvote count: 2
has comment: http://stackoverflow.com/comment/48407404
has comment: http://stackoverflow.com/comment/48403554
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29787301
has body: I can, however, bring up a prompt using chrome.fileSystem.chooseEntry({'type': "openDirectory"}) to ask the user to choose a directory, but I can't find a way of saving to that directory. That's what you need to work on. Suppose you declare all the sub-permissions for the fileSystem API: "permissions": [ {"fileSystem": ["write", "retainEntries", "directory"]} ] Then you can: Get an entry from the user: chrome.fileSystem.chooseEntry({'type': "openDirectory"}, function(dirEntry) { // Check for chrome.runtime.lastError, then use dirEntry }); Retain it, so you can reuse it later without asking the user again: dirEntryId = chrome.fileSystem.retainEntry(dirEntry); // Use chrome.storage to save/retrieve it chrome.fileSystem.restoreEntry(dirEntryId, function(entry) { /* ... */ }); Using the HTML FileSystem API, create files in the directory: dirEntry.getFile( "test.txt", {create: true}, // add "exclusive: true" to prevent overwrite function(fileEntry) { /* write here */ }, function(e) { console.error(e) } );
score: 2

http://stackoverflow.com/comment/47541096
comment on: http://stackoverflow.com/a/29701997
has text: @cezar To use template tags in files they have to be served by Django. Maybe there are some ugly workarounds to force Django to also serve `.js` files instead of the usual static ones but imho this is by far more complex than the solution posted above.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47551968
type: Comment
type: QuestionComment
has text: @jeroen oh I see, then is there any alternate solution?
score: 0
comment on: http://stackoverflow.com/q/29708023

http://stackoverflow.com/q/29790450
tagged with: google-chrome
downvote count: 1
type: Question
has title: What changes to be done for making the plugin work for chrome, as NPAPI support will be stopped by Sept 2015
has answer: http://stackoverflow.com/a/29809527
tagged with: javascript
tagged with: browser
answer count: 2
accepted answer: http://stackoverflow.com/a/29809527
tagged with: npapi
favorite count: 0
tagged with: plugins
type: AnsweredQuestion
has body: Recently after the latest chrome update version 42, NPAPI support was disabled by default in Chrome thus effectively dropping support for Silverlight, Java, Facebook Video and other similar NPAPI based plugins.As per the chromium developer docs we can temporarily re-enable NPAPI by overriding via chrome://flags/#enable-npapi(Enable NPAPI). However this option will be there only till Sept 2015.They have also mentioned that this wait is for mission-critical plugins to make transition. We are using an enterprise plugin and we have some dependency on chrome , to make the transition we have to re-implement the plugin. What are the things we need to do for re-implementing and make it work for chrome, guys please shade some light on this.
possible better answer: http://stackoverflow.com/a/29799250
score: 0
has answer: http://stackoverflow.com/a/29799250
upvote count: 1

http://stackoverflow.com/a/29836925
score: 1
has comment: http://stackoverflow.com/comment/47988249
has body: First, establish the first day of the year as a reference date, date0. If the year is 2014, then it looks like this: var date0 = Date.UTC(2014, 0);// Midnight on January 1st, 2014 date0 is the number of milliseconds since 1970. To verify that, you can say console.log(new Date(date0).toUTCString); //&gt; "Wed, 01 Jan 2014 00:00:00 GMT" (Note the use of UTC here. It's best to stick with UTC dates everywhere, because it'll ensure that the user sees the correct date no matter what time zone they're in). Given that, you can easily create a date object for any hour+day of the year like this: // constants var msPerHour = 3600000, msPerDay = 24 * 3600000; var after3days8hours = new Date(date0 + 3 * msPerDay + 8 * msPerHour); console.log(after3days8hours.toUTCString()) //&gt; "Sat, 04 Jan 2014 08:00:00 GMT" So now you can compute a date per CSV row in your dataset: dataset.forEach(function(d) { d.tOutC = +d.tOutC; d.day = +d.day; d.hour = +d.hour; d.date = new Date(date0 + d.day * msPerDay + d.hour * msPerDay) }); That answers question #1. Regarding question #2: Doing all that will enable you to calculate min/max as desired: d3.max(dataset, function(d) { return d.date; }) and d3.min(dataset, function(d) { return d.date; }); Even though d.date is a Date object, JavaScript should cast it back to a number of milliseconds for you. Also, all of the above would work even if you choose to skip instantiating all those Date objects. As in: // without new Date d.date = date0 + d.day * msPerDay + d.hour * msPerDay; But d3.time.scale will need to be passed dates as opposed to numbers, so for example xScale(d.date) would need to be xScale(new Date(d.date)) if d.date is a number. If you ever see console errors coming out of d3, suspect that you might have forgotten about this and passed in a number instead of a Date. For the cx calculation, for any given hour, you'll need to find the midnight of that day. You can either use your d.day like this: .attr("cx", function(d) { return xScale(new…
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48035822
type: Answer
accepted answer of: http://stackoverflow.com/q/29835408
has comment: http://stackoverflow.com/comment/48029381
answers question: http://stackoverflow.com/q/29835408
downvote count: 0

http://stackoverflow.com/q/29767501
answer count: 3
possible better answer: http://stackoverflow.com/a/29767666
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47667023
has answer: http://stackoverflow.com/a/29767666
has comment: http://stackoverflow.com/comment/47666052
has comment: http://stackoverflow.com/comment/47666671
has body: In my slider, I have the problem, that after my fading-effect ends, a part of my rotated container looks like a step. I can provide an example here: http://lamit.webflow.com As you can see in the slider, during the effect, the bottom of my text-bar is smooth. After the transition however, it looks strange. Any Idea on how to get rid of that? Update Since this site is done in webflow, there are some css-errors while analyzing the code (due to some preventions from webflow). The relevant code is below: CSS .mask { left: -2%; top: -50px; display: block; width: 105%; margin-right: auto; margin-left: auto; -webkit-transform: rotate(-3deg); -ms-transform: rotate(-3deg); transform: rotate(-3deg); } HTML Here is some text Thanks
favorite count: 0
has comment: http://stackoverflow.com/comment/47666640
linked to: http://stackoverflow.com/q/26356769
has answer: http://stackoverflow.com/a/29767674
tagged with: css
upvote count: 6
has comment: http://stackoverflow.com/comment/47666853
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47665930
duplicate of: http://stackoverflow.com/q/6492027
has comment: http://stackoverflow.com/comment/47666026
downvote count: 1
has comment: http://stackoverflow.com/comment/47666023
has comment: http://stackoverflow.com/comment/47666056
type: Question
linked to: http://stackoverflow.com/q/20406355
score: 5
has answer: http://stackoverflow.com/a/29767668
linked to: http://stackoverflow.com/q/6492027
accepted answer: http://stackoverflow.com/a/29767674
tagged with: javascript
has title: Browser Anti-Aliasing (smooth lines)
has comment: http://stackoverflow.com/comment/47676278

http://stackoverflow.com/comment/47723437
has text: It is not so clear what you are trying to do... You want several text boxes? You can use array, and make TextBoxFor(x=>x.yourArray[i])
comment on: http://stackoverflow.com/q/29797051
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47623615
comment on: http://stackoverflow.com/a/29744495
score: 0
type: AnswerComment
has text: I think I'm getting close to solving this. It seems that the request that goes to set the currentTeam hasn't returned in time for when I instantiate the controller therefore it's falling over. I need to mock the roleService as well I think as currently i'm using the real service.
type: Comment

http://stackoverflow.com/comment/47570102
has text: @Bergi why don't I need to use ```async.each```? Sorry for daft question just new to node.
score: 0
comment on: http://stackoverflow.com/q/29716895
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47523244
has text: You're welcome. Well, it's not stupid - just rules of jQuery Mobile to determine what is what. Since all solved questions in SO should have accepted answer, either you can delete the question or I can post my comment as an answer, if you are ready to accept it. Or you can improve your own answer so that it will be real answer for this question.
type: Comment
comment on: http://stackoverflow.com/q/29693175
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47744924
has text: `Java != JavaScript`
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29800377

http://stackoverflow.com/comment/47622171
type: QuestionComment
comment on: http://stackoverflow.com/q/29744512
has text: @ahmeaad, what you want to do exactly?
score: 0
type: Comment

http://stackoverflow.com/comment/47740871
type: QuestionComment
score: 0
has text: Files cannot Ajaxically be downloaded. Then I skipped the question :)
comment on: http://stackoverflow.com/q/29800689
type: Comment

http://stackoverflow.com/comment/47536677
type: AnswerComment
has text: Ah! Just made sure both were in there. Worked!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29689721

http://stackoverflow.com/comment/47781870
has text: Thanks, but there is no point of this being a separate answer. And this is true for FF' implementation, not webkit and Blink. Also "illegal string error"... this looks like a "documented bug" with workaround provided. :)
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29827559

http://stackoverflow.com/comment/47724395
score: 0
comment on: http://stackoverflow.com/q/29791414
type: Comment
type: QuestionComment
has text: What have you tried already? The only code you have is a code that initialises an editor. I advise you to read official guides like [CKEditor plugin SDK](http://docs.ckeditor.com/#!/guide/plugin_sdk_intro) and [CKEditor Widgets SDK](http://docs.ckeditor.com/#!/guide/widget_sdk_intro) after which you should not have any problems in changing the placeholder plugins according to your needs.

http://stackoverflow.com/q/29720340
tagged with: php
has comment: http://stackoverflow.com/comment/47575209
has body: Hey guys am new to ajax I have a php file and a ajax file. I just want to detect the php file from the ajax so I have send a request in ajax like &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script&gt; function loadXMLDoc() { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { alert(xmlhttp.responseText); } else { console.log('file not fetched'); } xmlhttp.open("GET","first.php?m=babe",true); xmlhttp.send(); } } loadXMLDoc(); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;/body&gt; &lt;/html&gt; My php file &lt;?php include("ajax.html"); $p = $_REQUEST['m']; if($p == 'babe') { echo true; } When I run the ajax.html on localhost it doesn't show me any message in the window nor in the console. Can you guys tell me why is it like this? Thanx for the help
type: AnsweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/47575239
has comment: http://stackoverflow.com/comment/47575415
type: Question
has comment: http://stackoverflow.com/comment/47575225
has comment: http://stackoverflow.com/comment/47575399
accepted answer: http://stackoverflow.com/a/29720525
has comment: http://stackoverflow.com/comment/47575518
score: -2
has comment: http://stackoverflow.com/comment/47575347
has comment: http://stackoverflow.com/comment/47575539
tagged with: javascript
has comment: http://stackoverflow.com/comment/47575308
has comment: http://stackoverflow.com/comment/47575498
has comment: http://stackoverflow.com/comment/47575357
has title: Cant detect the file in ajax
upvote count: 0
has comment: http://stackoverflow.com/comment/47575297
answer count: 1
has comment: http://stackoverflow.com/comment/47575373
has comment: http://stackoverflow.com/comment/47575659
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47575188
has comment: http://stackoverflow.com/comment/47575440
has answer: http://stackoverflow.com/a/29720525
has comment: http://stackoverflow.com/comment/47575172

onclicklistener
tag name: onclicklistener
tags question: http://stackoverflow.com/q/29809718
tags question: http://stackoverflow.com/q/29725608
type: Tag

http://stackoverflow.com/a/29825566
downvote count: 0
answers question: http://stackoverflow.com/q/29825207
accepted answer of: http://stackoverflow.com/q/29825207
type: Answer
upvote count: 2
has body: There is no need to load the calculate.js file on the click event. Just load it with the page load like so: HTML: JS: // This is inside somefile.js $("#option_one").click(function() { $("#input").val('Option 1'); // This function is inside calculate.js calculate(); });
score: 2
type: AcceptedAnswer

http://stackoverflow.com/a/29700787
upvote count: 2
has comment: http://stackoverflow.com/comment/47538130
type: Answer
accepted answer of: http://stackoverflow.com/q/29700151
score: 2
has body: The value of z will be evaluated before the xmlhttp object receives the readystate change. You need to put all the code that deals with the returned value into a onreadystatechange function itself, since that is the only function which is guaranteed to be called after you receive an asynchronous response. You could do something like this: var xmlhttp = false; // The rest of your code, but remove the `onreadystatechange` assignment from ajaxSession() // ... // ... function heartCheck() { perform = 2; stateCheck(); xmlhttp.onreadystatechange = function() { z = xmlhttp.responseText; if (z == 'added') { document.getElementById("favorite").src="http://www.********.com/images/favorite-on.png"; document.getElementById("favtext").innerHTML="This is a favorite!"; } if (z == 'subtracted') { document.getElementById("favorite").src="http://www.********.com/images/favorite-off.png"; document.getElementById("favtext").innerHTML="Add to your favorites."; } } } And you'd need to do a handler like that for each time you want to evaluate the AJAX response. It'd also be most clear to declare the global variables at the beginning of the script like I did above--as @jeroen mentions, it's not explicitly required, but it's good practice and will help you keep track of scope. It's confusing that z is only defined inside the xmlhttp.onreadystatechange function, yet you're using it throughout the script globally. So a simple tip is to put var z = '' at the beginning of your JavaScript to make your intentions clearer (both to yourself and to others who may be viewing your code :))
has comment: http://stackoverflow.com/comment/47538129
answers question: http://stackoverflow.com/q/29700151
has comment: http://stackoverflow.com/comment/47538035
type: AcceptedAnswer
downvote count: 0

slick.js
tag name: slick.js
type: Tag
tags question: http://stackoverflow.com/q/29692770

http://stackoverflow.com/q/29792839
upvote count: 1
type: Question
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/29793068
answer count: 2
tagged with: for-loop
has answer: http://stackoverflow.com/a/29796664
has body: Am having an arrray of Objects which again contains the id's of the parent Object: eg:- $scope.result=[ { "id": 1, "name": ABC, "type": PQR, "parentId": 2 }, { "id": 2, "name": ABC, "type": PQR, "parentId": 1 }] I would like to convert this JSON in to the following wherin I will be having the parentObject in place of parentId's $scope.result=[ { "id": 1, "name": ABC, "type": a, "parentId": { "id": 2, "name": PQR, "type": b, "parentId": 1 } }, { "id": 2, "name": PQR, "type": b, "parentId": { "id": 1, "name": ABC, "type": a } } ] Can anybody help me with this conversion..
tagged with: arrays
downvote count: 0
tagged with: javascript
has title: Populate parent Object by comparing parent Array
has answer: http://stackoverflow.com/a/29793068
favorite count: 0
possible better answer: http://stackoverflow.com/a/29796664

http://stackoverflow.com/a/29822952
downvote count: 0
type: Answer
upvote count: 1
has body: Thanks all! $('a.externallink').click(function(e){ $.ajax({ url: "/count.php?id="+id }); });
answers question: http://stackoverflow.com/q/29821676
score: 1

http://stackoverflow.com/comment/47728223
type: AnswerComment
comment on: http://stackoverflow.com/a/29799526
score: 0
type: Comment
has text: @KDJ added separate fade in out version (having both at once is only additional mess in code)

http://stackoverflow.com/comment/47661256
has text: I suggest that you forget jquery. Your example doesn't require it.
comment on: http://stackoverflow.com/q/29764264
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29723710
downvote count: 0
score: 7
tagged with: ionic-framework
type: Question
has title: How to open a webview inside a frame in Ionic?
accepted answer: http://stackoverflow.com/a/29772140
tagged with: javascript
has comment: http://stackoverflow.com/comment/47581697
upvote count: 7
answer count: 1
has answer: http://stackoverflow.com/a/29772140
favorite count: 0
tagged with: angularjs
has body: What I need is to load HTML code inside a frame in a page in an Ionic app, without opening a new window or covering the rest of the page. The idea is to have a frame that opens a web page without covering or disrupting the rest of the page like the header, buttons, etc. Basically, what I want to do is the equivalent to an Android WebView in an Ionic framework app. Is this possible? There is no much code, is a simple "message details" page for a messaging app, is just that the messages have to be displayed as a web page. I need to show the header with the top buttons and the webview below them.
has comment: http://stackoverflow.com/comment/47648379
type: AnsweredQuestion

http://stackoverflow.com/a/29802985
type: Answer
has comment: http://stackoverflow.com/comment/47766506
score: 5
upvote count: 5
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29793689
has body: Possible workaround You could try getting around by creating a bitmap image from the SVG first via canvas, then use that canvas as image source for the pattern: var img = new Image(); img.onload = function() { // canvas image source for pattern: var svgCanvas = document.createElement("canvas"); svgCanvas.width = this.width; svgCanvas.height = this.height; // draw in the SVG to canvas var svgCtx = svgCanvas.getContext("2d"); svgCtx.drawImage(this, 0, 0, this.width, this.height); // use canvas as image source instead var pattern = badge.createPattern(svgCanvas, 'repeat'); badge.fillStyle = pattern; // draw 'badge' shape badge.fill(); }; img.src = '../flags/iso/'+country+'.svg';
answers question: http://stackoverflow.com/q/29793689

http://stackoverflow.com/comment/47749072
has text: is there a way to keep the url and data options distinct using `apply` rather than `call`?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29810190

http://stackoverflow.com/comment/47725099
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29798452
has text: Thanks for the reply.Like i told in my Question I am using pure Js event and triggers. Had i been using jQuery I would'nt have posted this question.
type: Comment

http://stackoverflow.com/q/29775355
tagged with: fullpage.js
accepted answer: http://stackoverflow.com/a/29792586
type: AnsweredQuestion
type: Question
upvote count: 5
tagged with: javascript
has title: Prevent scrolling back to first slide after scrolled past
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/29775683
has answer: http://stackoverflow.com/a/29792586
has answer: http://stackoverflow.com/a/29775683
has body: I'm using fullpage.js and was wondering how I would go about preventing the user from scrolling back to the initial (first) slide after they've scrolled past it? I still want to be able to scroll between all subsequent slides as intended, but essentially remove the first slide once past it so that it cannot be scrolled back up (basically making the second slide the first, as if the first is no longer there). Hopefully this makes sense? The first slide is basically an intro/video slide and I only want it shown on initial page load, then after scrolled passed for it to no longer be accessible.
score: 5

http://stackoverflow.com/comment/47749436
type: Comment
comment on: http://stackoverflow.com/a/29791459
score: 5
has text: Omg... you should write the d3 API doc, brilliant, totally make sense. Thanks heaps :)
type: AnswerComment

http://stackoverflow.com/comment/47713570
score: 0
comment on: http://stackoverflow.com/q/29761289
type: Comment
type: QuestionComment
has text: Could you just check if the the value is sent *before* using your function? I mean, check if "clientPackagedService_id" is in POST, if not add to the model like this: $model->clientPackagedService_id = '';, and then use your function...

http://stackoverflow.com/comment/59794017
type: AnswerComment
has text: @Lion King Holly cow! The margin zero saved my life... thanks!!!!! In my case also I had heigth:100% too. Thanks
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29719278

http://stackoverflow.com/q/29728757
score: 0
has comment: http://stackoverflow.com/comment/47591318
has comment: http://stackoverflow.com/comment/47591296
has comment: http://stackoverflow.com/comment/47591272
type: UnansweredQuestion
has title: Capture word starting and ending with colon
tagged with: regex
has answer: http://stackoverflow.com/a/29728787
has body: My requirement is to capture the words starting and ending with colon (:) character. Can you help me making refer for that. I tried \b\:.*\:\b but it didn't work
has comment: http://stackoverflow.com/comment/47591354
has answer: http://stackoverflow.com/a/29728848
has comment: http://stackoverflow.com/comment/47591217
type: Question
has comment: http://stackoverflow.com/comment/47591298
answer count: 2
has comment: http://stackoverflow.com/comment/47591240
tagged with: javascript

http://stackoverflow.com/comment/47734003
has text: I haven't looked at your code in detail, but just a quick question: Do you have backface culling enabled?
comment on: http://stackoverflow.com/q/29802400
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47706393
comment on: http://stackoverflow.com/a/29787739
type: AnswerComment
type: Comment
score: 1
has text: Thank you this was very easy to follow!

http://stackoverflow.com/q/29722310
tagged with: parse-platform
tagged with: angularjs
score: 0
type: UnansweredQuestion
tagged with: charts
has comment: http://stackoverflow.com/comment/47581513
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47579443
has answer: http://stackoverflow.com/a/29723214
has title: Javascript: Create Google Chart on Submit
has body: I am using parse and Google charts with Javascript in order to graph some data. What I want is for the user to select some options from a dropdown field, which then create the charts based on their selection. However, the chart does not appear at all upon pressing submit. Note that I am using angularJS to show/hide the potential for the chart upon login. However, the chart is created outside of the AngularJS portion. Relevant HTML: Sign Up or Log In Username: Password: Sign up Log in Welcome {{currentUser.get('username')}} Charts Log out Before: All Eating Exercise Sleep Low Movement After: All Eating Exercise Sleep Low Movement Submit Relevant Javascript: //Chart the data function chartData(){ google.load('visualization', '1', {'packages':['annotatedtimeline']}); } google.setOnLoadCallback(drawChart); //Identify user before/after filter selection function drawChart() { //Variables for chart drawing var lowerLimit = 70; var upperLimit = 100; //Global calculation variables var totReadings = 0; var belowLimit = 0; var aboveLimit = 0; //Identify the user var userString = Parse.User.current().getUsername().toString(); //Retrieve data from parse var Readings = Parse.Object.extend("Readings"); var query = new Parse.Query(Readings); //set constraints on the query. query.equalTo('username', userString); //Add these depending on user input var b = document.getElementById("b_sel"); var beforeAct = b.options[b.selectedIndex].value; var a = document.getElementById("a_sel"); var afterAct = a.options[a.selectedIndex].value; if(beforeAct != "all") query.equalTo('before', beforeAct); if(afterAct != "all") query.equalTo('after', afterAct); query.ascending("createdAt"); //Prepare the data columns var data = new google.visualization.DataTable(); data.addColumn('date', 'Date'); data.addColumn('number', 'Reading (mg/dl)'); data.addColumn('number', 'Lower Limit'); data.addColumn('number', 'Upper Limit'); //Run the query and graph the data query.find({ //Success callback success: function…

http://stackoverflow.com/a/29712235
score: 2
has comment: http://stackoverflow.com/comment/47560287
has comment: http://stackoverflow.com/comment/47560741
answers question: http://stackoverflow.com/q/29712197
downvote count: 0
has comment: http://stackoverflow.com/comment/47560762
type: Answer
upvote count: 2
has body: To execute a javascript using NodeJS you have to use the node &lt;filename&gt; command from the command prompt/terminal. You're using a relative path. Change node server.js to node "/full/path/to/server.js". For example, if server.js is located in C:\myserver\server.js, then run: node "C:\myserver\server.js"

http://stackoverflow.com/a/29765791
has comment: http://stackoverflow.com/comment/47676828
score: 0
answers question: http://stackoverflow.com/q/29765640
has comment: http://stackoverflow.com/comment/47663133
type: Answer
has comment: http://stackoverflow.com/comment/47676885
has body: Push is a method on array. $scope.objName is a string. So you get the error that you are getting. Word of caution: the way that you have written code will soon land you in trouble. I am talking about if else part for constructing the variable.

http://stackoverflow.com/comment/47634972
type: AnswerComment
comment on: http://stackoverflow.com/a/29749867
score: 0
type: Comment
has text: Thanks! But i want to show like a background image with all free slots available and make them clickable.

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

http://stackoverflow.com/a/29742115
accepted answer of: http://stackoverflow.com/q/29741944
type: AcceptedAnswer
downvote count: 0
score: 5
type: Answer
has body: You can pass an array to the 'require' property of your directive definition, which includes both your child directive, and your parent directive. The 4th parameter to your link function will be an array: app.directive('childDirective', function() { require: ['childDirective', '^parentDirective'], link: function(scope, element, attr, ctrls) { var childCtrl = ctrls[0]; var parentCtrl = ctrls[1]; ... } });
answers question: http://stackoverflow.com/q/29741944
upvote count: 5

http://stackoverflow.com/comment/47652970
score: 0
type: Comment
type: QuestionComment
has text: this doesn't look like a meaningful matching, what are you *actually* trying to do? Or are you just curious about why the pattern matches the way it does?
comment on: http://stackoverflow.com/q/29760408

http://stackoverflow.com/comment/47739767
comment on: http://stackoverflow.com/a/29756544
has text: I may have misread this answer then, but you may find it helpful: http://stackoverflow.com/a/1430890/2466782 . Also, if you have database access, you could try the approach I recommended. SSE tells clients to send ajax call to server > During each clients ajax call, increment 'clientCount' entry in the database on the server side. Then in a while loop, check clientCount until it reaches the total number of connected clients and return your server message to the client. If I think of better suggestions, I'll let you know. I know it can be a pain working within such limitations
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29732392
has comment: http://stackoverflow.com/comment/47598466
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29728631
type: Answer
has comment: http://stackoverflow.com/comment/47640898
score: 6
upvote count: 6
has body: Problems The first thing to point out here is how you use the requestID to set the alpha. From MDN (my emphasis): A long integer value, the request id, that uniquely identifies the entry in the callback list. This is a non-zero value, but you may not make any other assumptions about its value. You can pass this value to window.cancelAnimationFrame() to cancel the refresh callback request. In other words, don't assume this will keep a running value equivalent to current index of the cell. It may do so in one browser, accidentally, but no in another. Keep track of this value by other means. Second, the globalAlpha works on the entire context for anything drawn next to it. This means you need to track current alpha per square, or use a color style rgba which allow you to set alpha per style. This doesn't matter so much though as you need to track alpha also here. One solution I would suggest using an object for this, a square-monkey which can be trained to set its alpha correctly, then duplicated across a grid. Example Main object will keep track of all settings such as current alpha, how much to update, what color and so forth. It's of course not limited to these alone - you could add scale, rotation etc. to it as well, but here I'll only show for alpha: // Square-monkey object function Rectangle(ctx, x, y, w, h, color, speed) { this.ctx = ctx; this.x = x; this.y = y; this.height = h; this.width = w; this.color = color; this.alpha = 0; // current alpha for this instance this.speed = speed; // increment for alpha per frame this.triggered = false; // is running this.done = false; // has finished } To save some memory and increase performance we can use prototypes for the common functions/methods: Rectangle.prototype = { trigger: function() { // start this rectangle this.triggered = true }, update: function() { if (this.triggered &amp;&amp; !this.done) { // only if active this.alpha += this.speed; // update alpha this.done = (this.alpha &gt;= 1); // update status } this.…
answers question: http://stackoverflow.com/q/29728631

http://stackoverflow.com/q/29826448
has body: How I can hide one or two items from the bootstrap-carousel only on xs-size ? When I added class 'hidden-xs' to this item in carousel and item div looks like: All the items and the carousel disappeared. The same problem exist when i add 'hidden-xs' class to img element for this item. How can I fix that ? I want to hide on xs only one or two slides. Others must by visible. My code looks like: Previous Next
type: Question
score: 5
upvote count: 6
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/32185434
answer count: 3
downvote count: 1
has title: Bootstrap carousel how to hide one item from slider on xs size?
favorite count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/44034873
tagged with: css
has answer: http://stackoverflow.com/a/29826777
tagged with: twitter-bootstrap-3

http://stackoverflow.com/comment/47514203
type: AnswerComment
has text: `document.getElementById("link").src = ('//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&amp;OneJS=1&amp;Operation=GetAdHtml&amp;MarketPlace=US&amp;source=ac&amp;ref=tf_til&amp;ad_type=product_link&amp;tracking_id=ow-20&amp;marketplace=amazon&amp;region=US&amp;placement=B004BCXAM8&amp;asins=B004BCXAM8&amp;linkId=SK5UG2J5CK4WNOKE&amp;show_border=true&amp;link_opens_in_new_window=true').replace(/amp;/g, '');`
type: Comment
comment on: http://stackoverflow.com/a/29688392
score: 0

http://stackoverflow.com/comment/47590275
score: 0
has text: Not a good idea. USe jQUery now you have it. And why is it better for you to have the handler inside the brackets than outside? Tell us more WHY you want this
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29728254

http://stackoverflow.com/a/29719550
type: Answer
has body: Edit As others have pointed out, you could assign the text inline, when you created the paragraph. If you need the ability to update the text later (multiple times) you could do this: // Store a reference to your new paragraph var p = $('&lt;p&gt;', { 'class': 'myClass', 'data-colour': 'green' }); // Treat it like you would treat any other jQuery-wrapped element p.text("Your text goes here..."); // Append it like before $('#container').append(p);
has comment: http://stackoverflow.com/comment/47573714
answers question: http://stackoverflow.com/q/29719537
has comment: http://stackoverflow.com/comment/47573710
score: 0

http://stackoverflow.com/q/29721161
has comment: http://stackoverflow.com/comment/47576897
type: Question
tagged with: javascript
has title: Hide an element when a user clicks outside of it
upvote count: 3
answer count: 2
possible better answer: http://stackoverflow.com/a/29721365
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47576929
has body: $( document ).on('click', '.toggle_comments', function( event ){ event.preventDefault(); var container = $('div[name="comments"]'); if ( container.css('display') == 'block' ) { container.hide(); return; } container.fadeIn(500); }); When .toggle_comments is clicked, the container fades in. Is there a way to do something, ie fadeout, if anything outside the container is clicked WHILE it's display block? Bearing in mind, obviously, that .toggle_comments is outside of it in the first place. So it needs to be a live event, something that only fires while the container is in the state if display:block.
type: AnsweredQuestion
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/29721201
accepted answer: http://stackoverflow.com/a/29721201
has answer: http://stackoverflow.com/a/29721365

http://stackoverflow.com/q/29812251
tagged with: asp.net-mvc
tagged with: tag-it
has answer: http://stackoverflow.com/a/29812936
tagged with: javascript
tagged with: jquery
has title: MVC View foreach list with tag-it (SO style tagging)
accepted answer: http://stackoverflow.com/a/29812936
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 1
favorite count: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/47753089
has body: I am populating a table in my MVC View with some check boxes and I was looking to use tag-it to get the same effect as SO. Just wondering if there is anyone out there that would know how to incorporate my foreach method with tag-it so that when a tag is typed it first populates with whatever comes from my list and second makes it "selected" if its a chosen typed out field. Tag1 Tag2 View: @{ int cnt = 0; List<MyBlogger.Models.Tag> tag = ViewBag.Tags; foreach (var tags in tag) { if (cnt++ % 3 == 0) { @: } @: @tags.Id @: @tags.Name @: } @: }
type: AnsweredQuestion
score: 1
type: Question
has comment: http://stackoverflow.com/comment/47815195

http://stackoverflow.com/a/29824061
has comment: http://stackoverflow.com/comment/47778271
type: Answer
answers question: http://stackoverflow.com/q/29823766
downvote count: 0
score: 1
has body: You can do something like: var w = angular.element($window); w.bind('resize', function () { // set dimensions here with w.width() and w.height() $('body').css("width", w.width()); // in your case });
upvote count: 1

http://stackoverflow.com/comment/47799180
type: Comment
comment on: http://stackoverflow.com/a/29836125
score: 0
type: AnswerComment
has text: Nothing =/. I'm seeing in my application exactly like this -> http://codepen.io/anon/pen/KpKrmN , but the negative margin-left exist in the css..

http://stackoverflow.com/comment/47514462
type: Comment
comment on: http://stackoverflow.com/a/29688309
has text: I mean the original code is different as well: ` ` Sorry about the confusing.
type: AnswerComment
score: 0

http://stackoverflow.com/a/29795381
has body: you can use underscore js union and uniq to do that. var mergedArray = _.uniq(_.union(c1, c2), false, function(item, key, a){ return item; });
has comment: http://stackoverflow.com/comment/47720941
type: Answer
upvote count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/47720543
score: 1
has comment: http://stackoverflow.com/comment/47720589
answers question: http://stackoverflow.com/q/29795127
has comment: http://stackoverflow.com/comment/47720431

http://stackoverflow.com/a/29739169
has comment: http://stackoverflow.com/comment/56430843
has comment: http://stackoverflow.com/comment/73524099
accepted answer of: http://stackoverflow.com/q/29737384
score: 20
has comment: http://stackoverflow.com/comment/66473254
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29737384
has comment: http://stackoverflow.com/comment/66398883
has comment: http://stackoverflow.com/comment/71190904
type: Answer
has comment: http://stackoverflow.com/comment/73580501
has body: Application.js is not evaluated in the context of any session variables or methods. The simplest way to access username from javascript would be to set a cookie in a before_action on application controller: class ApplicationController &lt; ActionController::Base before_action :set_user private def set_user cookies[:username] = current_user.name || 'guest' end end Then from any js in app/assets you can access the cookie: alert(document.cookie); A more verbose but arguably cleaner method would be to create a route that accesses the current user and returns the username e.g. routes.rb get 'current_user' =&gt; "users#current_user" users_controller.rb def current_user render json: {name: current_user.name} end application.js $.get('/current_user', function(result){ alert(result.name); });
upvote count: 21
downvote count: 1
has comment: http://stackoverflow.com/comment/66304240

http://stackoverflow.com/comment/47639673
score: 0
type: AnswerComment
type: Comment
has text: I have a transition property in the CSS so it slides out to the right but thanks for your answer
comment on: http://stackoverflow.com/a/29753804

http://stackoverflow.com/comment/47762387
has text: by using $interval.cancel($scope.intervalPromise) it stops the timer rather than resetting it.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29817578

http://stackoverflow.com/q/29751266
type: Question
has comment: http://stackoverflow.com/comment/47634622
answer count: 2
has answer: http://stackoverflow.com/a/29751317
tagged with: javascript
score: 0
has body: I need to display the values with two decimal format . When displaying values why the toFixed function is not working in this case I am getting the following error under browser console Uncaught TypeError: tax_value.toFixed is not a function This is my code var orderjson = { "display": { "ServiceCharge": "1", "ServiceTax": "2", "order": [ "ServiceCharge", "ServiceTax", "VAT", "DISCOUNT" ], "VAT": "3", "OTH1": "4", "DISCOUNT": "5" } } var orderOfDisplay = orderjson.display.order; var ServiceCharge = orderjson.display.ServiceCharge; var ServiceTax = orderjson.display.ServiceTax; var VAT = orderjson.display.VAT; var OTH1 = orderjson.display.OTH1; var DISCOUNT = orderjson.display.DISCOUNT; var htmldata = ''; for(var i=0;i<orderOfDisplay.length;i++) { var tax_value = orderjson.display[orderOfDisplay[i]]; tax_value = tax_value.toFixed(2); htmldata+= ' '+orderOfDisplay[i]+' \ Rs. '+tax_value+' \ '; } $("#tableid").append(htmldata); http://jsfiddle.net/2kbet2hL/9/ Could anybody please let me know how to display with two decimal points in this case
has comment: http://stackoverflow.com/comment/47634638
possible better answer: http://stackoverflow.com/a/29751484
accepted answer: http://stackoverflow.com/a/29751317
has answer: http://stackoverflow.com/a/29751484
has title: Why the .toFixed(2) is not working in this case
has comment: http://stackoverflow.com/comment/47634645
type: AnsweredQuestion

http://stackoverflow.com/comment/47604399
comment on: http://stackoverflow.com/q/29733308
score: 0
has text: @sitilge Well I found the apache error log, although that link you provided just explains what an error log is, which wasn't incredibly helpful... But the apache error log does not contain any information about php script errors or MySQL issues, it just says when the apache service was started or stopped. I think you misunderstood me when I said the google chrome dev console was blank. I did not mean the page was blank. Do you understand what kind of issue I'm having?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47714506
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29792914
score: 1
has text: Displaying the relevant source code would help. "if a user changes an option **next to it**" Next to what? "**This** is nested in a loop" What is? You need to give us something to debug before we can tell you where you're going wrong and how to fix it. No source code = nothing to work with. It really is that simple.

http://stackoverflow.com/a/30136836
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29797051
accepted answer of: http://stackoverflow.com/q/29797051
type: AcceptedAnswer
has body: Razor code is parsed on the server before it is sent to the view. Javascript is client side code and is not executed until the browser receives the view. This line of code @Html.TextAreaFor(x =&gt; x.SerialNumber, new { id = "sns" + i }) means that on the server you are trying to generate a textarea and set the id attribute to a value that includes a javascript variable which does not yet exist. Its unclear even what the point of this would be. id attributes serve as selectors in javascript. Whats important is the name and value attributes when it comes to posting your data, and even if it could work, your generating duplicate name attributes which could not bind to you models collection property on post back. For dynamically generating the html for collections, your name attributes need an indexer, for example &lt;input type="text" name="[0].SerialNumber" /&gt;. Options for dynamically creating the html include using the BeginCollectionitem() helper, or a pure client side approach is shown in this answer If all you are doing is post back an array of strings (the serial numbers) then you could use var div = $("#divSerialNumbers"); // cache it $('#Quantity').change(function() { // assumes you remove the pointless 'new { @id = "txtQty" }' var quantity = parseInt($(this).val()); // use $(this) - don't traverse the DOM all over again if (!isNan(quantity) &amp;&amp; quantity &gt; 0) { // must check for NAN // note it does not seem necessary to use a table, as opposed to simply adding 4 inputs to the div, but div.empty(); // clear existing contents var table = $('&lt;/table&gt;'); for (i = 1; i &lt;= quantity; i++) { var input = $('&lt;input&gt;').attr('name', 'SerialNumber'); var cell = $('&lt;/td&gt;').append(input); var row = $('&lt;/tr&gt;').append(cell); table.append(row); } div.append(table).show(); // add the table and display it } }) and your controller would need a parameter string[] SerialNumber, for example public ActionResult Edit(string[] SerialNumber)

http://stackoverflow.com/comment/47622440
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29744631
has text: Can you create a fiddle so we can test

http://stackoverflow.com/q/29795636
linked to: http://stackoverflow.com/q/4083351
has body: I'm starting to learn how to create a jquery plugin where the documentation recommend me to use $.fn For example: $.fn.greenify = function() { this.css( "color", "green" ); }; $( "a" ).greenify(); // Makes all the links green. Then my question is, what is the advantage of using $.fn? Why can't I just assign a new variable to it and achieve the same result if they just want to be able to call that function like so: var greenify = function() { this.css( "color", "green" ); }; $( "a" ).greenify(); // Makes all the links green.
duplicate of: http://stackoverflow.com/q/4083351
score: 0
tagged with: function
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: plugins
has answer: http://stackoverflow.com/a/29795737
has comment: http://stackoverflow.com/comment/47719665
type: UnansweredQuestion
has title: $.fn and named variable difference?
type: Question

http://stackoverflow.com/a/29732975
upvote count: 3
has body: or just do this .modal{ bottom: initial!important; } https://jsfiddle.net/DTcHh/6811/ run this
accepted answer of: http://stackoverflow.com/q/29732640
has comment: http://stackoverflow.com/comment/47599283
has comment: http://stackoverflow.com/comment/47599237
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29732640
type: Answer
has comment: http://stackoverflow.com/comment/47599270
has comment: http://stackoverflow.com/comment/47607914
score: 3

apache
tag name: apache
tags question: http://stackoverflow.com/q/29808726
tags question: http://stackoverflow.com/q/29816276
type: Tag
tags question: http://stackoverflow.com/q/29809751

http://stackoverflow.com/q/29742659
linked to: http://stackoverflow.com/q/5443436
has title: Search within multilevel json tree using multiple keys
favorite count: 0
has answer: http://stackoverflow.com/a/29744960
tagged with: tree
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47618617
has body: I have a json tree with following structure { "treeId": "avhsgdkendkfhjsdoiendsj", "groupResponse": { "description": null, "id": "avhsgdkendkfhjsdoiendsj", "mAttr": null, "mAttrVal": null }, "childResponse": [ { "treeId": "6p263uh38xvnchmsrw2jn48ut", "childResponse": [], "groupResponse": { "description":null, "id ":"6p263uh38xvnchmsrw2jn48ut", "mAttr": "xxx", "mAttrVal": "222" } }, { "treeId": "2fywxwi93lg7fqggdqqpqxvpg", "childResponse": [], "groupResponse": { "description ":null, "id": "2fywxwi93lg7fqggdqqpqxvpg", "mAttr": "xxx", "mAttrVal": "111" } } ] } I want to search for a node based on single/multiple key(s) e.g. { "mAttr": "xxx", "mAttrVal","222"} I found a solution mentioned in this answer Object.prototype.findKey = function(keyObj) { var p, key, val, tRet; for (p in keyObj) { if (keyObj.hasOwnProperty(p)) { key = p; val = keyObj[p]; } } for (p in this) { if (p == key) { if (this[p] == val) { return this; } } else if (this[p] instanceof Object) { if (this.hasOwnProperty(p)) { tRet = this[p].findKey(keyObj); if (tRet) { return tRet; } } } } return false; }; It can search based on any single key. How to modify it to work with multiple keys? There is no limit to the depth of my tree.
downvote count: 1
accepted answer: http://stackoverflow.com/a/29744960
type: Question
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: jquery
score: -1
possible better answer: http://stackoverflow.com/a/29743049
has comment: http://stackoverflow.com/comment/47618579
has answer: http://stackoverflow.com/a/29743049

http://stackoverflow.com/comment/47545096
score: 0
type: Comment
has text: What do you mean by "you could dynamically move those ad units around the page"? Does that mean the EliteDaily has dome "publishing deal" with google that is why they could load more than 3 ad units on their page via infinite loader?
comment on: http://stackoverflow.com/a/29691840
type: AnswerComment

http://stackoverflow.com/q/29826182
has answer: http://stackoverflow.com/a/29826297
has title: How to wait for all items to load within ng-repeat before then rendering a chart for each item
upvote count: 2
has body: I am using ng-repeat to show a load of report items on the page. Each item has a load of numbers so we want to show a little chart with each item. I have set up a directive to render the chart inside each item and pass in the data to the directive. When it comes to rendering the chart however, I am relying on a button to force an update: App.controller('ScoringPolarCtrl', ["$scope", function($scope){ $scope.forceUpdate = function () { console.log("Attempting to render chart ID: " + itemId); var ctx = document.getElementById(itemId).getContext("2d"); $scope.scoreChart = new Chart(ctx) $scope.scoreChart.PolarArea($scope.scoreChartData, $scope.itemScoreChartOptions); }; }]); This works, but what I would like to do is somehow get the chart to render without relying on the forceUpdate() function. The items are all pulled down from a web service using $http so it takes a few seconds for them to appear on the page and thus for the element to actually be available on the page for chart.js to use. I have tried playing with angular.element(document).ready() to no avail. Is there any other way I can force the controller to wait until all the items are there first and then render the charts?
answer count: 1
tagged with: javascript
favorite count: 0
downvote count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29826297
type: Question
score: 2
has comment: http://stackoverflow.com/comment/47781185
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47778920
tagged with: chart.js

http://stackoverflow.com/a/29713877
type: Answer
answers question: http://stackoverflow.com/q/29708572
has comment: http://stackoverflow.com/comment/47606034
has comment: http://stackoverflow.com/comment/47733103
has body: Your data-main should point to a module instead of a directory. Try changing it to data-main="javascript/moduli/main". That probably won't solve everything since you don't include your configuration in configurazione.js anywhere.
score: 0
has comment: http://stackoverflow.com/comment/47569085
has comment: http://stackoverflow.com/comment/47605880
has comment: http://stackoverflow.com/comment/47574861

http://stackoverflow.com/comment/47684180
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29773509
score: 0
has text: Inspect the dom, when you've changed the width what are the changes on your drop div, what other changes are present on that element, that aren't present without the width change?

http://stackoverflow.com/a/29702968
type: Answer
has comment: http://stackoverflow.com/comment/47542273
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/29702511
answers question: http://stackoverflow.com/q/29702511
type: AcceptedAnswer
downvote count: 0
has body: This line: window.onload = new newCard; is: Invoking newCard as a constructor (which it isn't) Assigning the object created from it to onload Since you are invoking newCard there, it runs before you reach the next line: var usedNums= new Array(76); So usedNums is undefined when you try to read from it. You need to assign the newCard function as your load handler. So don't invoke it: window.onload = newCard;

http://stackoverflow.com/comment/47645377
comment on: http://stackoverflow.com/q/29756278
has text: It's not clear what you are asking...
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/47590303
comment on: http://stackoverflow.com/a/29727970
has text: Thanks for the resource. Yeah, like others before me, I am weaning off of the word "new" and classical inheritence way of things. However as you know, some of this stuff is out in the wild, so its still relevant in my oppinion to know such things.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29751906
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29751852
type: Answer
score: 1
has body: attributes is not a jquery property. Try plot.get(0).attributes this way you can use the attributes property on your element and not on a jquery object. $(xml).find("movie"); //returns jquery object $(plot) // is a jquery object of a jquery object. You really want your object to be a jquery object aye? get(index): Description: Retrieve one of the elements matched by the jQuery object. In other words, your get returns an actual element.
upvote count: 1
has comment: http://stackoverflow.com/comment/47640531
accepted answer of: http://stackoverflow.com/q/29751852

http://stackoverflow.com/q/29730312
tagged with: for-loop
has title: How to push items into an angular $scope.array?
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/29730340
downvote count: 0
has answer: http://stackoverflow.com/a/29730489
favorite count: 0
has comment: http://stackoverflow.com/comment/47594530
has answer: http://stackoverflow.com/a/29730438
has comment: http://stackoverflow.com/comment/47594191
tagged with: angularjs
has body: I'm doing something wrong yet I cannot see what (this is probably due to my low AngularJS skills). I have a simple ng-repeat in my HTML: &lt;ul&gt; &lt;li ng-repeat="fot in fotografia"&gt;&lt;img src="{{fot.path}}"&gt;&lt;/li&gt; &lt;/ul&gt; and here is my app.js: myApp.controller('homeController', function($scope) { // fotografia = []; is here only because I get an error otherwise, // which means my later for loop can't access the $scope.fotografia fotografia = []; $scope.fotografia = [ {path:'img/fotografia/fot_1.jpg'}, {path:'img/fotografia/fot_2.jpg'} ]; // I want to add more images with this: for(var i=0; i&lt;5; i++) { fotografia.push({ path: 'img/fotografia/fot_'+[i]+'.jpg' }); } }); Ng-repeat works fine with the 2 images I already have in my array (fot_1.jpg, fot_2.jpg). The loop is the the problem. How do I go about pushing more items into my array?
has comment: http://stackoverflow.com/comment/47594156
possible better answer: http://stackoverflow.com/a/29730438
accepted answer: http://stackoverflow.com/a/29730340
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question

http://stackoverflow.com/q/29814340
favorite count: 0
tagged with: backbone.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47776032
tagged with: url-routing
has comment: http://stackoverflow.com/comment/47805762
answer count: 0
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47805723
downvote count: 0
has title: Double Click of the browser back button not working
tagged with: javascript
has comment: http://stackoverflow.com/comment/47821830
has comment: http://stackoverflow.com/comment/47816310
has body: Is there a way that I can detect and stop the double click of the browser back button? Right now I have a scenario where, I am using Backbone.js for routing aspects. When the user clicks the browser back button, it routes to the proper url/page. Whereas , if he double clicks, the session expires. Can anybody throw some light on this. All so it must be noted that the page reload even on double click shows the user session as logged in(correct behaviour)
score: 1

http://stackoverflow.com/comment/47517216
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29690282
type: Comment
has text: I dont want to use library just for comparison.. only javascript

http://stackoverflow.com/a/30249436
accepted answer of: http://stackoverflow.com/q/29756835
answers question: http://stackoverflow.com/q/29756835
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
has body: I have used a different approach and since have gotten the links working. I had to use a table to output the data and then everything worked fine. I'm not sure why it worked on the JSfiddle but not on a live page. Either way, the tables worked out nicely so no more issues with outputting search results. NEW PHP &lt;table class=&quot;table table-hover table-condensed&quot;&gt; &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Full Name&lt;/th&gt;&lt;th&gt;Mobile Phone&lt;/th&gt;&lt;th&gt;Email Address&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt; &lt;?php //And we display the results foreach($ContactSearch as $Results) : ?&gt; &lt;!-- Search Results --&gt; &lt;tr class=&quot;clickable-row&quot; onclick=&quot;document.location = 'contact.php?Id=&lt;?php echo $Results['Id'];?&gt;';&quot;&gt; &lt;td&gt;&lt;span class=&quot;glyphicon glyphicon-user&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;?php echo $Results['FirstName'];?&gt; &lt;?php echo $Results['LastName'];?&gt;&lt;/td&gt; &lt;td&gt;&lt;span class=&quot;glyphicon glyphicon-earphone&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;?php echo $Results['Phone2'];?&gt;&lt;/td&gt; &lt;td&gt;&lt;span class=&quot;glyphicon glyphicon-envelope&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;?php echo $Results['Email'];?&gt;&lt;/td&gt;&lt;/tr&gt; &lt;?php endforeach; ?&gt; &lt;/tbody&gt;&lt;/table&gt;
upvote count: 1

http://stackoverflow.com/a/29700893
has comment: http://stackoverflow.com/comment/49675183
has body: If you need your MutationObserver only once (e.g. for initialization or whatever), you should disconnect it after it's no longer used. This might or might not free some memory, but it will certainly decrease CPU load. If your MutationObserver is required for the normal functioning of your website and would only have to be disconnected when the user closes their tab or window, I would say disconnecting is not required, as the browser has to clean up anyway. I mean, you could unregister event handlers as well, but no-one really does that. And certainly no-one deletes all their functions and variables, they expect the browser to do that. It might even be faster to not disconnect your MutationObserver, as the cleanup code is (almost certainly) written in machine code, which executes much faster than JavaScript. The difference would most likely be unnoticeable though. And since you specifically ask Could this cause memory issues? Yes, it could create a memory leak. But so could declaring a variable, if the browser does not perform appropriate cleanup, which would be a bug in that browser. Assuming a sane environment though, you should be fine without disconnecting your MO.
answers question: http://stackoverflow.com/q/29700467
upvote count: 8
type: AcceptedAnswer
type: Answer
score: 8
has comment: http://stackoverflow.com/comment/49678999
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29700467

http://stackoverflow.com/comment/47906740
type: Comment
comment on: http://stackoverflow.com/a/29847089
has text: Right seem like they broke things again in 9.0.6. If you pin your browserify to 8.x or even probably 9.0.4 you'll probably be okay. My setup is identical to some of the comments on the issue, so it's definitely vulnerable to `b.bundle()` returning undefined behavior.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47696013
type: AnswerComment
score: 0
type: Comment
has text: @griboedov see the updated code above and example : https://jsfiddle.net/erkaner/gugy7r1o/33/
comment on: http://stackoverflow.com/a/29782216

http://stackoverflow.com/q/29720449
tagged with: javascript
has title: Get json from google analytics
score: 0
answer count: 3
has body: I've a website with google analytics implemented. Everything shows fine on google analytics page eg. pageviews, gender, age.... but I need to get this data in JSON form for creating my own dashboard on my website. Simply, I need to get age and gender data via the URL link. Something like here: http://api.opentracker.net/api/trends/trends.jsp?login=demo@opentracker.net&amp;password=demo123&amp;site=www.opentracker.net&amp;period=1d There is any solution to make this ? PS: google analytics is implemented on page X and I'm making the dashboard on page Y. Thanks.
possible better answer: http://stackoverflow.com/a/47306755
has answer: http://stackoverflow.com/a/29720636
accepted answer: http://stackoverflow.com/a/29720636
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/50616917
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: google-analytics
has answer: http://stackoverflow.com/a/47306755

http://stackoverflow.com/q/29724701
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47761571
tagged with: jquery
has comment: http://stackoverflow.com/comment/47800595
has comment: http://stackoverflow.com/comment/47636729
has body: Like the title says, I would like to load an external JS file after view composition. I've been able to include my own jquery for DOM manipulation using the compositionComplete binding, but require.js seems to load all files before the composition html. Is there a way?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47616906
tagged with: durandal
answer count: 0
has comment: http://stackoverflow.com/comment/47583748
has title: load js file after view composition in Durandal 2.0
type: Question

http://stackoverflow.com/a/29774716
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/47682391
score: 2
has body: You can use class bindings like so {{#link-to 'index' tagName='li' class="active:active completed:completed"}}Index{{/link-to}}
has comment: http://stackoverflow.com/comment/47855033
has comment: http://stackoverflow.com/comment/47686133
upvote count: 2
answers question: http://stackoverflow.com/q/29773192

http://stackoverflow.com/comment/47756449
type: AnswerComment
has text: Then you're doing something wrong. ` ` forces a new line to begin, there is no way a browser can ignore that. Could you post exactly what you wrote now?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29814496

http://stackoverflow.com/comment/47702057
type: AnswerComment
has text: What I'm beginning to understand is that the "top of the component hierarchy* doesn't have to be a React component. It can be any JS object that gets passed as props to the "root" component.
type: Comment
comment on: http://stackoverflow.com/a/29763765
score: 0

http://stackoverflow.com/q/29808749
has answer: http://stackoverflow.com/a/29808960
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/21999178
tagged with: javascript
has title: Wait until the data returns, synchronous call with angular and breeze
score: 0
has comment: http://stackoverflow.com/comment/47747333
accepted answer: http://stackoverflow.com/a/29808960
linked to: http://stackoverflow.com/q/26750814
possible better answer: http://stackoverflow.com/a/29813752
tagged with: promise
has answer: http://stackoverflow.com/a/29813752
tagged with: breeze
tagged with: angularjs
type: AnsweredQuestion
has body: I'm working on a small blog engine where the user can create blog entry and possible to link tags to an entry. It is many-to-many relation, but due to that Breeze cannot yet manage this relation I have to expose the join table to breeze so that I can persist the data step-by-step. And my problem is here. Tables: BlogEntry BlogEntryTag Tag Scenario: user opens the "new blog entry" form or selects an existing one to be edited enters the text, etc selects one or more tags Business logic: create a new entity by Breeze / query the selected one save the blog entry (1st server call which gives back the blog_id if the blog entry is new one) check the already existing connections between the tags and blog entry, if the blog entry is edited then the already existing blogEntry-tag relations might change ( 2nd server call) based on the tag name selecting the tag_id from tag table (3rd server call) create the BlogEntrytag entities by breeze persist the BlogEntrytag entities into database ( 4th server call) I think the order must be consecutive. I have this code and as you can see the attached screenshot the console logging marked by '_blogEntryEnttity' does not wait until the data returns from the server and it will be executed before the console logging marked by '_blogEntryEnttity inside'. The code will throw a reference exception when it tries to set up the title property a few line later. var blogEntryEntityQueryPromise = datacontext.blogentry.getById(_blogsObject.id); blogEntryEntityQueryPromise.then(function (result) { console.log('result', result); _blogEntryEntity = result[0]; console.log('_blogEntryEnttity inside', _blogEntryEntity); //if I need synchronous execution then I have to put the code here which must be executed consecutively }); console.log('_blogEntryEnttity', _blogEntryEntity); } //mapping the values we got _blogEntryEntity.title = _blogsObject.title; _blogEntryEntity.leadWithMarkup = _blogsObject.leadWithMarkup; _blogEntryEntity.leadWithoutMarkup = _blogsO…
linked to: http://stackoverflow.com/q/22539815

http://stackoverflow.com/q/29788763
has body: One of the challenges of using a framework that is newish and under development is that the advice you find on the web is often outdated. This applies doubly to Meteor where the SO answers and web articles are often for a pre 1.0.x or an early 1.0.x version, or for the previous version of iron-router, or before they introduced a feature last week, and so on. Still puzzling over how to use the subscriptionsReady() function in the context of having a template wait until subscriptions are ready for it. I certainly need it since my template tries to render without its data about 3/4 of the time. How do I use subscriptionsReady()? I've seen examples which use it in the html which I think is kind of dumb (fuzzing presentation and function). How do I use it in the code portion of a template? Is it used in iron-router with some kind of waitOn? Do I wrap it with a while loop in my template renderer? Can you give a simplified example? Obligatory code stuff... My route for my template: Router.route('/', { path: '/', template: 'navmenu', onBeforeAction: function() { this.next(); } }); My subscriptions: // Chapters ChapterCollection = new Mongo.Collection("ChapterCollection"); if(Meteor.isClient){ Meteor.subscribe('users'); Meteor.subscribe('roles'); Meteor.subscribe('ChapterCollection'); } The html portion is pretty plain, some HTML wrapped in a template tag. My template code: Template.navmenu.rendered = function() { // Load all chapters from collections // Unless it decides to delay and then we are *%&amp;@ed chapterArray = ChapterCollection.find().fetch(); ... other stuff ... } Thanks for the help.
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29790505
tagged with: templates
tagged with: meteor
favorite count: 0
has title: How do I use meteor subscriptionsReady() to ensure data is ready before rendering template?
tagged with: iron-router
type: UnansweredQuestion
upvote count: 1
score: 1
tagged with: meteor-collections
has answer: http://stackoverflow.com/a/30347841
type: Question
answer count: 2

http://stackoverflow.com/comment/47672847
has text: Having `+` in a string is absolutely no barrier to concatenating it. I'm guessing the issue is about what a + means in a URL, but its really unclear from your question.
comment on: http://stackoverflow.com/q/29771165
type: Comment
type: QuestionComment
score: 2

firebase
tags question: http://stackoverflow.com/q/29706615
tags question: http://stackoverflow.com/q/29731235
tags question: http://stackoverflow.com/q/29702852
tags question: http://stackoverflow.com/q/29787182
tags question: http://stackoverflow.com/q/29737469
tags question: http://stackoverflow.com/q/29783602
tags question: http://stackoverflow.com/q/29689255
tags question: http://stackoverflow.com/q/29840892
tags question: http://stackoverflow.com/q/29827171
tags question: http://stackoverflow.com/q/29807548
tags question: http://stackoverflow.com/q/29693106
tags question: http://stackoverflow.com/q/29833443
tags question: http://stackoverflow.com/q/29710363
type: Tag
tags question: http://stackoverflow.com/q/29753513
tag name: firebase
tags question: http://stackoverflow.com/q/29702255
tags question: http://stackoverflow.com/q/29708347

http://stackoverflow.com/comment/47637366
type: QuestionComment
has text: Can you please post a working jsfiddle? I put your code into [one](http://jsfiddle.net/aa68x0xh/), but am not seeing anything.
comment on: http://stackoverflow.com/q/29752547
score: 0
type: Comment

http://stackoverflow.com/comment/47706520
type: Comment
type: QuestionComment
has text: I am using Yuku-t jquery autocomplete. This is a jquery plugin which creates drop down list when user types in something in the input box. What I want is that user should be able to edit these options name. For that I am trying to include a edit link along with the name of the option in the template. I will update the question with the code.
score: 0
comment on: http://stackoverflow.com/q/29788538

http://stackoverflow.com/comment/47789500
type: Comment
type: QuestionComment
has text: Can you provide a working example (like [JSFiddle](http://jsfiddle.net/)?
comment on: http://stackoverflow.com/q/29831458
score: 0

http://stackoverflow.com/comment/47761508
type: Comment
has text: @Anzeo Sure just a minute
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29816675

http://stackoverflow.com/q/29696953
linked to: http://stackoverflow.com/q/4038629
has answer: http://stackoverflow.com/a/53567937
type: Question
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/53568576
upvote count: 4
has title: how to find a URL is aready opened in another tab of same browser
answer count: 2
has comment: http://stackoverflow.com/comment/47531553
downvote count: 0
tagged with: oracle-apex
has comment: http://stackoverflow.com/comment/47552130
favorite count: 0
has comment: http://stackoverflow.com/comment/47557819
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47529912
has body: I want to know if the same URL is already opened in another tab of same browser,if so i need to raise a alert.Can any one help me with this.Need to do with javascript
has comment: http://stackoverflow.com/comment/47548130

http://stackoverflow.com/comment/47744015
comment on: http://stackoverflow.com/q/29804464
has text: You need to stop changing people answers and saying they don't work... the reason no one is using the "content" variable outside of the click handler is because you lose scope at that point and it won't have the relational value to tnhe H1 you are looking for.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29709251
answers question: http://stackoverflow.com/q/29706712
has body: I'm updated you coding. From the suggestion of @jay-blanchard I updated the changePassword.php code with PDO. And also implemented validation rule and store them in a array. In your previous code you used if else if. So, If a password has 3 error's means it wont show at one time. You need to press submit button 3 times to get those errors one by one. Now I updated those with storing those errors to array and in the final stage I encode them as json. Check the below code. If you found any issue means please reply me. Because, I haven't tested the code. Hope it will execute successfully. changePassword.php &lt;?php // Database configuration define('DB_HOST', 'localhost'); define('DB_USER', 'username'); define('DB_PASS', 'password'); define('DB_NAME', 'database'); // Initializing error array $response['error'] = array(); try { $db = new PDO('mysql:host=' . DB_HOST .';dbname=' . DB_NAME . ';charset=utf8mb4', DB_USER, DB_PASS); $db-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db-&gt;setAttribute(PDO::ATTR_EMULATE_PREPARES, false); } catch (Exception $e) { $response['error'][] = "Error in DB Connection"; } // Store post and session values to variable. $currentPassword = $_POST['currentPassword']; $password = $_POST['newPassword']; $password2 = $_POST['confirmPassword']; $username = $_SESSION['username']; // Validating Password if($password === '' || $password === FALSE ){ $response['error'][] = "Your Password cannot be blank"; } if(strlen($password)&lt;7){ $response['error'][] = "Your Password is too short!"; } if($password &lt;&gt; $password2){ $response['error'][] = "Your Passwords do not match"; } // If validation password update the password for the user. if(empty($response['error'])){ $stmt = $db-&gt;prepare('UPDATE Staff SET password=? WHERE username=?'); // Prepare the query $stmt-&gt;execute(array(password_hash($password, PASSWORD_DEFAULT), $username)); // Bind the parameters to the query $affectedRows = $stmt-&gt;rowCount(); // Getting affected r…
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29706712
score: 1
has comment: http://stackoverflow.com/comment/48165058
has comment: http://stackoverflow.com/comment/48107789
has comment: http://stackoverflow.com/comment/48107575
type: AcceptedAnswer
upvote count: 1
type: Answer

http://stackoverflow.com/q/29745089
tagged with: javascript
score: 0
tagged with: angularjs
type: UnansweredQuestion
has body: So looking to write an application that will throw up a large number of buttons on the screen, the number of buttons and to some degree their functions will all be based on the users preference. The buttons functions will be dependent on setting, the look will be themed, the only set thing is that the buttons will be in a grid from 2x2 to 6x9. My question is, anyone have any suggestions on design patterns. Was thinking I would just render them one by one naming them [alpha row][column number], so the buttons will be A1 A2 A3 B1 B2 B3 Potentially using two ng-repeat loops. But thinking there might be some smoother solution?
has title: design pattern for dynamic buttons in angular
has comment: http://stackoverflow.com/comment/47630677
answer count: 0
has comment: http://stackoverflow.com/comment/47623989
has comment: http://stackoverflow.com/comment/47630167
type: Question

http://stackoverflow.com/comment/47773007
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29822159
has text: You should try the above without your personal code, that way you'll know for sure if the libraries are the source of the error or not.
score: 0

http://stackoverflow.com/q/29693249
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: meteor
favorite count: 0
has comment: http://stackoverflow.com/comment/47523111
has answer: http://stackoverflow.com/a/29693749
tagged with: iron-router
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47523211
score: 1
upvote count: 1
tagged with: coffeescript
has body: I want to make the layout template dynamic. The value of the layout template would be fetch in the server using a Meteor.call 'getLayoutTemplate'. Where shall I put the Meteor.call? And it should wait until it fetches the value of the Meteor.call. Any ideas? Router.configure layoutTemplate: ???? notFoundTemplate: 'notFound'
has title: Meteor JS: Dynamic Layout Template
type: Question
accepted answer: http://stackoverflow.com/a/29693749

http://stackoverflow.com/comment/47592012
comment on: http://stackoverflow.com/q/29728056
type: Comment
type: QuestionComment
has text: Some things to try... put the script tag for google maps in the page header, or add &callback=isNaN as in this answer [http://stackoverflow.com/questions/7811985/warning-a-call-to-document-write-from-an-asynchronously-loaded-external-scrip#comments-7812160](http://stackoverflow.com/questions/7811985/warning-a-call-to-document-write-from-an-asynchronously-loaded-external-scrip#comments-7812160)
score: 0

http://stackoverflow.com/comment/47681790
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29711488
score: 3
has text: Facebook doesn't officially support any url schema so even if you are able to figure out the URL to use, there is no guarantee that this won't break in the future, native App can change with no notice. If you use the javascript plugin you'll have a nice experience although it will open in a web browser. In general, if you do not find information in developers.facebook.com about what you're trying to do, it's because it's not supported and therefore, there will be no guarantee that it will work. I hope it makes sense.

http://stackoverflow.com/comment/47773623
type: QuestionComment
has text: @TrueBlueAussie - solved this - http://stackoverflow.com/a/29823718/104380
comment on: http://stackoverflow.com/q/29821946
score: 0
type: Comment

http://stackoverflow.com/comment/47791686
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29826494
has text: Be cause I simply need it.
type: Comment

http://stackoverflow.com/q/29708487
tagged with: crossfilter
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29882439
accepted answer: http://stackoverflow.com/a/29882439
favorite count: 0
downvote count: 0
tagged with: d3.js
has comment: http://stackoverflow.com/comment/47569041
has comment: http://stackoverflow.com/comment/47690982
score: 2
type: AnsweredQuestion
has body: I have a bubbleChart in dc.js which has a count on the x-axis. The count cannot be negative, but the upper bound is unknown. I would like my x-axis to always start at 0, but automatically adjust the upper bound to the range I am looking at. If I use .elasticX(true), the upper bound is adjusted automatically as I want it to be, but the lower bound also moves up, see below. Is there an easy way to have the upper bound be elastic, but the lower bound to start at 0?
tagged with: dc.js
has title: Can I get elasticX(), elasticY() to only apply to upper bound, dc.js?
type: Question
upvote count: 2

http://stackoverflow.com/comment/47732617
score: 0
has text: I'm not sure what the problem is. Your snippet is broken. It just shows `{{> map}}`, i.e., it isn't interpreting the spacebars syntax. This is probably an issue with the snippet more so than with your actual code. Can you show the actual ` ` in your html? Alternatively, what error or unexpected behavior are you seeing?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29799634

http://stackoverflow.com/comment/125059404
comment on: http://stackoverflow.com/a/42039244
type: AnswerComment
has text: No. `{ length: 5}` is an *array-like object* but not an iterable.
type: Comment
score: 2

http://stackoverflow.com/a/29726498
score: 0
has body: The function returned by simpleURL.bind(null, "http", "www.firefox.com") works the same way as the original function, but protocol and domain are always equal to "http" and "www.firefox.com", and it now only takes one argument which is the value of path. When you call the map function, it passes each value of the array to your new function and that value will become the value of path.
type: Answer
answers question: http://stackoverflow.com/q/29726222

http://stackoverflow.com/a/29742400
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47626671
has body: Here you go (function withAngular(angular) { 'use strict'; angular.module('app', ['ngRoute']) .controller('Ctrl', function($scope, $window, $timeout) { $scope.countSeconds = 11; $scope.updateCountdown = function updateCountdown(ms) { $timeout(function() { if($scope.countSeconds === 0){ $scope.countSeconds = 11; } else{$scope.countSeconds--; } $scope.updateCountdown($scope.countSeconds); }, 1000); }; $scope.updateCountdown(0); }); }(angular));
has comment: http://stackoverflow.com/comment/47622413
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29741849
type: Answer
answers question: http://stackoverflow.com/q/29741849

http://stackoverflow.com/a/29826297
answers question: http://stackoverflow.com/q/29826182
has comment: http://stackoverflow.com/comment/47968625
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47841648
accepted answer of: http://stackoverflow.com/q/29826182
has comment: http://stackoverflow.com/comment/47931782
has comment: http://stackoverflow.com/comment/47925961
has comment: http://stackoverflow.com/comment/47926480
has comment: http://stackoverflow.com/comment/47780425
has comment: http://stackoverflow.com/comment/47780486
upvote count: 1
has comment: http://stackoverflow.com/comment/47927098
type: AcceptedAnswer
type: Answer
has body: You could place a $watch from your controller. Giving your items on $scope a name of yourItems in your $http.get().then() completion, consider the following example .controller('ScoringPolarCtrl', ['$scope', function($scope) { $scope.$watch('yourItems', function(newVal, oldVal) { if(newVal !== oldVal) { // render charts } }); }]); You could also define a $scope function on your controller and call from directive within your $http callback. This may look different if you are isolating $scope or not, but here is the basic idea // -- directive $http.get('/foo').then(function(results) { scope.renderCharts(results); // -- async complete }); // -- controller $scope.renderCharts = function(results) { // render charts -- this is called once you receive your $http response }

http://stackoverflow.com/q/29768338
linked to: http://stackoverflow.com/q/18941700
has comment: http://stackoverflow.com/comment/47668136
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47667623
has title: Enable effect when button disable
has answer: http://stackoverflow.com/a/29768589
has comment: http://stackoverflow.com/comment/47667981
type: Question
has body: I have a disable button on witch i want to put an effect when the mouse pass hover it so for doing that i have this code : $commentAddTimeshitForbiden = AddPopupJQ("Button disable"); echo "&lt;input type='button' value='Validate' $commentAddTimeshitForbiden/&gt;"; AddPopupJQ is just a function who allow to add a class to my input and a title follow the text give in parameter. function AddPopupJQ($text='', $title='') { return "class='popupjq' data-popupjq_text='" . htmlspecialchars(stripslashes($text), ENT_QUOTES | ENT_HTML401, "ISO-8859-15") . "' data-popupjq_title='" . htmlspecialchars(stripslashes($title), ENT_QUOTES | ENT_HTML401, "ISO-8859-15") . "'"; } After i have a jquery function who will take all the elements who have the className and print a popUp when the mouse pass hover the element. function popupJQ() { $(".popupjq").each(function(index) { //Récuperation des données/paramètres var title = ($(this).data('popupjq_title')) ? $(this).data('popupjq_title') : ''; var text = ($(this).data('popupjq_text')) ? $(this).data('popupjq_text') : ''; //Pour l'accessibilité, on ajoute la balise Alt aux images if ($(this).is("img")) { var sep = (title &amp;&amp; text) ? " : " : ""; $(this).attr("alt", title + sep + text); } //Création de la tooltip var txt = ""; if (title) txt += "&lt;B&gt;&lt;FONT class='tooltitle'&gt;" + title + "&lt;/FONT&gt;&lt;/B&gt;&lt;br&gt;"; if (text) txt += "&lt;FONT class='tooltext'&gt;" + text + "&lt;/FONT&gt;"; if(txt){ $(this).tooltipster({ content: $(txt), position: 'bottom-left', delay: 100, debug: false, speed: 0 }); } }); } The problem is that it's work when the button is enable but not when it's disable. I think it's because the event hover is stop when the button is disable. How can i do for make it work.
tagged with: javascript
has comment: http://stackoverflow.com/comment/47667490
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29769718
tagged with: jquery
has comment: http://stackoverflow.com/comment/47667613

http://stackoverflow.com/q/29747096
has comment: http://stackoverflow.com/comment/47649592
tagged with: swagger-editor
has comment: http://stackoverflow.com/comment/47639172
tagged with: javascript
score: 4
upvote count: 4
has title: Swagger-editor don't work local refs when it installed locally
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: swagger-ui
tagged with: node.js
has comment: http://stackoverflow.com/comment/47649978
has body: I'm new on swagger. I've installed Swagger on Ubuntu 14.04 server two times and always get same error "Uncaught TypeError: Cannot read property 'map' of undefined" in Chrome and "TypeError: async is undefined async.map(_.keys(remoteRefs), function (refPtr, callback)" in Firefox when i'm use $ref in any kind of document, include examples. All other functions work's fine, problem reproduce only when I try use any reference My node version: v0.10.38 Npm versiton: 1.4.28 Swagger version is latest
answer count: 0
has comment: http://stackoverflow.com/comment/47647604
tagged with: swagger
has comment: http://stackoverflow.com/comment/47657782
type: Question

http://stackoverflow.com/comment/47663067
has text: What do you have in `cur_url['query']['iso']`?
score: 0
comment on: http://stackoverflow.com/q/29765688
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29787704
has body: If you have only one div before your .new-content and that div is of class .row then below code will do the job too!! $('.new-content').click(function() { $(this).prev('.row').show(); }
downvote count: 0
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29787650

http://stackoverflow.com/a/29812936
upvote count: 1
answers question: http://stackoverflow.com/q/29812251
score: 1
has body: In your view: @foreach (var tag in (ViewBag.SelectedTags as List<MyBlogger.Models.Tag>)) { @tag.Name } In your controller: JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); ViewBag.AllTags = serializer.Serialize(context.Tags.ToArray()); ViewBag.SelectedTags = context.Tags.Where(w => w.Selected).ToList(); Assuming you are using EF's context and that you have some way to populate a list of all tags as well as tags that should be selected.
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29812251

http://stackoverflow.com/a/29696093
accepted answer of: http://stackoverflow.com/q/29695002
answers question: http://stackoverflow.com/q/29695002
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47530443
has comment: http://stackoverflow.com/comment/47533233
has body: try this $('#checky').prop('checked',true) or document.createElement("checky").setAttribute('checked',true) tell me what you find out
type: AcceptedAnswer
downvote count: 0
score: 1

http://stackoverflow.com/comment/89354101
type: AnswerComment
score: 0
type: Comment
has text: I don't see any errors. The video is working well, I just don't receive the event. I circumvented it by sending a socket message and adding a handler to it. In my case I am trying to catch orientation changes after device rotation. The initial `onloadedmetadata`, maybe even `onresize`, seems to trigger in all cases.
comment on: http://stackoverflow.com/a/29712062

http://stackoverflow.com/comment/47812890
has text: Please learn some basic syntax. `x || y` returns `x` if it's true, otherwise it returns `y`. Why would you expect it to combine them?
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29843364

http://stackoverflow.com/q/29762447
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47656755
has comment: http://stackoverflow.com/comment/47657290
tagged with: underscore.js
has title: Debouncing ng-keypress
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29762921
score: 0
tagged with: debouncing
tagged with: keypress
answer count: 1
has comment: http://stackoverflow.com/comment/47656778
tagged with: angularjs
has body: Does anyone have any pointers for me to debounce the keypress event in angular? I can't get it to debounce. And I know for sure because I'm using $log.debug to print out the keys pressed, and the amount of times it fires off is not at the debounce rate. I have set it up like this: &lt;div ng-keypress="doSomething"&gt;&lt;/div&gt; and in my controller (not that I have included underscore.js to utilize its debounce method in this instance): ... $scope.doSomething = function(event, keyEvent) { var keypressed = String.fromCharCode(keyEvent.which).toUpperCase(); _.debounce(handleKeyPress(keypressed), 500); } function handleKeyPress(keypressed) { //do something with the keypress } Thanks for your help in advance.
has answer: http://stackoverflow.com/a/29762921
type: Question

http://stackoverflow.com/a/29750012
type: Answer
score: 1
upvote count: 1
has body: I solved it by using the PHP version of the API: function ip_details($ip) { $json = file_get_contents("http://ipinfo.io/{$ip}"); $details = json_decode($json); //echo $ip; return $details; } $details = ip_details($userIp);
answers question: http://stackoverflow.com/q/29746659
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29746659

http://stackoverflow.com/comment/47542361
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29703286
score: 0
has text: please follow this link : http://stackoverflow.com/questions/9455066/add-input-fields-to-div-container-javascript

http://stackoverflow.com/comment/47821967
comment on: http://stackoverflow.com/a/29836572
type: Comment
has text: The alert that says "Before web service" runs but the messagebox doesn't and assuming that if that one doesn't run the alert with "in ajax" won't either.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47593964
has text: @FelixKling they always made me feel like it is.
comment on: http://stackoverflow.com/q/29726252
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29756588
answers question: http://stackoverflow.com/q/29756287
type: Answer
has body: Wrap your A tag around the LI tag. For example look at the google link. You're putting the A tag around the text only, not the entire element. google yahoo
downvote count: 1
score: -1
upvote count: 0

http://stackoverflow.com/q/29769010
tagged with: http://stackoverflow.com/tag/json
has title: securing RESTful API against JSONP data thievery
has comment: http://stackoverflow.com/comment/47669330
type: Question
has comment: http://stackoverflow.com/comment/47669923
tagged with: jsonp
tagged with: javascript
tagged with: security
score: 0
tagged with: rest
type: UnansweredQuestion
has body: As defined in JSONP, an evil site might attack the good site by including a script tag: &lt;script type="application/javascript" src="http://server.example.com/Users/1234?jsonp=parseResponse"&gt; &lt;/script&gt; which would access the user secret data from the good site, if the attacked user has authorized to the good site. As far as I know, a script tag can only execute a GET request, not a POST request. Questions: If a want to secure my RESTful API from any JSONP thievery, is it enough to replace all GET requests into POST requests? I guess this doesn't prevent from other XSRF attack vulnerabilities. If I have a POST/PUT/DELETE/OPTIONS-only API, what attacks shall I still consider? PS any valuable links are welcome in the comments.
answer count: 0

http://stackoverflow.com/a/29798439
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29797367
has body: Check this out, First call ajax, when the response is received, make the second ajax call. &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function() { $("#account").change(function() { var dataString1 = "q="+$("#account").val(); $.ajax ({ url: "displayfacilities.php", type : "POST", cache : false, data : dataString1, success: function(result1) { alert("Response from PHP file 1"); var dataString2 = "f=" + $("#account").val(); $.ajax ({ url: "updatefacilities.php", type : "POST", cache : false, data : dataString2, success: function(result2) { alert("Response from PHP file 2"); } } }); }); }); }); &lt;/script&gt;

http://stackoverflow.com/comment/47699615
has text: The question states that they do not want to use jQuery.
type: Comment
comment on: http://stackoverflow.com/a/29784834
score: 0
type: AnswerComment

http://stackoverflow.com/a/46034768
has body: The approved solution calls toLowerCase inside the loop which is not efficient. Below is an improved version: function insensitiveReplaceAll(s, f, r) { const lcs=s.toLowerCase(), lcf = f.toLowerCase(), flen=f.length; let res='', pos=0, next=lcs.indexOf(lcf, pos); if (next===-1) return s; do { res+=s.substring(pos, next)+r; pos=next+flen; } while ((next=lcs.indexOf(lcf, pos)) !== -1); return res+s.substring(pos); } console.log(insensitiveReplaceAll("Find aBc&amp;deF abcX", "abc", "xy")); console.log(insensitiveReplaceAll("hello", "abc", "xy")); Testing with jsPerf - https://jsperf.com/replace-case-insensitive-2/1 - shows it to be 37% faster.
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29782632
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/47537815
has text: you shouldn't stop and restart the timer that way, as sometimes the browser will lose the event related to the mouse entering or leaving the area. You'd much better incorporate the code testing if the mouse is hovering or not inside the routine for the timer itself and let it fire again and again until definitely not needed anymore.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29700287

http://stackoverflow.com/comment/47789575
type: Comment
type: QuestionComment
has text: only if the destination domain page implements MessageEvent
comment on: http://stackoverflow.com/q/29831223
score: 0

http://stackoverflow.com/comment/47606126
type: AnswerComment
comment on: http://stackoverflow.com/a/29736012
type: Comment
has text: No worries - that's why you're here, right? I updated my JSFiddle link so that `canvas` is a section just like you wrote, and it still works. Are you perhaps not wrapping it as a jQuery element, and are just using it as a JavaScript object from getElementById? Check out the link in my fiddle that declares canvas: `var canvas = $('#canvas');` and see if that's the problem.
score: 0

http://stackoverflow.com/comment/47707908
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29789386
has text: Wheres your js code?
type: Comment

http://stackoverflow.com/comment/47639261
type: AnswerComment
has text: I think you'll have to do all these in ` ` and specify a php page as action for the form and do all these functions in the specified page..And dont forget to specify the method as post.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29753187

http://stackoverflow.com/q/29709411
answer count: 4
type: AnsweredQuestion
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47555109
has comment: http://stackoverflow.com/comment/47555152
has title: Remove padding after opening accordion
type: Question
has comment: http://stackoverflow.com/comment/47554969
accepted answer: http://stackoverflow.com/a/29709745
tagged with: javascript
has answer: http://stackoverflow.com/a/29709779
linked to: http://stackoverflow.com/q/6887336
has comment: http://stackoverflow.com/comment/47555067
possible better answer: http://stackoverflow.com/a/29709779
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/47555030
favorite count: 0
has answer: http://stackoverflow.com/a/29709843
has body: I have an accordion that I've added rounded corners to, however, each time I open up an element within the accordion, the padding that I've added to include the rounded corners gets attached to the inside of the accordion element. Can anyone consult me on how to get rid of this padding? http://jsfiddle.net/rgs6vLub/ CSS: .accordion { background-color:#000; border-radius:10px; padding:10px } .accordion dt { padding:.5em; background-color:#456db5; cursor:pointer; border-bottom:1px solid #355faa; font-size:13px } .accordion dt:hover { color:#fff } .accordion .on { background-color:#456db5; cursor:default } .accordion dt,.accordion .on:hover { color:#fff } .accordion dd { padding-left:1em; margin:0 auto; padding-right:.5em; background-color:#fff; font-size:14px } .accordion dd p { padding-top:.5em; padding-bottom:.5em } HTML: Headline Text Picture:
has comment: http://stackoverflow.com/comment/47554562
has answer: http://stackoverflow.com/a/29709745
has answer: http://stackoverflow.com/a/29709741
tagged with: css

http://stackoverflow.com/a/29754412
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29753380
has body: List&lt;List&lt;int&gt;&gt; lstMainArr = new List&lt;List&lt;int&gt;&gt;(); lstMainArr.Add(new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }.ToList&lt;int&gt;()); lstMainArr.Add(new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }.ToList&lt;int&gt;()); Console.Write((new JavaScriptSerializer()).Serialize(lstMainArr));
downvote count: 0

http://stackoverflow.com/q/29822070
has title: How to set the value of a PHP variable to a selected value from a select box as it is selected?
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29822151
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I want the user to select an option from a select box. Then as the user clicks the option my variable sets itself as the selected value. Is there a way of doing this without doing it on page load or using a button. I want it to change when the user selects an option. I have tried using this &lt;script&gt; var e = document.getElementById("ADDITIONALINFO"); var option1 = e.options[e.selectedIndex].text; &lt;/script&gt; The variable remains empty. The name and id of my select box is ADDITIONALINFO If anyone can help I would really appreciate it!
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29822151
tagged with: php
type: AnsweredQuestion
score: 1

http://stackoverflow.com/a/29758381
has comment: http://stackoverflow.com/comment/47677432
downvote count: 0
answers question: http://stackoverflow.com/q/29758364
has body: When using jQuery, you can use the .val() function for this: $("#domains").val(edit_domain[1]);
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29758364
has comment: http://stackoverflow.com/comment/47681834
type: Answer
score: 3
upvote count: 3

http://stackoverflow.com/q/29838941
score: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: Recompute directive for hiding elements after login
upvote count: 1
type: Question
tagged with: angularjs-directive
tagged with: javascript
has answer: http://stackoverflow.com/a/29839049
downvote count: 0
has body: Good day guys, I have a situation where I want to show some UI elements on the basis of if session is active or not. The approach I have taken is using directive. It works great however when the person has logged in successfully the directives are not computed. Previously I was using like this: &lt;ul class="nav navbar-nav navbar-right" ng-hide="vm.model.currentUser.id !== 0"&gt; To refactor well, I have moved the logic of check at directive level and calling it as: &lt;ul class="nav navbar-nav navbar-right" !ap-valid-login-session&gt; Two questions: Is this approach is correct or is there any other better way to do? If this approach is correct then how can I make sure that directive is recomputed?
answer count: 1

http://stackoverflow.com/comment/47767850
type: QuestionComment
type: Comment
has text: `type` is not "u", "One", "Two", "Three" - it's only "u". if you have `function fn(arg1, arg2) { // body }` and you call it as `fn("foo", "bar", "baz")`, `arg1` will be `"foo"`, `arg2` will be `"baz"`, and the third parameter will not have a variable created for it, but will feature in `arguments`
comment on: http://stackoverflow.com/q/29820711
score: 0

http://stackoverflow.com/comment/47592361
type: QuestionComment
has text: @odedta it seems to be returning `data-year` .. no?
comment on: http://stackoverflow.com/q/29729374
score: 0
type: Comment

http://stackoverflow.com/a/29717361
type: Answer
has body: You don't have to save the boolean to toogle you can do the following: &lt;script&gt; $('#select_all').change(function() { console.log('click select all button'+$checked) $checked = $(this).is(':checked') $(".activated").each(function(){ $(this).prop("checked", $checked) }); }); &lt;/script&gt; N.T Replaced click with change, its the approprate one to use with checkboxes.
score: 0
answers question: http://stackoverflow.com/q/29717261

appendchild
tags question: http://stackoverflow.com/q/29762515
tag name: appendchild
type: Tag
tags question: http://stackoverflow.com/q/29750096

http://stackoverflow.com/q/29828862
answer count: 1
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47784246
type: Question
tagged with: javascript
has body: I am learning JavaScript and HTML5 together, I have a navigation menu in my website having 3 buttons, Home Contact Register I have an html form in Register page with the id called contact_form and I am accessing it in my javascript like this, var regForm = document.getElementById("contact_form"); Now I want to show another button in my navigation menu but only if the form is submitted, I can do it using PHP but how can I do it using basic JavaScript and HTML5 only ?. This is how i can check if the form is submitted, regForm.onsubmit = //do something This is my html for nav, Home Contact Register //add one more link if the form is submitted and my html form is simple html form with a submit button.
score: 0
has title: Add button to nav menu only when form is submitted?
has comment: http://stackoverflow.com/comment/47784238
has answer: http://stackoverflow.com/a/29829055

http://stackoverflow.com/a/39884578
type: Answer
has comment: http://stackoverflow.com/comment/98003711
downvote count: 1
answers question: http://stackoverflow.com/q/29725828
upvote count: 62
has comment: http://stackoverflow.com/comment/96485546
has body: You can pass a function to the onScroll event on the React element: https://facebook.github.io/react/docs/events.html#ui-events &lt;ScrollableComponent onScroll={this.handleScroll} /&gt; Another answer that is similar: https://stackoverflow.com/a/36207913/1255973 2023-10 Update Updated React.dev docs: https://react.dev/reference/react-dom/components/common#common-props MDN docs: https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll_event
has comment: http://stackoverflow.com/comment/83083720
has comment: http://stackoverflow.com/comment/113995832
has comment: http://stackoverflow.com/comment/114036770
has comment: http://stackoverflow.com/comment/132976448
has comment: http://stackoverflow.com/comment/112314415
score: 61

http://stackoverflow.com/q/29717842
tagged with: reactjs-flux
favorite count: 0
has comment: http://stackoverflow.com/comment/47570261
possible better answer: http://stackoverflow.com/a/29719449
has answer: http://stackoverflow.com/a/29719449
has title: Using reactjs, updating an item in a list without updating the whole list?
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/30666332
has body: I'm using React and Reflux. And I'm having a hard time figuring out how to update one comment in a list of comments. I'm confused on where state should go. I put the state at the top in CommentsList. Thinking it the React way. And then CommentsItem is just props. And then each CommentsItem has a LikeButton, which I made props as well. The problem is when I call the like action in the LikeButton, it reloads all the comments in CommentsStore. I'm guessing I need a new store that loads one comments instead of all comments? But then does that mean I'm putting state in CommentsItem? I'm kind of confused on the best practice here. This is what I'm working with: <ProfilePage /> <ProfileBox profile={this.state.profile} /> <CommentsList query={{profile: this.state.profile._id}} /> <CommentsList /> var CommentsList = React.createClass({ mixins: [ Reflux.connect(CommentsStore, 'comments') ], componentWillMount: function() { CommentsActions.load(this.props.query); }, render: function() { var commentNodes = this.state.comments.map(function (comment, i) { return ( <CommentsItem key={i} comment={comment} /> ); }); return ( {commentNodes} ); } }); <CommentsItem /> var CommentsItem = React.createClass({ render: function() { return ( {this.props.comment.user.username}: {this.props.comment.comment} {this.props.comment.numPoints} people like this OTHER LINKS <LikeButton commentId={this.props.comment._id} liked={this.props.comment.liked} /> ); } }); <LikeButton /> var LikeButton = React.createClass({ handleLike: function(e) { e.preventDefault(); CommentsActions.like(this.props.commentId); }, render: function() { var likeText = this.props.liked ? 'Unlike' : 'Like'; return( {likeText} ); } });
upvote count: 3
has comment: http://stackoverflow.com/comment/47571898
tagged with: javascript
has answer: http://stackoverflow.com/a/30666332
tagged with: reactjs
type: AnsweredQuestion
score: 3
downvote count: 0
tagged with: refluxjs

http://stackoverflow.com/comment/47772130
type: Comment
comment on: http://stackoverflow.com/a/29822534
score: 0
type: AnswerComment
has text: I was looking for a pure JS way, but I've given Curry a look and it looks very interesting nonetheless. I might use it on a future project. Thanks!

http://stackoverflow.com/comment/47611305
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/29738946
has text: Use ajax instead. Avoid page being refresh after submit button was clicked, then you can change the label after ajax request success.

http://stackoverflow.com/comment/47610224
score: 0
type: Comment
type: QuestionComment
has text: Site root (folder contain all) Js(folder contain all libraries -- into site root) The all .html file are in the site root but not into the any folder
comment on: http://stackoverflow.com/q/29738359

http://stackoverflow.com/q/29733607
downvote count: 0
possible better answer: http://stackoverflow.com/a/29733911
tagged with: javascript
type: AnsweredQuestion
score: 1
favorite count: 0
type: Question
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/29733625
tagged with: php
tagged with: wordpress
has body: I am trying to get stylesheet_directory in JS, but can't get it to work. Here is what I have tried: url : '&lt;?php bloginfo('stylesheet_directory'); ?&gt;/img/hamburger.svg' AND: var stylesheetDir = "&lt;?php bloginfo('stylesheet_directory') ?&gt;"; url : '$stylesheetDir/img/hamburger.svg', I guess there is just a problem with some characters or something? Could you please help me out? svgicons-config-js var stylesheetDir = "&lt;?php bloginfo('stylesheet_directory') ?&gt;"; url == $stylesheetDir; decodeURI(url); var svgIconConfig = { hamburgerCross : { url : stylesheetDir + '/img/hamburger.svg', animation : [ { el : 'path:nth-child(1)', animProperties : { from : { val : '{"path" : "m 5.0916789,20.818994 53.8166421,0"}' }, to : { val : '{"path" : "M 12.972944,50.936147 51.027056,12.882035"}' } } }, { el : 'path:nth-child(2)', animProperties : { from : { val : '{"transform" : "s1 1", "opacity" : 1}', before : '{"transform" : "s0 0"}' }, to : { val : '{"opacity" : 0}' } } }, { el : 'path:nth-child(3)', animProperties : { from : { val : '{"path" : "m 5.0916788,42.95698 53.8166422,0"}' }, to : { val : '{"path" : "M 12.972944,12.882035 51.027056,50.936147"}' } } } ] }, }; hamburger_animation.js (function() { [].slice.call( document.querySelectorAll( '.si-icons-default &gt; .si-icon' ) ).forEach( function( el ) { var svgicon = new svgIcon( el, svgIconConfig ); } ); new svgIcon( document.querySelector( '.si-icons-easing .si-icon-hamburger' ), svgIconConfig, { easing : mina.backin } ); new svgIcon( document.querySelector( '.si-icons-easing .si-icon-hamburger-cross' ), svgIconConfig, { easing : mina.elastic, speed: 600 } ); })(); svgicons.js /** * svgicons.js v1.0.0 * http://www.codrops.com * * Licensed under the MIT license. * http://www.opensource.org/licenses/mit-license.php * * Copyright 2013, Codrops * http://www.codrops.com */ ;( function( window ) { 'use strict'; /*** helper functions ***/ // from https://github.com/desandro/classie/blob/master/classie.js function cla…
has answer: http://stackoverflow.com/a/29733911
has title: WP - Get stylesheet_directory in JS
accepted answer: http://stackoverflow.com/a/29733625
linked to: http://stackoverflow.com/q/11381673

http://stackoverflow.com/a/29800315
answers question: http://stackoverflow.com/q/29799943
type: Answer
accepted answer of: http://stackoverflow.com/q/29799943
score: 2
has body: The simple answer is that Node.js is single threaded. Any messages coming from the curl process will get "queued" and be emitted once Javascript gives it a chance. So since you're registering your on('data'... callback right after that, you're not giving javascript a chance to emit any data. If you used a setTimeout to then set the on('data'... callback then yes you may miss some data. test.bat echo "Hello!" No Data Loss: var spawn = require('child_process').spawn; var curl = spawn('test.bat'); console.log('before'); for (var i = 0; i &lt; 2000000000; i++) { //Waste some time } console.log('after'); curl.stdout.on('data', function (data) { console.log('data: ' + data); }); curl.stdout.on('end', function (data) { console.log('end: ' + data); }); setTimeout(function () { }, 10000); //Just to keep console open for 10 seconds Data Loss: var spawn = require('child_process').spawn; var curl = spawn('test.bat'); setTimeout(function () { curl.stdout.on('data', function (data) { console.log('data: ' + data); }); curl.stdout.on('end', function (data) { console.log('end: ' + data); }); console.log('finished'); }, 10000);
downvote count: 0
has comment: http://stackoverflow.com/comment/47729242
has comment: http://stackoverflow.com/comment/47728766
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/a/30414965
score: 1
upvote count: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29769817
has body: As described by others yes... you need to set the showUpload and showRemove properties. You can use HTML 5 data attributes to initialize this as shown in third example on the basic usage section of the demo site - OR - you can directly use javascript to initialize as you have done. However do not do both. The issue is you have the markup &lt;input id="myName" type="file" name="myName" class="file" /&gt; which has a class = file, which means the plugin will automatically intialize the plugin which is resulting in your JS init code not being processed. Note that as highlighted in document and in the first example on basic usage the plugin automatically initializes the file input plugin if you have input type = file and class = file. So you must just do the following if you are using javascript to initialize. First remove the class = file from your markup: &lt;input id="myName" type="file" name="myName"/&gt; Next initialize the plugin (typically on document ready) and it should work. $(document).on('ready', function() { $("#myName").fileinput({ showUpload: false, showRemove: false }); });

http://stackoverflow.com/comment/48448879
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29798046
has text: what do you mean by _need to be generated by a scala-template_? Do you want to generate the questions in your view? Do you want to retrieve them from the database and display them all in a generic way in your view?

http://stackoverflow.com/q/29765111
has title: getting a bean value in javascript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47661840
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29765148
has body: i have a bean class WordBean with the following structure public class WordBean { public WordList getWordList() { return wordList; } public void setWordList(WordList wordList) { this.wordList= wordList; } } WordList class with the following structure public class WordList { private List itemList = new ArrayList(); public void setItemList(List itemList ) { this.itemList = itemList ; } public List getItemList() { return itemList; } } In my javascript , i need to get the retrieve the list itemList to do some validations var items = document.WordBean.WordList.itemList; But i am not getting any values here ? so kindly suggest on the better syntax to retrieve the List?
answer count: 1
downvote count: 0
tagged with: jsp
has comment: http://stackoverflow.com/comment/47661583
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29765148
favorite count: 0
tagged with: arraylist
has comment: http://stackoverflow.com/comment/47661711

http://stackoverflow.com/a/29783642
has comment: http://stackoverflow.com/comment/47697232
score: 0
has comment: http://stackoverflow.com/comment/47697417
type: Answer
answers question: http://stackoverflow.com/q/29783518
has body: Could you divide things into sub-services, and then make the State service an aggregator for these sub-services, then instead of injecting State into the sub-services, you inject the specific sub-service that you need? E.g.: var app = angular.module('services', []); app.service('sub1', function(){ return { // ... } }); app.service('sub2', function(sub1){ var data = sub1.getData(); data.prop = 'new_value'; sub1.setData(data); return { // ... } }); app.service('State', function(sub1, sub2){ var data = sub1.getData(); data.prop = 'new_value'; sub1.setData(data); var data = sub2.getData(); data.prop = 'new_value'; sub2.setData(data); return { // ... } });

http://stackoverflow.com/q/29833928
has comment: http://stackoverflow.com/comment/47794827
downvote count: 0
possible better answer: http://stackoverflow.com/a/29834121
favorite count: 0
has answer: http://stackoverflow.com/a/29834121
has title: How to prevent fake form validation
score: 5
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29833984
accepted answer: http://stackoverflow.com/a/29834228
type: AnsweredQuestion
has body: So I have page with simple form. To submit this form I need person submitting to check checkbox (some privacy policy etc). I have the form like this: SEND (Of course, every distracting inputs are deleted.) Then I have script that shall submit form only after checking the checkbox. button.on("click",function(){ if ($("#regCheckbox").is(":checked")) $("#zamowienie").submit(); Unfortunately, I found out that user can change localy the button type from "button" to "submit" and he will be able to submit the form ignoring my submit protect script. And additional question. I am not an expert but I started wandering what else can do user with FireBug or dev tools. Can he perform any attacks this way? Many thanks for any answers or guidance.
tagged with: forms
type: Question
upvote count: 5
has comment: http://stackoverflow.com/comment/47794766
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47794520
has comment: http://stackoverflow.com/comment/47794527
has answer: http://stackoverflow.com/a/29834228
answer count: 3

http://stackoverflow.com/comment/47739366
score: 0
has text: @j08691 I haven't for a few years. I tried to look up online about this kind of stuff but everything slider related just involves one image at a time, not two.
comment on: http://stackoverflow.com/q/29805474
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47783347
score: 0
type: Comment
type: QuestionComment
has text: Add some example code so that we can replicate the issue and so that we have a reference in case the link is not longer usable.
comment on: http://stackoverflow.com/q/29771607

http://stackoverflow.com/comment/47540394
comment on: http://stackoverflow.com/q/29701591
type: Comment
type: QuestionComment
has text: nope... this is not a homework... its just an iq question i saw in website and come out an idea to come out the best algorithm for this.... i alr graduate more than 10 years ++ ..hihi ...
score: 0

http://stackoverflow.com/comment/47778672
comment on: http://stackoverflow.com/q/29826050
score: 0
type: Comment
type: QuestionComment
has text: A title is not meant to contain an entire story. Pls change your title. Take a look here if you need help: http://stackoverflow.com/help/how-to-ask

forms
tags question: http://stackoverflow.com/q/29761898
tags question: http://stackoverflow.com/q/29786242
tags question: http://stackoverflow.com/q/29708824
tags question: http://stackoverflow.com/q/29713389
tags question: http://stackoverflow.com/q/29710319
tags question: http://stackoverflow.com/q/29809982
tags question: http://stackoverflow.com/q/29834546
tags question: http://stackoverflow.com/q/29791787
tags question: http://stackoverflow.com/q/29700254
tags question: http://stackoverflow.com/q/29755621
tags question: http://stackoverflow.com/q/29808922
tags question: http://stackoverflow.com/q/29716543
tags question: http://stackoverflow.com/q/29823223
type: Tag
tags question: http://stackoverflow.com/q/29764633
tags question: http://stackoverflow.com/q/29777808
tags question: http://stackoverflow.com/q/29805690
tags question: http://stackoverflow.com/q/29781709
tags question: http://stackoverflow.com/q/29749830
tags question: http://stackoverflow.com/q/29713423
tags question: http://stackoverflow.com/q/29802078
tags question: http://stackoverflow.com/q/29757038
tags question: http://stackoverflow.com/q/29745025
tags question: http://stackoverflow.com/q/29750738
tags question: http://stackoverflow.com/q/29731212
tags question: http://stackoverflow.com/q/29802104
tags question: http://stackoverflow.com/q/29785126
tags question: http://stackoverflow.com/q/29736499
tags question: http://stackoverflow.com/q/29794877
tags question: http://stackoverflow.com/q/29782856
tags question: http://stackoverflow.com/q/29761763
tags question: http://stackoverflow.com/q/29841683
tags question: http://stackoverflow.com/q/29690955
tags question: http://stackoverflow.com/q/29842456
tags question: http://stackoverflow.com/q/29762939
tags question: http://stackoverflow.com/q/29720794
tags question: http://stackoverflow.com/q/29696293
tags question: http://stackoverflow.com/q/29738827
tags question: http://stackoverflow.com/q/29755624
tags question: http://stackoverflow.com/q/29798979
tags question: http://stackoverflow.com/q/29710817
tags question: http://stackoverflow.com/q/29811178
tags question: http://stackoverflow.com/q/29755518
tags question: http://stackoverflow.com/q/29789153
tags question: http://stackoverflow.com/q/29821756
tags question: http://stackoverflow.com/q/29732084
tags question: http://stackoverflow.com/q/29743253
tags question: http://stackoverflow.com/q/29762997
tags question: http://stackoverflow.com/q/29833928
tags question: http://stackoverflow.com/q/29761718
tags question: http://stackoverflow.com/q/29751272
tags question: http://stackoverflow.com/q/29723975
tags question: http://stackoverflow.com/q/29726889
tags question: http://stackoverflow.com/q/29808790
tags question: http://stackoverflow.com/q/29835108
tags question: http://stackoverflow.com/q/29754977
tags question: http://stackoverflow.com/q/29823598
tags question: http://stackoverflow.com/q/29781166
tags question: http://stackoverflow.com/q/29759268
tags question: http://stackoverflow.com/q/29694487
tags question: http://stackoverflow.com/q/29716947
tags question: http://stackoverflow.com/q/29738046
tags question: http://stackoverflow.com/q/29764712
tags question: http://stackoverflow.com/q/29825546
tags question: http://stackoverflow.com/q/29705494
tags question: http://stackoverflow.com/q/29834326
tags question: http://stackoverflow.com/q/29730300
tags question: http://stackoverflow.com/q/29740963
tags question: http://stackoverflow.com/q/29831774
tags question: http://stackoverflow.com/q/29815866
tag name: forms
tags question: http://stackoverflow.com/q/29737237
tags question: http://stackoverflow.com/q/29807089
tags question: http://stackoverflow.com/q/29735907
tags question: http://stackoverflow.com/q/29810298
tags question: http://stackoverflow.com/q/29709924
tags question: http://stackoverflow.com/q/29723675
tags question: http://stackoverflow.com/q/29837230
tags question: http://stackoverflow.com/q/29784137
tags question: http://stackoverflow.com/q/29760054

http://stackoverflow.com/comment/47576299
has text: Please reformat your code, to be readable. And right off the top don't use `new Array()` use an array literal. For example the first one: `Image_array[0] = ["http://00.jpg", "1"];`
comment on: http://stackoverflow.com/q/29720528
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29780809
score: 0
upvote count: 1
type: Answer
downvote count: 1
has comment: http://stackoverflow.com/comment/47691761
has comment: http://stackoverflow.com/comment/47691835
has body: The simplest solution would just be that you position it in CSS. It is not very nice, but let's go from here. Maybe we could make it better/variable with javascript or something. .modal-dialog { position: absolute; top: 160px; } http://jsfiddle.net/DTcHh/6943/
answers question: http://stackoverflow.com/q/29780108

http://stackoverflow.com/a/29835790
has comment: http://stackoverflow.com/comment/47798465
answers question: http://stackoverflow.com/q/29835709
has comment: http://stackoverflow.com/comment/47798620
has comment: http://stackoverflow.com/comment/47798395
score: 0
has body: Here is a simple answer : Order received Processing Something else Update order status
type: Answer
has comment: http://stackoverflow.com/comment/47798678

http://stackoverflow.com/q/29803652
has title: Store DOM elements in array : strange behaviour?
tagged with: dom
has comment: http://stackoverflow.com/comment/47735295
score: 0
has answer: http://stackoverflow.com/a/29803746
tagged with: javascript
has answer: http://stackoverflow.com/a/29803792
answer count: 3
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/7375120
type: Question
has answer: http://stackoverflow.com/a/29803900
has body: need some help over here. I create and than, store DOM elements in a array. Later, when i want to use them, they are like unusable, except for the last one. Here is a realy simple code to illustrate : http://jsfiddle.net/rd2nzk4L/ var list = new Array(); // first loop create and store elements for (i = 1; i &lt;= 5; i++) { var html = '&lt;div id="test-' + i + '" style="float: left; border: 2px solid black; width: 50px; height: 50px; margin: 5px;"&gt;' + i + '&lt;/div&gt;'; document.getElementById('test').innerHTML += html; var element = document.getElementById('test-' + i); //console.log(element); list.push(element); } // second loop use stored elements for (index in list) { //console.log(list[ index ]); list[ index ].style.backgroundColor = 'yellow'; } You can see only the last element became yellow. I'll really appreciate if someone have an idea. Thanks!

http://stackoverflow.com/q/29722118
linked to: http://stackoverflow.com/q/12411561
tagged with: css
has answer: http://stackoverflow.com/a/29722217
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47578819
has body: I'm trying to create an expandable div. I want to retrieve the CSS display property and change it using pure javascript. In doing so I receive an error saying "Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'." var myFunction = function() { var header = document.getElementsByClassName('collapse_header'); var hiddenDiv = document.getElementsByClassName('collapse_body'); var theCSSprop = window.getComputedStyle(hiddenDiv).getPropertyValue('display'); for (var i = 0; i < hiddenDiv.length; i++) { if (theCSSprop.style.display === "block" || theCSSprop.style.display === "") { clVal[i].style.display = "none"; } else { theCSSprop.style.display = "block"; } header[i].addEventListener('click', myFunction, false); } } document.addEventListener('DOMContentLoaded', myFunction, false); .collapse_wrapper { width:500px; padding:0; overflow:hidden; border:1px solid #636428; border-radius:18px; margin:auto; margin-top:50px; margin-left:50px; float:left; } .collapse_header { padding:50px; width:100%; background:#636428; font-size:34px; color:#fff; overflow:hidden; } .collapse_body { height:500px; background:#fff; font-size:90px; display:none; } Expandable Div 1 The body of div 1 Expandable Div 2 The body of div 2
tagged with: javascript
score: 0
answer count: 1
has title: Retrieve display property using javascript and getElementsByClassName
has comment: http://stackoverflow.com/comment/47579560
accepted answer: http://stackoverflow.com/a/29722217
has comment: http://stackoverflow.com/comment/47578824

http://stackoverflow.com/comment/47799453
comment on: http://stackoverflow.com/q/29836283
score: 0
has text: So it's basically just a change of the animation? Before and after the transitions it should be as it is?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47545896
type: Comment
comment on: http://stackoverflow.com/a/29704761
score: 0
type: AnswerComment
has text: and how do I get the request variables in check_myws_params function?

http://stackoverflow.com/comment/47677578
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29771011
has text: Ah, my mistake, I had an older bower config where angular was set at 1.2. Setting it to 1.3 and updating made my code work. Could you move it to an answer so that I can mark it?

http://stackoverflow.com/a/29689652
has comment: http://stackoverflow.com/comment/47516434
answers question: http://stackoverflow.com/q/29689229
has body: Haven't tried but I believe you can achieve with: &lt;div ng-init="ctrl.value &amp;&amp; (ctrl.value=1)"&gt; BUT if you want an advice, avoid both ng-init and nesting controllers like this: it would be a pain to maintain this program. Prefer to use controllerAs syntax (https://docs.angularjs.org/api/ng/directive/ngController) and put init logic on controller/service.
type: Answer
upvote count: 2
score: 1
has comment: http://stackoverflow.com/comment/47516464
downvote count: 1

http://stackoverflow.com/comment/47801597
score: 0
has text: Given the way he wrote the example date in the question ("23/04/2015 9:23 PM"), it would seem he's using the DD/MM/YYYY format. The code, however, is reading it as MM/DD/YYYY format. It works correctly if you're using the latter format, but not if you're using the former.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29837329

http://stackoverflow.com/q/29809838
tagged with: webstorm
tagged with: require
answer count: 1
has body: Every time I use: var bla = require('./directory/bla.js') All global functions starts to be "unresolved function or method". Any ideas?
downvote count: 0
linked to: http://stackoverflow.com/q/20136714
favorite count: 0
has comment: http://stackoverflow.com/comment/47748546
has title: Webstorm doesn`t recognize my global functions when I use "require"
has comment: http://stackoverflow.com/comment/47747697
tagged with: node.js
has answer: http://stackoverflow.com/a/45823374
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47964174
has comment: http://stackoverflow.com/comment/47747716
tagged with: javascript

http://stackoverflow.com/comment/47988469
type: Comment
has text: all great comments. the reason I don't use short hand is because I'm trying to get the hang of things first. If I ever get to the pro level, then I will definitely shorten things up a lot
comment on: http://stackoverflow.com/a/29733505
score: 0
type: AnswerComment

xlink
type: Tag
tags question: http://stackoverflow.com/q/29734470
tag name: xlink

http://stackoverflow.com/q/29702758
has answer: http://stackoverflow.com/a/76029038
has answer: http://stackoverflow.com/a/45841450
answer count: 5
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
upvote count: 6
has answer: http://stackoverflow.com/a/29703000
tagged with: save
downvote count: 2
tagged with: file
type: Question
has answer: http://stackoverflow.com/a/29702870
has body: I need to save content of div using pure javascript. I just edited one fiddle but I can't make it works :( jsfiddle Hello world Hi everybody Download function download(){ var a = document.body.appendChild( document.createElement("a") ); a.download = "export.html"; a.href = "data:text/html," + document.getElementById("content"); }
tagged with: javascript
score: 4
has title: HTML button to save div content using javascript
has answer: http://stackoverflow.com/a/29703663
tagged with: button
favorite count: 0

http://stackoverflow.com/q/29766102
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29766222
has body: I am writing a code to create roll over effect using the NetBeansIDE. I am unable to access the image with following code during the rollover in browser: &lt;script language="javascript"&gt; function MouseRollover(MyImage) { MyImage.src = "images\button2.jpg"; } function MouseOut(MyImage) { MyImage.src = "images\button1.jpg"; } However the browser successfully loads another image strip.png present in same folder: &lt;img src="images\strip.png" alt="Image can't be displayed" width="1319" height="192"&gt; Also, whenever page loads initially it successfully displays the image. But it doesn't display any image whenever onMouseOver and onMouseOut events occur. Image code: &lt;img alt="Image can't be displayed" src="images\button1.jpg" name="button" width="217" height="115" border="0" id="button" onMouseOver="MouseRollover(this)" onMouseOut="MouseOut(this)" title="Register yourself"&gt; Below is my project's directory structure: How is this error caused and how can I solve it?
tagged with: netbeans
type: Question
answer count: 1
has title: Accessing the image in NetBeans for JSP
score: 0
has answer: http://stackoverflow.com/a/29766222
tagged with: javascript
type: AnsweredQuestion

http://stackoverflow.com/a/29794584
answers question: http://stackoverflow.com/q/29771258
has body: I did it! All my areas have their own id so when I click one I force the others to "deselect". Here is my script: var nAreas = $('area').length; //alert(nAreas); for(var i=0;i&lt;=nAreas;i++){ if(idArea == 'area'+i){ /*Nada*/ }else{ $('#area'+i).mapster('deselect'); } }
score: 0
type: Answer

http://stackoverflow.com/comment/47735557
type: Comment
comment on: http://stackoverflow.com/a/29803774
has text: i need the to ignore values<0 in the argument and still keep the count of values entered set to 10, where do i include that?
score: 0
type: AnswerComment

http://stackoverflow.com/q/29768963
tagged with: javascript
tagged with: servlets
has comment: http://stackoverflow.com/comment/47669000
score: 0
type: UnansweredQuestion
has title: Access session in .js File where these session is created in .java Servlet File
has comment: http://stackoverflow.com/comment/47673758
answer count: 0
has body: In one of my webapp's servlet, I put some data in the user's HttpSession (see code below). How can I retrieve this value on the client side, to use it in an already-existing JS method ? // initialServlet.java HttpSession session = request.getSession(); int a=4; session.setAttribute("object", a);
tagged with: java
type: Question
tagged with: session

http://stackoverflow.com/q/29803136
has answer: http://stackoverflow.com/a/29803269
answer count: 5
duplicate of: http://stackoverflow.com/q/29685364
has answer: http://stackoverflow.com/a/29803179
has comment: http://stackoverflow.com/comment/47734367
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29803327
accepted answer: http://stackoverflow.com/a/29803269
has answer: http://stackoverflow.com/a/29803327
type: Question
tagged with: javascript
has title: Can't store a boolean returned by a function in a variable
has answer: http://stackoverflow.com/a/29803461
has comment: http://stackoverflow.com/comment/47734492
score: 0
linked to: http://stackoverflow.com/q/653921
has comment: http://stackoverflow.com/comment/47734186
has body: I don't know if this is a bug, but it feels kind of strange. Can you store a boolean returned by a function in a variable using javascript? Whenever I try to store a boolean value in a variable which is returned by a function, it gets changed to string. I have the following function which converts a string to a boolean function str2bool(strvalue){ console.log("Value is - " + strvalue); console.log("Type is - " + typeof strvalue); return (strvalue &amp;&amp; typeof strvalue == 'string') ? (strvalue.toLowerCase() == 'true') : (strvalue == true); } I've found this function somewhere here on StackOverflow, but I do not remember it's author, so if you are reading this, sorry about me not giving proper credits:) I have another javascript line, which looks as follows: target.prop('disabled',str2bool(booleanInStringFormat)); console.log("Typeof str2bool return is - " + typeof str2bool(booleanInStringFormat)); If I use it this way, everyting works fine, the str2bool function returns the following lines to the console: Value is - false Type is - string And the line after the main function returns: Typeof of str2bool function is - boolean But if I try to store the return value of str2bool in a variable, and use it afterwards, the prop function won't work, because apparently the variable that I use to store the return value of str2bool becomes a string. If I run this code I get the following results: status = str2bool(booleanInStringFormat); console.log("Typeof status is - " + typeof status); target.prop('disabled',status); The results are the following: Value is - false Type is - string Typeof status is - string End result is that target remains disabled So, why is the typeof the variable in which I store the return of the function is changed back to string?
has answer: http://stackoverflow.com/a/29803337
linked to: http://stackoverflow.com/q/29685364

ember-data
tags question: http://stackoverflow.com/q/29802301
type: Tag
tags question: http://stackoverflow.com/q/29828941
tags question: http://stackoverflow.com/q/29834906
tags question: http://stackoverflow.com/q/29758703
tag name: ember-data
tags question: http://stackoverflow.com/q/29711234
tags question: http://stackoverflow.com/q/29766025

http://stackoverflow.com/a/29818382
type: Answer
has comment: http://stackoverflow.com/comment/47766935
has comment: http://stackoverflow.com/comment/47774086
score: 2
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/29818162
has comment: http://stackoverflow.com/comment/47764682
has body: Yes you can with ajax ! Create your action in a controller which remove a given product of your session. a Sample code : ProductController extends Controller{ ... public function removeItemAction($itemId){ //find here your session where you save the item. //and remove it //return a response depending on what you want in the format that you want (json,xml,...) return new Response("..."); } } 2.Create your javascript code which listen the action and send a request ajax to the precedent url. (if you use jQuery , see $.ajax ) update your DOM (with deleting the right elements or load any html that you want ).
has comment: http://stackoverflow.com/comment/47765625

http://stackoverflow.com/q/29697861
score: -3
upvote count: 1
type: Question
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29698112
possible better answer: http://stackoverflow.com/a/29697957
downvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/29697957
tagged with: javascript
has title: How to convert this data to JSON using Javascript?
favorite count: 0
accepted answer: http://stackoverflow.com/a/29698112
has body: I am posting a data to a server and it turns out like this. I wanted to convert this to JSON using javascript. country=Philippines\r\n countryid=840\r\n operator=Globe Telecom Philippines\r\n operatorid=246\r\n connection_status=100\r\n destination_msisdn=639358661725\r\n destination_currency=PHP\r\n product_list=25,50,150,300,500,1000\r\n retail_price_list=0.70,1.40,4.10,8.10,13.50,27.00\r\n wholesale_price_list=0.56,1.10,3.26,6.49,10.80,21.58\r\n authentication_key=1429269579325\r\n error_code=0\r\n error_txt=Transaction successful\r\n Can anyone point me in the right direction?
type: AnsweredQuestion

http://stackoverflow.com/comment/47567154
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29715877
type: Comment
has text: Jawanam, My znakomy?

http://stackoverflow.com/comment/47574911
has text: possible duplicate.. see this answer: http://stackoverflow.com/questions/10615797/utility-of-http-header-content-type-application-force-download-for-mobile
comment on: http://stackoverflow.com/q/29720170
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47558399
score: 0
comment on: http://stackoverflow.com/q/29706620
type: Comment
type: QuestionComment
has text: Trying to get pull lyrics off from here http://www.azlyrics.com/

http://stackoverflow.com/comment/47710884
has text: `{{ item.parentArray[0].name }}` ?
score: 0
comment on: http://stackoverflow.com/q/29791020
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29734806
has comment: http://stackoverflow.com/comment/47605228
has body: As halfer answered in your other question, you basically need: A timer (with an interval that never ends) An AJAX request inside that timer to a PHP file A PHP file that queries the database Maybe you need a more clarified explanation of how to do it. Take the following answer as a tutorial of how to do AJAX calls. Before we go you must understand this: JavaScript/jQuery is executed in the browser. PHP is executed in your server. For the timer/interval we will be using setInterval javascript function. So grab your editor and create a new JavaScript file. Name it script.js, for example. Put this inside: setInterval(function() { $.get('getNewChatMessages.php', function(number_chat_messages) { $('#chat_messages_count').text(number_chat_messages); }); }, 5000);//every 5 seconds make a GET request to CHAT.php The line $('#chat_messages_count').text(number_chat_messages); Is: $('#chat_messages_count') gets the div that has an id "chat_messages_count" text(number_chat_messages); sets what is in the variable number_chat_messages in HTML. $('#chat_messages_count').text(number_chat_messages); With this, we are setting number_chat_messages to the div with id chat_messages_count. Now grab your editor again, and create a new HTML file. Lets name it, index.html. Put this content inside: Number of chat messages: See, we load jquery and then our script.js. Now let's create the PHP file. Let's name it getNewChatMessages.php. Why? Because in the $.get function we call it that way. <?php $sqlmessages = mysql_query("SELECT * FROM chat"); echo mysql_num_rows($sqlmessages); That's it. No refreshes, no PHP headers with refresh and that weird stuff. Try it and learn it, and then adapt it to your code.
downvote count: 0
has comment: http://stackoverflow.com/comment/47604571
score: 3
has comment: http://stackoverflow.com/comment/47603786
has comment: http://stackoverflow.com/comment/47603827
has comment: http://stackoverflow.com/comment/47604802
has comment: http://stackoverflow.com/comment/47604751
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47604295
upvote count: 3
has comment: http://stackoverflow.com/comment/47604658
accepted answer of: http://stackoverflow.com/q/29733383
type: Answer
answers question: http://stackoverflow.com/q/29733383

http://stackoverflow.com/q/29724885
upvote count: 6
duplicate of: http://stackoverflow.com/q/19392553
tagged with: ruby-on-rails-4
has title: Populate a drop down using result from a previous drop down
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47584098
tagged with: web
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/19392553
has body: I have a Rails database with Schools and Majors in it. Once the user selects his school, I want to fill up the major's drop down with only the majors from the corresponding school. Currently I have two working drop downs, but as you can see they just select all values. Will I need Json/Ajax/JavaScript for this, and if so how can I go about implementing it? &lt;div class="field"&gt; &lt;%= f.label :school_id %&gt;&lt;br&gt; &lt;%= f.collection_select :school_id, School.order(:name),:id,:name, include_blank: false %&gt; &lt;/div&gt; &lt;div class="field"&gt; &lt;%= f.label :major_id %&gt;&lt;br&gt; &lt;%= f.collection_select :major_id, Major.order(:name),:id,:name, include_blank: false %&gt; &lt;/div&gt;
tagged with: ruby
type: AnsweredQuestion
downvote count: 0
score: 6
type: Question
has answer: http://stackoverflow.com/a/29732571
accepted answer: http://stackoverflow.com/a/29732571
has comment: http://stackoverflow.com/comment/47584285

http://stackoverflow.com/comment/47631422
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29748127
has text: @MarkVeenstra as per my understanding, you need to wrap all code in an 'iffy' so that there is no global variable. With multiple files, you would need multiple iffies. You can't acess variables of one iffy in another.

http://stackoverflow.com/a/29748547
accepted answer of: http://stackoverflow.com/q/29743018
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/47648258
answers question: http://stackoverflow.com/q/29743018
downvote count: 0
score: 1
has body: You cannot remove functions, and neither can you redeclare them as this will lead to a fatal error. Unfortunately you haven't given any more context on your problem, so I cannot give you an exact solution. Based on this, there a three solutions to this problem SOLUTION 1 This is the fastest and easiest solution, but rest on the fact that the parent theme's function should be wrapped in the following condition if ( !function_exists( 'NAME_OF_FUNCTION' ) ) If this is the case, you can simply copy the parent function to your child theme as is and without the conditional statement, make your changes and your good to go. This is the only time you can redeclare the same function as the above condition first check if a function exists with the same name in the child theme, and if there is, it simply ignores and skips the parent function SOLUTION 2 This is also quite fast and easy and relies on filters. If the parent theme has build in filters, you can simply alter the function through the filters provided. In your child theme you can simply create a function to alter the filter and then hook that to the appropriate filter to alter the function's output SOLUTION 3 This is the effort solution where non of the above conditions are met. This is your last and only resort. What you should do here is Copy the parent function to be modified to your child theme and rename that function to whatever unique name suits you Modify this function as needed and safe it You now need to copy the affected templates to your child theme, in your case single.php. In these templates you will need to replace all instances of the old function with your newly created function and safe them Wordpress will now load the templates in your child theme ( in your case the child single.php ) instead of the parent template. This will ensure that the page is loaded with your new modified function
type: AcceptedAnswer

http://stackoverflow.com/comment/47610855
has text: you are echoing inside an echo statement
score: 1
comment on: http://stackoverflow.com/q/29738869
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47577902
has text: @DrewTuzson - I didn't know you had to wait to post a new answer. Here's a sort solution: http://jsfiddle.net/jfriend00/0ao5spgu/. FYI, please "accept" this answer by checking the green checkmark to the left of the answer. This will earn both you and I some reputation points on StackOverflow which can lead to you earning more privileges here.
type: AnswerComment
comment on: http://stackoverflow.com/a/29721090
type: Comment
score: 0

http://stackoverflow.com/comment/47767213
type: AnswerComment
comment on: http://stackoverflow.com/a/29817159
has text: They are located in the project folder indicated in my simplified file structure above.
score: 0
type: Comment

http://stackoverflow.com/a/29702748
upvote count: 6
answers question: http://stackoverflow.com/q/29699959
has comment: http://stackoverflow.com/comment/47563867
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/85299635
score: 6
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/47558154
accepted answer of: http://stackoverflow.com/q/29699959
has body: There is a proxy or CDN in between you and the server or your browser cache isn't refreshing the file. You've requested meteor.js which isn't a complete file (cut off half way). This is is the cause of the Unexpected End of file error. Clear your cache, or force your proxy/CDN to refresh the file's record.

http://stackoverflow.com/comment/47800596
score: 0
has text: Thanks Philip, any tips about how to use debug? mostly i'm worried that even though hiting submit on that button it does register as a conversion in my GA Conversion dashboard.
comment on: http://stackoverflow.com/a/29836884
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/47684919
score: 0
type: AnswerComment
has text: The font. I believe you can't see the difference in fonts in Hebrew, I won't notice difference in Arabic / Russian fonts. But trust me, that's really awful font. That's the font that being shown when you don't set font, that the default (the font that you see when you done with the HTML but didn't started with CSS). Usually I don't mind, but that font is extremely ugly...
type: Comment
comment on: http://stackoverflow.com/a/29758134

http://stackoverflow.com/q/29782222
has answer: http://stackoverflow.com/a/29805115
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
score: 9
has comment: http://stackoverflow.com/comment/47694889
type: AnsweredQuestion
tagged with: http-status-code-401
accepted answer: http://stackoverflow.com/a/29805115
has comment: http://stackoverflow.com/comment/47727642
has comment: http://stackoverflow.com/comment/47694477
type: Question
has body: I have a script running on a web page that needs to use the JQuery $.ajax method (currently using jquery 1.7.2) to submit several GET requests to a service endpoint on a different domain. I have the ajax call working in IE (9, 10, 11), but it fails with a 401 Unauthorized response in Firefox and Chrome. Part of the additional error message in Chrome is "Full authentication is required to access this resource". My ajax call is setup like this (dataType is "json" for these requests that fail, and async is true): $.ajax({ url: url, type: "GET", async: isAsync, dataType: dataType, username: user, password: pswd, success: function (response, status) { // success code here }, failure: function (response, status) { // failure code here }, complete: function (xhr, status) { // on complete code here } }); I am passing in the username and password required to access the service and this works in IE. I was understanding that the JQuery ajax function would handle the authentication correctly, so if a response comes back indicating that authorization is required, it would use the credentials that were provided to make that request correctly. Am I missing something here? Do I need to manually add the Authorization header for this to work? UPDATE: Here is the request, response, and cookie info reported by Chrome and IE via the F12 debugging tools (some info replaced with [...removed...]) Chrome (42.0.2311.90 m) Response Headers access-control-allow-credentials:true access-control-allow-origin:[...removed...] access-control-expose-headers: cache-control:private,max-age=0,must-revalidate connection:keep-alive content-encoding:gzip content-length:296 content-type:text/html;charset=ISO-8859-1 date:Tue, 21 Apr 2015 20:55:12 GMT expires:Tue, 21 Apr 2015 20:55:12 GMT p3p:CP="NON DSP COR CURa PSAa PSDa OUR NOR BUS PUR COM NAV STA" set-cookie:JSESSIONID=qd-app-1348vf1vrksvc76oshcwirvjp.qd-app-13;Path=/;Secure;HttpOnly set-cookie:NSC_vt1.sbmmzefw.dpn!-!IUUQT=ffffffff09091c3945525d5f4f58455e…
has comment: http://stackoverflow.com/comment/47696280
upvote count: 9
has comment: http://stackoverflow.com/comment/47702581
has comment: http://stackoverflow.com/comment/47694458
has title: jquery $.ajax call results in 401 unauthorized response when in Chrome or Firefox, but works in IE
linked to: http://stackoverflow.com/q/2870371

http://stackoverflow.com/a/29728219
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/29728169
upvote count: 1
has body: Object property labels should be unique. Create an object where property basket is an array of [fruit] objects and you can iterate the basket for . Example: var a = {'fruit' : { name : 'apple', cost : 5.00 }, 'misc' : { name: 'decorative fruit basket', cost: 7.89 } }; var b = {'fruit' : { name : 'pear', cost : 4.00 } } var c = {basket: [a, b]}; var result = document.querySelector('#result'); result.innerHTML = JSON.stringify(c, null, ' '); var i = c.basket.length; while (i--) { if (c.basket[i].fruit.name === 'pear') { result.innerHTML += '\n**Found pear, cost is: '+ c.basket[i].fruit.cost.toFixed(2); } } &lt;pre id="result"&gt;&lt;/pre&gt;

http://stackoverflow.com/a/29763772
has comment: http://stackoverflow.com/comment/47660901
downvote count: 1
has body: Since getYo returns an array, you can simply assign its return value to lineChartData directly: $scope.lineChartData = $scope.getYo();
answers question: http://stackoverflow.com/q/29763696
score: 0
has comment: http://stackoverflow.com/comment/47660518
has comment: http://stackoverflow.com/comment/47660647
type: Answer
upvote count: 1

http://stackoverflow.com/q/29811202
has answer: http://stackoverflow.com/a/29811211
score: 1
has body: I have an object like this. I want to call encodeToken from inside callback in refreshToken property. Can any body help me how javascript work for this? Thanks. var obj = { encodeToken: function (obj){ var opt = {expiresInMinutes: 1} return jwt.sign(obj, config.jwt_key, opt); }, decodeToken: function (token, callback){ jwt.verify(token, config.jwt_key, function (err, decoded){ callback(err, decoded); }); }, refreshToken: function (token, callback) { this.decodeToken(token, function (err, decoded){ callback(err, howToCall.encodeToken()); }); }, };
has answer: http://stackoverflow.com/a/29811285
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/29811285
accepted answer: http://stackoverflow.com/a/29811211
type: AnsweredQuestion
has title: Call Function in Same Level Property in Javascript
upvote count: 1
type: Question

http://stackoverflow.com/comment/47725254
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29798271
score: 0
has text: @JohnnyHK thanks, i have add some sample data.

http://stackoverflow.com/q/29750538
answer count: 4
has title: Get total amount of JavaScript form
score: 4
has answer: http://stackoverflow.com/a/29750995
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47633383
has body: I am still learning JavaScript and need a hand on updating my script to tally multiple items in my form. I use this script on my form to grab the value of a radio button and add that value to the 'Amount' field on an event checkout form. $(function(){ $('.ticketAmount').click(function() { $('#Amount').val(this.value); }); }); Now, I have a new form that has a few options to go along with the ticket selection. Now, the customer selects the ticket and has a few check boxes to add a private tour and assorted merchandise. Here is my HTML code: Regular Ticket $150.00 Couples Ticket $250.00 Table (Seats 10 Individuals) 1500.00 Private Tour $50.00 Meet the Chef $25.00 I want the checkboxes at the bottom to have their values added to the total amount when they are checked. Any help would be greatly appreciated.
has answer: http://stackoverflow.com/a/29751098
has comment: http://stackoverflow.com/comment/47633787
type: Question
has answer: http://stackoverflow.com/a/29751029
accepted answer: http://stackoverflow.com/a/29751098
has comment: http://stackoverflow.com/comment/47633549
tagged with: javascript
upvote count: 4
has answer: http://stackoverflow.com/a/29750829
downvote count: 0
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/29750829
has comment: http://stackoverflow.com/comment/47633477

http://stackoverflow.com/comment/47689110
score: 1
has text: [Array.filter](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29779445

http://stackoverflow.com/a/29697312
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47533861
upvote count: 1
answers question: http://stackoverflow.com/q/29697165
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29697165
type: Answer
has comment: http://stackoverflow.com/comment/47533733
has body: I see a typo on your directive definition: Should be restrict: "E", you're currently missing the 't'

http://stackoverflow.com/q/29698440
score: 1
type: Question
tagged with: javascript
has title: Angular service foreach $q.promise
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/29698683
tagged with: asynchronous
favorite count: 0
tagged with: promise
tagged with: angularjs
has body: i have the following function: this.getBenchmarkData = function () { var benchmarkData = []; var d = $q.defer(); users.forEach(function(user){ var dataArray = []; modules.forEach(function (module) { $http.get(api.getUrl('teamUserBenchmark', [user.user_id, module.id, user.team_id])) .success(function (response) { response.forEach(function(result){ dataArray.push(result.score); }) }); }); benchmarkData.push(dataArray); }); d.resolve(benchmarkData); return d.promise } Problem is that the d.resolve(benchmarkData) is runned before actual data has been put into it. I know that this is a problem with the async $http task. However i am not sure how to fix it. Can anyone point me in the right direction?
tagged with: angular-promise
has answer: http://stackoverflow.com/a/29698683
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/q/29832438
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/47807421
has comment: http://stackoverflow.com/comment/47791551
has title: Check the 3 first characters of a string
type: Question
score: 3
has comment: http://stackoverflow.com/comment/47807488
accepted answer: http://stackoverflow.com/a/29832476
tagged with: javascript
has comment: http://stackoverflow.com/comment/47791636
has comment: http://stackoverflow.com/comment/47791582
has comment: http://stackoverflow.com/comment/47791599
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47807843
favorite count: 0
has comment: http://stackoverflow.com/comment/47791603
has comment: http://stackoverflow.com/comment/47791483
has body: Given '052....', I need to check that the first two characters are '05' and the 3rd is between 0 and 9 but not 1. I have tried: var regex = /^[05]+[0,2-9]/;
tagged with: regex
has answer: http://stackoverflow.com/a/29832476
has comment: http://stackoverflow.com/comment/47791516

http://stackoverflow.com/q/29765012
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47685505
tagged with: angularjs
has answer: http://stackoverflow.com/a/29765862
has answer: http://stackoverflow.com/a/29765498
has comment: http://stackoverflow.com/comment/47662101
tagged with: angularjs-ng-repeat
upvote count: 5
downvote count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/17922557
has comment: http://stackoverflow.com/comment/86814650
has body: I'm trying to display a list of files which the user selects using the input[type=file]. HTML {{name}} PRINT JS app = angular.module('myApp'); app.controller('UploadFilesCtrl', ['$scope', function($scope){ $scope.uploadFiles = function(element){ var files = element.files; var filenames=[]; for (i=0; i<files.length; i++){ filenames.push(files[i].name); } $scope.files = files; $scope.filenames = filenames; console.log(files, filenames); }; $scope.test = function(){ console.log($scope.files, $scope.filenames); } }]); From some reason the list never gets updated. The filenames and files variables in the $scope never get updated outside of the uploadFiles function (When I click the PRINT button after selecting file I get undefined). Any ideas? Thanks!
tagged with: angularjs-scope
type: Question
answer count: 2
score: 5
has title: Displaying files list using AngularJS and input[type=file]
has comment: http://stackoverflow.com/comment/47662375
has comment: http://stackoverflow.com/comment/47662780

http://stackoverflow.com/comment/47776267
score: 0
has text: Try to use jshint http://jshint.com/.
type: Comment
comment on: http://stackoverflow.com/q/29824848
type: QuestionComment

http://stackoverflow.com/a/29715747
has body: First, you set the text of all li to 'a', then to 'b' and finally to 'c'. Instead, you may try iterating the li elements, and set the text content of the current one to the corresponding item in arr: var arr = ['a','b','c']; $('li').each(function(i) { $(this).text(arr[i]); }); var arr = ['a','b','c']; $('li').each(function(i) { $(this).text(arr[i]); }); Alternatively (but similarly), you can iterate the array, and set the text content of the corresponding li to the current value: var arr = ['a','b','c'], $li = $('li'); arr.forEach(function(txt, i) { $li.eq(i).text(txt); }); var arr = ['a','b','c'], $li = $('li'); arr.forEach(function(txt, i) { $li.eq(i).text(txt); });
score: 3
downvote count: 0
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/29715709

http://stackoverflow.com/comment/47739872
has text: I'm not getting this same result. Do you have an example on jsfiddle/codepen/plnkr?
comment on: http://stackoverflow.com/q/29802650
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29840222
has answer: http://stackoverflow.com/a/29840372
has answer: http://stackoverflow.com/a/29840385
answer count: 6
score: 0
has answer: http://stackoverflow.com/a/29840601
possible better answer: http://stackoverflow.com/a/29840372
has answer: http://stackoverflow.com/a/29840570
has answer: http://stackoverflow.com/a/29840412
tagged with: javascript
has title: Generate a HTML table from a given number with JavaScript
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29840601
tagged with: http://stackoverflow.com/tag/html
type: Question
has body: I previously came up with a situation that solved my problem in generating the table from a given word and printing it diagonally. This time however, I need to generate a table using JavaScript (no jQuery or other alternatives) from given numeric value. The given value determines the number of cols and rows (always equal amount). Example: I'd give a number 8 to my text-input, the JavaScript generates a table with 8 cols and 8 rows. The value needs to be numeric, so the run should break if the given value isNaN. Here is the previous code I tried to modify in order to make this happen, but failed with it pretty miserably: function generateTable() { var $c = document.getElementById("container"); var $table = document.createElement('table'); var $tbody = document.createElement('tbody'); var word = document.getElementById('word').value.split(""); $c.appendChild($table); $table.appendChild($tbody); for (var i=0, l=word.length; i<l; i++) { var $tr = document.createElement('tr'); $tbody.appendChild($tr); for (var j=0, jl=word.length; j<jl; j++) { var $td = document.createElement('td'); $td.appendChild(document.createTextNode(i==j ? word[i] : "-")); $tr.appendChild($td); } } } Generate Yes, that handles the given word and prints it diagonally, I tried to change some values and make an effect on how this generates the table, but managed to break the whole thing pretty much. That's why instead of posting the code I modified, I'm posting the code where I started to modify this from.
has answer: http://stackoverflow.com/a/29840561

http://stackoverflow.com/q/29799757
tagged with: javascript
linked to: http://stackoverflow.com/q/28324303
tagged with: matter.js
tagged with: mouseevent
score: 2
has comment: http://stackoverflow.com/comment/47728610
answer count: 1
downvote count: 0
has body: This is what I'm trying to work on right now, from the matter.js library. I want to use two events to trigger two HTML messages by grabbing the ball on the left side of the cradle that will say "Hey you grabbed the cradle" and then when you let go, it would say "Wow, look at that!". // Matter.js - http://brm.io/matter-js/ // Matter module aliases var Engine = Matter.Engine, World = Matter.World, Body = Matter.Body, Composites = Matter.Composites, MouseConstraint = Matter.MouseConstraint; // create a Matter.js engine var engine = Engine.create(document.body, { render: { options: { showAngleIndicator: true, showVelocity: true, wireframes: false } } }); // add a mouse controlled constraint var mouseConstraint = MouseConstraint.create(engine); World.add(engine.world, mouseConstraint); // add a Newton's Cradle (using the Composites factory method!) var cradle = Composites.newtonsCradle(280, 150, 5, 30, 200); World.add(engine.world, cradle); // offset the first body in the cradle so it will swing Body.translate(cradle.bodies[0], { x: 0, y: 0 }); // run the engine Engine.run(engine); Where I am currently at with trying to make it happen is at: cradle.mouseConstraint=function(){alert("hi")}; For more information, here is the Codepen: http://codepen.io/liabru/pen/abFml
tagged with: dom-events
favorite count: 0
has comment: http://stackoverflow.com/comment/47728976
type: UnansweredQuestion
tagged with: events
has comment: http://stackoverflow.com/comment/49425902
has comment: http://stackoverflow.com/comment/47727873
upvote count: 2
type: Question
has title: How do I create an HTML message for a mouseConstraint on this cradle?
has answer: http://stackoverflow.com/a/74909982
has comment: http://stackoverflow.com/comment/47728730

http://stackoverflow.com/comment/47800743
type: QuestionComment
has text: What have you already tried?
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29837026

http://stackoverflow.com/q/29839345
tagged with: firefox-addon
answer count: 1
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/5661699
has title: How can a Firefox extension detect when user searches with search bar?
has body: Is it possible for a Firefox extension to hook the browser-provided search bar so that when the user performs a search, a callback function (provided by the extension) receives the search query and which search engine was used? I was able to find information on what XUL element contains the search bar text box ( How do I target the search bar from a Firefox extension? ) but that's as far as I was able to get.
has answer: http://stackoverflow.com/a/32268645
type: UnansweredQuestion
upvote count: 3
type: Question
score: 3
tagged with: javascript

http://stackoverflow.com/comment/47605945
type: QuestionComment
score: 0
has text: The calendar is set to public [share only my free/busy information]. With the calendar settings changed to purely public, I'm still getting a 400 bad request error.
type: Comment
comment on: http://stackoverflow.com/q/29714710

http://stackoverflow.com/a/29774330
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: As your code says you are trying to reload page before getting the response, so request is not completed till, for this you have to delay the reload or better way submit form using ajax and reload page in the callback function.
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29773521
answers question: http://stackoverflow.com/q/29773521
has comment: http://stackoverflow.com/comment/47679610

http://stackoverflow.com/q/29692169
tagged with: javascript
tagged with: fixed
score: -1
has comment: http://stackoverflow.com/comment/47522202
downvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47521118
tagged with: http://stackoverflow.com/tag/html
has body: There are three column in my website and they can not be balanced from bottom. I just want the div to be fixed once it scrolls all over and let another div scrollable. Sorry if I failed to explain the issue clearly. Please have a look at this website: http://scoopwhoop.com
has comment: http://stackoverflow.com/comment/47521173
tagged with: css
has answer: http://stackoverflow.com/a/29703526
upvote count: 0
has title: fix div position when it scrolled to its end using jquery
type: Question
has comment: http://stackoverflow.com/comment/47522987
has comment: http://stackoverflow.com/comment/47520909

http://stackoverflow.com/q/29802748
tagged with: javascript
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: php
downvote count: 1
has body: I need can opportunity enable/disable validation a form on the javascript side on event by click for example. I use activerecord for creating this form.
score: -1
type: Question
has comment: http://stackoverflow.com/comment/47733822
upvote count: 0
has answer: http://stackoverflow.com/a/29805407
tagged with: yii2
has title: Yii2 cancel validation on the javascript side

http://stackoverflow.com/a/29756070
accepted answer of: http://stackoverflow.com/q/29755250
upvote count: 3
downvote count: 1
score: 2
type: AcceptedAnswer
has body: Host the video and use an API where you can; customize the media player, hide / show / customize load screens, cue points, start poster / end poster, etc. Or else your spending your time hacking youtube API capabilities with funky javascript. JW player: http://www.jwplayer.com/ Flow Player: https://flowplayer.org/docs/cuepoints.html And many others you could check out. video.js, popcorn.js, etc etc.
type: Answer
answers question: http://stackoverflow.com/q/29755250

http://stackoverflow.com/q/29707535
tagged with: python
downvote count: 0
type: Question
score: 3
has body: I have a python application that contains an Autobahn websocket server to send to an HTML5/javascript GUI. I have been transferring data between them using JSON, but am now really starting to stress my bandwidth as I need to send arrays of 1000's of (single precision) 3D positions in some of my messages. Writing each of those floats as text for JSON seems like an obvious waste when I could just in theory just send 4 bytes for each number. BSON seems like a much better idea, but I can't seem to get it working. Here is the gist of my code: # Python side class BroadcastServerFactory(WebSocketServerFactory): # ... def broadcast_message(message): bson_msg = bson.BSON.encode(msg) prepared_msg = self.prepareMessage(bson_msg, isBinary=True) for c in self.clients: self.clients[c].sendPreparedMessage(prepared_msg) // Javascript side app.sock = new WebSocket('ws://127.0.0.1:9090'); app.sock.binaryType = "arraybuffer"; // ... sock.onmessage = function(e) { var msg = null; try { msg = BSON.deserialize(e.data); } catch(err) { console.log('Failed to deserialize: ', err); } if(msg) app.onmessage(msg); }; Unfortunately, as soon as I get a message on the javascript side, my exception handler triggers with: Failed to deserialize: Error: corrupt bson message {stack: (...), message: "corrupt bson message"} I am using the browser build of the mongodb bson library on the javascript side, and the pymongo bson implementation on the Python side.
tagged with: bson
upvote count: 3
has title: Sending BSON from python to javascript over websockets
answer count: 1
tagged with: websocket
tagged with: javascript
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29711650

http://stackoverflow.com/q/29713894
favorite count: 0
has answer: http://stackoverflow.com/a/29713922
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29714071
has title: My Timer using AngularJS is not working in HTML page
score: 3
upvote count: 3
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47562955
downvote count: 0
tagged with: javascript
has body: This is my controller function setInterval(function () { var d = new Date(); var seconds = d.getMinutes() * 60 + d.getSeconds(); var fiveMin = 60 * 1; var timeleft = fiveMin - seconds % fiveMin; var result = parseInt(timeleft / 60) + ':' + timeleft % 60; //console.log(result); var timerObj= { timer : result } $scope.timerArray = timerObj; if (timeleft === 1) { $scope.statusDetails = $scope.reset; $scope.timeDetails(); $scope.get_dbStatus(); $scope.get_sosStatus(); $scope.get_cepStatus(); $scope.get_taskStatus(); $scope.get_mqStatus(); $scope.get_mrStatus(); $scope.get_dmStatus(); } $scope.$apply(); },500); This is my html page Name Version Status Contact Info {{status.title}} {{status.apiVersion}} - Timer and all the things are working fine.But each time timer gets expired and the list gets refreshed the updated list appends to the previous list.

http://stackoverflow.com/comment/47614877
has text: Check this thread: http://stackoverflow.com/questions/4806286/difference-between-void-0-and-undefined
type: QuestionComment
comment on: http://stackoverflow.com/q/29740830
type: Comment
score: 1

http://stackoverflow.com/comment/47590926
type: Comment
comment on: http://stackoverflow.com/a/29728551
type: AnswerComment
has text: That is not what you asked ;)
score: 0

http://stackoverflow.com/a/29807724
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29807636
score: 1
downvote count: 0
has body: if you put the stuff inside of your for loop in a separate function it will fix your closure issue. so: var bob = function(i){ console.log(i); vs.selectedTags[i].tickers = ''; console.log(vs.selectedTags[i].tickers); ApiFactory.getTagData(vs.chosenTicker, vs.selectedTags[i].term_id).then(function(data) { // console.log(data.data.ticker_tag); console.log(data.data.ticker_tag.tickers); console.log(i); // console.log(vs.selectedTags[0]); // How would you properly iterate [0 - 1 - 2] here? vs.selectedTags[i].tickers = data.data.ticker_tag.tickers; console.log(vs.selectedTags[i]); }); } for (var i = 0; i &lt; vs.selectedTags.length; i++) { bob(i); }
has comment: http://stackoverflow.com/comment/47743795

http://stackoverflow.com/q/29812338
has comment: http://stackoverflow.com/comment/47753399
accepted answer: http://stackoverflow.com/a/29813079
has comment: http://stackoverflow.com/comment/47752819
has comment: http://stackoverflow.com/comment/47753580
has comment: http://stackoverflow.com/comment/47753869
has comment: http://stackoverflow.com/comment/47752785
has answer: http://stackoverflow.com/a/29812404
upvote count: 4
has comment: http://stackoverflow.com/comment/47753648
has comment: http://stackoverflow.com/comment/47753443
has comment: http://stackoverflow.com/comment/47752767
answer count: 4
score: 2
possible better answer: http://stackoverflow.com/a/56257107
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/56257107
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: SyntaxError: expected expression, got ')'
has comment: http://stackoverflow.com/comment/47753458
has comment: http://stackoverflow.com/comment/47752662
has answer: http://stackoverflow.com/a/29812932
type: Question
has answer: http://stackoverflow.com/a/29813079
has body: I've been stuck at this error for a few days and still couldn't figure out what is wrong. Would be great if someone could just point me to the right direction of solving this issue. Update: I realise that error is gone when I commented "addMessages(xml)" in the updateMsg() function. How do I make it work then? Error: http://i.imgur.com/91HGTpl.png Code: $(document).ready(function () { var msg = $("#msg"); var log = $("#log"); var timestamp = 0; $("#name").focus(); $("#login").click(function() { var name = $("#name").val(); if (!name) { alert("Please enter a name!"); return false; } var username = new RegExp('^[0-9a-zA-Z]+$'); if (!username.test(name)){ alert("Invalid user name! \n Please do not use the following characters \n `~!@#$^&amp;*()=|{}':;',\\[\\].&lt;&gt;/?~@#"); return false; } $.ajax({ url: 'login.php', type: 'POST', dataType: 'json', data: {name: name}, success: function() { $(".login").hide(); } }) return false; }); $("#form").submit(function() { if (!msg.val()) { return false; } $.ajax({ url: 'add_message.php', type: 'POST', dataType: 'json', data: {message: msg.val()}, }) msg.val(""); return false }); window.setInterval(function () { updateMsg(); }, 300); function updateMsg() { $.post('server.php', {datasize: '1024'}, function(xml) { addMessages(xml); }); } function addMessages(xml) { var json = eval('('+xml+')'); $.each(json, function(i, v) { tt = parseInt(v.time); if (tt &gt; timestamp) { console.log(v.message); appendLog($("&lt;div/&gt;").text('[' + v.username + ']' + v.message)); timestamp = tt } }); } function appendLog(msg) { var d = log[0] var doScroll = d.scrollTop == d.scrollHeight - d.clientHeight; msg.appendTo(log) if (doScroll) { d.scrollTop = d.scrollHeight - d.clientHeight; } } });
has comment: http://stackoverflow.com/comment/47753523
has comment: http://stackoverflow.com/comment/47753528
has comment: http://stackoverflow.com/comment/47753578
has comment: http://stackoverflow.com/comment/47752731
has comment: http://stackoverflow.com/comment/47752752
downvote count: 2
has comment: http://stackoverflow.com/comment/47753430

http://stackoverflow.com/comment/47520230
type: Comment
type: AnswerComment
has text: That is it. Adding "register" to both files. Thanks a lot!
comment on: http://stackoverflow.com/a/29691237
score: 0

http://stackoverflow.com/comment/47816322
has text: You can encode it as base64 and decode in server side
comment on: http://stackoverflow.com/q/29844976
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47532805
type: Comment
comment on: http://stackoverflow.com/a/29698269
has text: Sorry, I forgot to mention, that instead of "Go to" should be text from the link
type: AnswerComment
score: 0

swagger-ui
tag name: swagger-ui
type: Tag
tags question: http://stackoverflow.com/q/29747096

http://stackoverflow.com/q/29823273
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29823770
tagged with: javascript
tagged with: reactjs
answer count: 1
downvote count: 0
favorite count: 0
has body: I know this has been asked before but the suggested solutions don't help me, so, here's my code which for some reason fails. app.js: (function(React, _) { var App = require('./components/App.react'); _.mixin(_.string.exports()); var render = function() { React.render( React.createElement(App), document.getElementById('reactContent') ); }; render(); }(React, _)); And then, App.react.js: var React = require('react'); var Test = React.createClass({ render: function() { return Hello world } }) module.exports = Test; Now, my console says: Warning: This JSX uses a plain function. Only React components are valid in React's JSX transform. app.js:20281 Warning: Something is calling a React component directly. Use a factory or JSX instead. See: http://fb.me/react-legacyfactory app.js:6475 Uncaught TypeError: Cannot read property '__reactAutoBindMap' of null Feels like the simplest thing... I'll include my package.json just incase it's needed. { "name": "app", "version": "0.0.1", "devDependencies": { "gulp": "3.8.10", "gulp-run": "1.6.5", "gulp-less": "2.0.1", "gulp-concat": "2.4.3", "gulp-uglify": "1.0.2", "gulp-minify-css": "0.3.11", "gulp-jshint": "1.9.0", "browser-sync": "1.8.2", "browserify": "3.44.2", "vinyl-source-stream": "1.0.0", "vinyl-buffer": "1.0.0", "reactify": "latest", "underscore": "^1.7.0", "del": "1.1.1", "envify": "~3.0.0" }, "paths": { "less": "assets/less/*.less", "js": "./app/**/*.js", "jsx": "./app/**/*.jsx", "app": "./app/app.js", "html": "*.html" }, "dest": { "style": "style.css", "app": "app.js", "dist": "dist" }, "dependencies": { "react": "latest", "underscore": "^1.7.0", "flux": "^2.0.0" } } There's a lot more in here as you can see from the .json file, I just rebuilt the code to make a really simple case and to isolate the issue. Any ideas?
type: UnansweredQuestion
score: 1
has title: React.js Cannot read property '__reactAutoBindMap' of null

http://stackoverflow.com/q/29816651
has title: Stored XSS prevention with rich-text comments using DocumentFragment and innerHTML
score: 2
upvote count: 2
tagged with: innerhtml
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29816977
tagged with: javascript
type: Question
tagged with: richtext
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/29816977
favorite count: 0
tagged with: xss
has body: I wonder if someone would be able to confirm whether this is safe or not, as I can't seem to find any reference online, nor another question on SO, that specifically deals with this "solution" to XSS. I need to embed rich-text comments into my page. Obviously the risks of XSS are high, so my plan was to innerHTML a temporary DIV in a DocumentFragment and then recurse the tree, using a pre-defined whitelist of tagNames and attribute names that I have deeemed 'safe', removing any unsafe ones. I can then move this now-safe HTML into my real document. Is this a safe way of doing it? Is there any way an XSS attack could be triggered by doing this through a DocumentFragment? I'm hoping that it'll be isolated from the real document and hence shielded from user event triggering that might kick off any attacks.

http://stackoverflow.com/comment/47571500
score: 4
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29718519
has text: It should be rather obvious from the condition that it only returns if `Foo` is not an instance of itself, otherwise it continues ?

http://stackoverflow.com/q/29715185
has comment: http://stackoverflow.com/comment/47565648
has comment: http://stackoverflow.com/comment/47565970
has comment: http://stackoverflow.com/comment/47565340
type: Question
has comment: http://stackoverflow.com/comment/47566080
has comment: http://stackoverflow.com/comment/47565898
has comment: http://stackoverflow.com/comment/47565444
answer count: 1
tagged with: javascript
has title: javascript confirm() terminate my script when dialog opened
score: 0
has body: i have script for showing seconds of the hour, demo jsfiddle here following my script : confirm! my script works well, but when i click button "confirm!", the seconds not increase (freeze), why?
has comment: http://stackoverflow.com/comment/47565377
has comment: http://stackoverflow.com/comment/47565698
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29716482

http://stackoverflow.com/comment/47638814
score: 0
type: Comment
has text: Amazing! That's the simplest solution I've seen! +1
type: AnswerComment
comment on: http://stackoverflow.com/a/29753187

http://stackoverflow.com/comment/47811998
type: AnswerComment
score: 0
type: Comment
has text: @user3836205 Instead of storing only a number, you could store objects with a parent, item and value. Here value would be the number you're currently already calculating, parent would be the solution to the subproblem you expanded to get the solution to your current subproblem, and item would just be the item you added.
comment on: http://stackoverflow.com/a/29842741

http://stackoverflow.com/q/29825020
type: AnsweredQuestion
has title: JQuery UI sortable placeholder per panel bootstrap
type: Question
tagged with: jquery-ui
tagged with: placeholder
tagged with: javascript
has answer: http://stackoverflow.com/a/29825351
score: 0
answer count: 1
has body: I have a problem in sortable option in JQuery Ui. for example I have multi div or panel (bootstrap) and each div have custom height and width. now I want to have placeholder base on each height and width. $(function () { $(".grid").sortable({ tolerance: 'pointer', revert: 'invalid', placeholder: 'span2 well placeholder tile', forceHelperSize: true }); }); .placeholder { border: 1px solid green; background-color: white; -webkit-box-shadow: 0px 0px 10px #888; -moz-box-shadow: 0px 0px 10px #888; box-shadow: 0px 0px 10px #888; } .tile { height: 100px; } .grid { margin-top: 1em; } A B C D http://jsfiddle.net/myimedia/Sm4EK/
accepted answer: http://stackoverflow.com/a/29825351

http://stackoverflow.com/comment/47820373
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29842802
has text: Thanks everyone for contributing. It's working now. The problem is inside this `( )` braces. Their were 2 spacebars at the top of my php file therefore the `responseText` printed was ` login_successful` instead of 'login_successful'.

http://stackoverflow.com/a/29703466
type: Answer
accepted answer of: http://stackoverflow.com/q/29700737
answers question: http://stackoverflow.com/q/29700737
score: 0
type: AcceptedAnswer
has body: Use this simple index search by value algorithm. function index_by_value(teamlist, teamname) { index = 0 for (var i = 0; i &lt; teamlist.length; i++) { if (teamlist[i].teamname == teamname) { index = i; } } return index; } index = index_by_value(teamlist, "Aberdeen"); // an example Keep in mind though that if there are multiple objects in the list with the same teamname, it will return the last one's index. If it does not exist, the function will return 0.

http://stackoverflow.com/q/29785220
type: UnansweredQuestion
tagged with: plugins
tagged with: handsontable
has body: I have an example of color change already happening. The issue is that changing the color of a new cell, row, or column will change the color of the previous cell/row/column. The previous cell should keep it's original color, and I need this to happen dynamically with one function (rather than multiple renderers). In the fiddle there are 3 color options, but I'm actually using a color picker with hundreds of options. How can I handle this color change on the fly (right click)? http://jsfiddle.net/anschwem/hkhk5zbo/17/ var data = [ ['', 'Maserati', 'Mazda', 'Mercedes', 'Mini', 'Mitsubishi'], ['2009', 0, 2941, 4303, 354, 5814], ['2010', 3, 2905, 2867, 412, 5284], ['2011', 4, 2517, 4822, 552, 6127], ['2012', 2, 2422, 5399, 776, 4151] ], celldata = [], container = document.getElementById('example'), hot, sentrow, sentcol; var colorRenderer = function (instance, td, row, col, prop, value, cellProperties) { Handsontable.renderers.TextRenderer.apply(this, arguments); td.style.backgroundColor = $('#color_field').val(); }; var settings = { data: data, minSpareRows: 1, rowHeaders: true, colHeaders: true, contextMenu: true, startRows: 5, startCols: 5, //columns: coldata, cell: celldata, cells: function (row, col, prop) { if (row === sentrow) { this.renderer = colorRenderer; } if (col === sentcol) { this.renderer = colorRenderer; } }, }; hot = new Handsontable(example, settings); hot.updateSettings({ contextMenu: { callback: function (key, options) { if (key === 'cellcolor') { setTimeout(function () { //timeout is used to make sure the menu collapsed before alert is shown var row = hot.getSelected()[0]; var col = hot.getSelected()[1]; var item = {}; item.row = row; item.col = col; item.renderer = colorRenderer celldata.push(item) hot.updateSettings({cell: celldata}); hot.render(); }, 100); } if (key === 'rowcolor') { setTimeout(function () { //timeout is used to make sure the menu collapsed before alert is shown var row = hot.getSelected()[0]; sentrow = row; hot.render(); }, 10…
has answer: http://stackoverflow.com/a/29785774
has title: Handsontable change colors of cells/rows/columns with color picker?
type: Question
tagged with: renderer
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1

http://stackoverflow.com/comment/47526288
type: QuestionComment
type: Comment
has text: @greenhoorn not really. There's a big difference between a programming language and a library/framework which can be used within a programming language.
score: 0
comment on: http://stackoverflow.com/q/29694815

http://stackoverflow.com/a/29754190
has body: "How can I say invoke the greaterThan method ONLY when the field meets the required conditions?" Since the field is only required under those conditions, ideally, none of your other rules should be fired when the field is left blank. However, there is a piece missing from your custom method that would allow it to be ignored whenever the field is left blank. Testing against the condition, this.optional(element), will ensure that your custom rule is not enforced on a blank field. jQuery.validator.addMethod("greaterThan", function(value, element, params) { if (this.optional(element)) { // "required" not in force and field is empty return true; } else { // otherwise, use your rule if (!/Invalid|NaN/.test(new Date(value))) { return new Date(value) &gt; new Date($(params).val()); } return isNaN(value) &amp;&amp; isNaN($(params).val()) || (Number(value) &gt; Number($(params).val())); } },'Must be greater than {0}.');
answers question: http://stackoverflow.com/q/29753993
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29753993
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/88305637

http://stackoverflow.com/a/29727695
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29708416
downvote count: 0
score: 1
has body: Just storing the value in memory will not be enough because your application server will probably be serving request with different processes and every process will have a different copy of the class variables. Even if that work when the server is reset you will lose the counter value anyway. I would use a specialized database like Redis. It's very fast and easy to do what you want. You just use something like this: require "redis" redis = Redis.new total_pageviews = redis.incr("page_counter")

http://stackoverflow.com/q/29716554
score: 2
type: AnsweredQuestion
tagged with: stream
has title: Getting number of bytes read in zlib stream
has body: I am using a zlib.Inflate to inflate a chunk of data. The problem I have now is that all I know is how many bytes of uncompressed data there are but not how many that is in the compressed stream. Im currently just writing the entire input buffer to the inflater and then read the amount of uncompressed bytes from it. That gives me the correct output data but I have to know how many bytes were consumed to continue parsing the remaining data. So right now I did the following for testing: var inflater = zlib.createInflate(); inflater.write(strm.buffer.slice(strm.position)); inflater.on("readable", (function(inflater, len) { return function() { console.log(inflater); var decompData = inflater.read(len); console.log(inflater); var output = fs.createWriteStream("output.bin"); output.write(decompData); } })(inflater, len)); I checked all members of the inflater before and after the read but nothing changes, every single value except the read buffer (with the decompressed data) is the same. Is there a way to determine how many bytes were read from the compressed buffer? Thank you in advance, Cromon
has answer: http://stackoverflow.com/a/29724552
type: Question
tagged with: zlib
tagged with: javascript
has comment: http://stackoverflow.com/comment/47598602
has comment: http://stackoverflow.com/comment/47569021
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29724552
favorite count: 0
upvote count: 2
tagged with: node.js

http://stackoverflow.com/comment/47827227
has text: Try moving that last bit of code `if( $('#navbar-collapse-1').hasClass('dropdown-open') ){ (".myMenu-glyphicon").removeClass("glyphicon-menu-up");` into the callback function for navbar-collapse-2 on shown.be.collapse
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29830039

http://stackoverflow.com/comment/47811580
score: 0
type: AnswerComment
type: Comment
has text: Yeah, I noticed that after I posted my code, sheesh :P
comment on: http://stackoverflow.com/a/29842725

http://stackoverflow.com/a/69123372
has body: The accepted answer works good - Date.now = jest.fn().mockReturnValue(new Date('2021-08-29T18:16:19+00:00')); But if we want to run unit tests in pipeline we have to make sure we are using the same time zone. To do that we have to mock timezone as well - jest.config.js process.env.TZ = 'GMT'; module.exports = { ... }; See also: the full list of timezones (column TZ database name)
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/29719631
upvote count: 1

http://stackoverflow.com/q/29839622
tagged with: express
favorite count: 0
has comment: http://stackoverflow.com/comment/47806119
tagged with: angularjs
upvote count: 8
has comment: http://stackoverflow.com/comment/47817894
tagged with: node.js
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/27742070
type: Question
answer count: 8
score: 8
has comment: http://stackoverflow.com/comment/47820415
has answer: http://stackoverflow.com/a/29840080
has answer: http://stackoverflow.com/a/29839659
has answer: http://stackoverflow.com/a/29848391
has answer: http://stackoverflow.com/a/57982162
has answer: http://stackoverflow.com/a/75472736
has answer: http://stackoverflow.com/a/29847731
tagged with: cors
has body: Basically, I need to run a Node/Express server with json-server to mock a RESTFUL API for a test Angular app I'm developing. The issue is that Google Chrome is throwing an error indicating that I've run into a CORS issue. I've tried configuring my server in such a way as to address the CORS issue . . . app.use(function(req, res, next) { res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); next(); }); . . . to no avail. Is there anything more I could do without fiddling with JSONP or altering my Angular code in any way? It seems to work just fine on a Rails server. Edit: As many have suggested, I've attempted to use the cors module to address the issue, but that doesn't seem to be working, either. Here's my server.js file: var express = require('express'); var app = express(); var path = require("path"); var jsonServer = require("json-server"); var databaseServer = jsonServer.create(); var cors = require("cors"); app.use(cors()); app.use("/", express.static(__dirname)); var server = app.listen(3000, function () { var host = server.address().address; var port = server.address().port; console.log('Example app listening at http://%s:%s', host, port); }); var object = { "fighters": [ { "id": 1, "firstName": "Jose", "lastName": "Aldo", "nickname": "Scarface", "wins": 25, "losses": 1, "draws": 0, "imageUrl": "/images/jose_aldo.png" }, { "id": 2, "firstName": "Conor", "lastName": "McGregor", "nickname": "", "wins": 17, "losses": 2, "draws": 0, "imageUrl": "/images/conor_mcgregor.png" } ] }; databaseServer.use(jsonServer.defaults); databaseServer.use(jsonServer.router(object)); databaseServer.listen(4000); And here's my Angular service: var FighterService = angular.module("FighterService", ["ngResource"]); FighterService.factory("Fighter", ["$resource", function ($resource) { return $resource("localhost:4000/fighters/:fighterId", { fighterId : "@id" }, { query: { method: "GET", params: {…
has answer: http://stackoverflow.com/a/29839722
has answer: http://stackoverflow.com/a/29852226
downvote count: 0
tagged with: javascript
has title: I'm attempting to use json-server, Node, and Express to mock a RESTFUL API for my Angular app on localhost. CORS issues have ensued
has comment: http://stackoverflow.com/comment/47805594

http://stackoverflow.com/q/29729196
has answer: http://stackoverflow.com/a/29729332
has comment: http://stackoverflow.com/comment/47592108
tagged with: javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29729490
downvote count: 0
tagged with: bootstrap-modal
has title: Cannot Read Property 'top' occurs when click button to open modal window
tagged with: jquery
favorite count: 0
type: Question
score: 3
accepted answer: http://stackoverflow.com/a/29729490
has body: The following code works when the page loads. However when I click on a button that is supposed to open a modal window I get the following error: Uncaught TypeError: Cannot read property 'top' of undefined How can I fix this error? if ($(window).width() &gt; 992) { (function($) { "use strict"; $(".page-scroll a[href^='#'], #intro a").on('click', function(e) { e.preventDefault(); var hash = this.hash; $('html, body').stop().animate({ scrollTop: $(hash).offset().top - 100}, 2000, 'easeOutExpo'); }); })(jQuery); $('body').scrollspy({ target: '.navbar', offset: 110 }); // alert("large"); } else { (function($) { "use strict"; $(".page-scroll a[href^='#'], #intro a").on('click', function(e) { e.preventDefault(); var hash = this.hash; $('html, body').stop().animate({ scrollTop: $(hash).offset().top - 50}, 2000, 'easeOutExpo'); }); })(jQuery); $('body').scrollspy({ target: '.navbar', offset: 70 }); // alert("small"); } //modal popup function function popup_modal(item){ var link = $(item).attr('id'); $('#bootstrap_modal').load('/'+link+''); $('#bootstrap_modal').modal('show'); $("#bootstrap_modal").on("show", function () { $("body").addClass("modal-open"); }).on("hidden", function () { $("body").removeClass("modal-open") }); } //Modal pop up $('.mmodal').on('click', function(){ popup_modal(this); });
upvote count: 3
answer count: 2
possible better answer: http://stackoverflow.com/a/29729332

http://stackoverflow.com/q/29773263
favorite count: 0
downvote count: 5
type: UnansweredQuestion
tagged with: asp.net-mvc-4
has body: $(function () { jQuery('#onselectExample').timepicker({ 'minTime': '7:00am', 'maxTime': '7:00pm', //format: 'H:i' }); }); &lt;div class="row"&gt; &lt;div class="large-4 columns left" style="text-align:right;"&gt;@Html.Label("Time")&lt;/div&gt; &lt;div class="large-7 columns left"&gt; &lt;input id="onselectExample" type="text" class="time" name="onselectExample" required/&gt; &lt;/div&gt; &lt;/div&gt; I am having a field in my form which is "Time". It is jQuery time picker. I can see the time every half hourly,i have given specific time i.e; from morning 7-am to evening 7-pm.I have taken the time like this as it will be used for giving appointments and in a particular time-slot only 3 customers can get appointment.And,i also want to disable the time,which has gone in the present day and the previous days as well.I don't want to do it with Database.
upvote count: 0
score: -5
has comment: http://stackoverflow.com/comment/47677126
type: Question
has title: I want to disable Time in time picker
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29774026
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/comment/47565374
type: QuestionComment
has text: Put the the images inside the overlay divs and give the overlays a higher z-index value, copy the exact css from the images to the overlay and remove the margin for the images -- demo, http://jsfiddle.net/8zv5yyrw/ -- if this is what you are after ill put it as an answer
score: 1
comment on: http://stackoverflow.com/q/29715073
type: Comment

http://stackoverflow.com/comment/47538275
type: Comment
type: QuestionComment
has text: I don't have a DB... is logging into Google+ so complicated...I have posted some code I removed before...I tried the last script and got a successful console.log. But the user still gets logged in anyway...
score: 0
comment on: http://stackoverflow.com/q/29700641

http://stackoverflow.com/q/29736374
answer count: 2
has body: I have the following nvd3 stacked Area Chart: I want to add margin between the numbers/dates and the graph as well as the legend at the top and the graph. (please see the picture, I've marked the positions with a red line: I've been investigating the rendered html but can't access the margin values via css, even if I try it inline with firefox's console. I've been able to change font-family and color with this css: #chart1 height: 300px text fill: #1a1f22 font-size: 0.7em font-family: 'Source Sans Pro', sans-serif But still whatever element (text,g,svg,...) I'm trying to attach a style to, nothing in terms of margin is changing. Here's the javascript code for the chart: nv.addGraph(function() { var histcatexplong = [ &lt;?= $array ?&gt; ]; var colors = d3.scale.category20(); var keyColor = function(d, i) {return colors(d.key)}; var chart; chart = nv.models.stackedAreaChart() .useInteractiveGuideline(true) .showControls(false) .x(function(d) { return d[0] }) .y(function(d) { return d[1] }) .color(keyColor) .transitionDuration(300); chart.xAxis .tickFormat(function(d) { return d3.time.format('%e.%m.%y')(new Date(d)) }); chart.yAxis .tickFormat(d3.format(',.2f')); d3.select('#chart1') .datum(histcatexplong) .transition().duration(1000) .call(chart) .each('start', function() { setTimeout(function() { d3.selectAll('#chart1 *').each(function() { if(this.__transition__) this.__transition__.duration = 1; }) }, 0) }); nv.utils.windowResize(chart.update); return chart; }); I've been reading all over nvd3's examples and docs, but still can't find a way to manipulate above said. Does somebody know of a way to do?
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: css
has answer: http://stackoverflow.com/a/29785139
type: AnsweredQuestion
tagged with: nvd3.js
has answer: http://stackoverflow.com/a/29762004
type: Question
tagged with: charts
has title: change margins and padding in nvd3 chart
possible better answer: http://stackoverflow.com/a/29762004
accepted answer: http://stackoverflow.com/a/29785139
score: 10
upvote count: 10

http://stackoverflow.com/comment/47619831
type: Comment
comment on: http://stackoverflow.com/q/29743018
score: 0
type: QuestionComment
has text: you tried that http://php.net/manual/en/function.override-function.php ?

http://stackoverflow.com/a/29697833
answers question: http://stackoverflow.com/q/29697131
upvote count: 1
has comment: http://stackoverflow.com/comment/47548582
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29697131
type: Answer
has body: If you desired just the contents of the .post divs to be appended then you can do this in a single operation (uses an immediate child selector under the .post divs). An each is undesirable in jQuery if you can avoid it: $.get(nextLink, function(html) { $('#item-cont').append($('#item-cont div.post &gt;', html)); }); If you also wanted the .post divs themselves to be added, $.get(nextLink, function(html) { $('#item-cont').append($('#item-cont div.post', html)); });

http://stackoverflow.com/comment/47780587
has text: @NicolasElKhoury: Yeah, as soon as I saw Sci's answer, I went "doh!" and figured it would be the primary issue. That said, though, do note encoding, it's important. A lot of people read files that are actually in Windows-1252 or ISO 8859-1 as though they were in UTF-8, and end up with things being "mostly" fine but wondering why they're getting odd characters when people do something "special." :-)
comment on: http://stackoverflow.com/a/29797553
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/29689145
downvote count: 0
has comment: http://stackoverflow.com/comment/47557833
score: 1
has comment: http://stackoverflow.com/comment/47517234
has comment: http://stackoverflow.com/comment/47516805
has comment: http://stackoverflow.com/comment/47517050
has comment: http://stackoverflow.com/comment/47516566
has comment: http://stackoverflow.com/comment/47517331
has comment: http://stackoverflow.com/comment/47516439
has comment: http://stackoverflow.com/comment/47516759
has comment: http://stackoverflow.com/comment/47516638
has comment: http://stackoverflow.com/comment/47515702
accepted answer of: http://stackoverflow.com/q/29689052
upvote count: 1
has body: The main problem is this part +return EliminarTareas(" + database + ", " + res.tarea +");'>". It discards the second parameter since you closed the paranthesis ), and it also has quote problems. It should be like this +" return EliminarTareas(" + database + ", " + res.tarea + ");'>" However, I believe addressing this task with .data would be effective, and it may provide a better structure. Below is my version with some codes from yours (DEMO: https://jsfiddle.net/9q4hLs3a/): var nuevo = $(" Eliminar "); $('#listatareas').append(nuevo); $(document).ready(function(){ $(document).on('click', '#listatareas button', function(){ var var1 = $(this).data('var1'); var var2 = $(this).data('var2'); EliminarTareas(var1 , var2 ) }); function EliminarTareas(id, base){ base.transaction(function(tx){ tx.executeSql("DELETE tarea FROM Tareas WHERE tarea=?", [id], function (){ }); }
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29689052
has comment: http://stackoverflow.com/comment/47517518
has comment: http://stackoverflow.com/comment/47516324
has comment: http://stackoverflow.com/comment/47516618
has comment: http://stackoverflow.com/comment/47517097
type: Answer
has comment: http://stackoverflow.com/comment/47515710

http://stackoverflow.com/comment/47638408
score: 2
has text: "Content of the last checkbox"? But you're using text fields.
type: QuestionComment
comment on: http://stackoverflow.com/q/29753052
type: Comment

http://stackoverflow.com/comment/47725181
comment on: http://stackoverflow.com/q/29798524
score: 0
type: Comment
type: QuestionComment
has text: So what's the problem with this javascript code?

atomic
type: Tag
tag name: atomic
tags question: http://stackoverflow.com/q/29818927

http://stackoverflow.com/comment/47779997
comment on: http://stackoverflow.com/q/29826494
score: 0
type: QuestionComment
type: Comment
has text: Thanks but this is not what I would like to do!

http://stackoverflow.com/q/29719577
tagged with: css
accepted answer: http://stackoverflow.com/a/29719712
type: AnsweredQuestion
score: -5
type: Question
upvote count: 0
downvote count: 5
tagged with: javascript
has body: How should I go about designing the following page using Bootstrap? I want to know what components can be used in this situation.
has answer: http://stackoverflow.com/a/29719712
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Bootstrap component to use?
favorite count: 0
tagged with: twitter-bootstrap-3

http://stackoverflow.com/comment/47719462
score: 0
type: AnswerComment
type: Comment
has text: **var sVal = sArr[1].toString();** this piece of code give me error
comment on: http://stackoverflow.com/a/29795585

http://stackoverflow.com/comment/47663958
comment on: http://stackoverflow.com/a/29766234
type: AnswerComment
type: Comment
has text: Thank's for quick replay. But this doesn't work because the file is hidden from users, out of working directory. Do you have another solutions?
score: 0

reactjs-flux
tags question: http://stackoverflow.com/q/29689370
tags question: http://stackoverflow.com/q/29783273
tags question: http://stackoverflow.com/q/29693640
type: Tag
tags question: http://stackoverflow.com/q/29717842
tags question: http://stackoverflow.com/q/29776390
tag name: reactjs-flux
tags question: http://stackoverflow.com/q/29731522
tags question: http://stackoverflow.com/q/29701496

http://stackoverflow.com/q/29756467
tagged with: javascript
favorite count: 0
tagged with: parse-cloud-code
tagged with: parse-platform
type: UnansweredQuestion
has body: I am building an app with friends relations using Parse Cloud Code. When Alice sends Bob a friend request, it is a notification of type 71. When Bob answers he sends a notification of type 8. On the server, when a type 8 notification is sent, first some friendship relations are proceeded. They are: removing from both users from each other "potential friend list" and adding to "friend list" instead. Afterwards, the notification of type 71 should be changed to a type 1 notification. For some reasons I've been struggling for 24h to make it work. I simply cant proceed those two functions one after the other: the second one is never executed. Here is my code Parse.Cloud.afterSave("Notification", function(request, response) { Parse.Cloud.useMasterKey(); var downQuery = new Parse.Query("Notification"); var namnamA = request.object.get('nameA'); var namnamB = request.object.get('nameB'); var tytype = request.object.get('type'); var alice = Parse.User.current(); if (tytype === 8){ var bobQuery = new Parse.Query(Parse.User); bobQuery.equalTo("username", namnamB); bobQuery.first().then(function(bob) { var alicesRelation = alice.relation("friendsList"); var alicesPotRelation = alice.relation("potFriendsList"); var bobsRelation = bob.relation("friendsList"); var bobsPotRelation = bob.relation("potFriendsList"); alicesPotRelation.remove(bob); alicesRelation.add(bob); bobsPotRelation.remove(alice); bobsRelation.add(alice); return Parse.Object.saveAll([alice, bob]); }).then(function() { downQuery.equalTo('nameA', namnamB); downQuery.equalTo('nameB', namnamA); downQuery.equalTo('type', 71); return downQuery.find(); }).then(function(notizz) { notizz.set('type', 1); return Parse.Object.saveAll([notizz]); }).then(function() { console.log("success " + arguments); response.success(arguments); }), function(error) { console.log("error " + error.message); response.error(error); } } }); Any help would greatly improve the life expectancy of my computer. Thank you.
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/52787107
type: Question
has answer: http://stackoverflow.com/a/30721411
has title: Parse Cloud Code callback not working
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/47583844
type: QuestionComment
comment on: http://stackoverflow.com/q/29724670
has text: @shaunhusain, yes—but that can only be used to attach styles to an attribute of an element—I would like to use this to maybe create an entire style sheet, or something :-)
score: 0
type: Comment

http://stackoverflow.com/q/29689937
has title: Setting HTML text to a JS variable
tagged with: tags
tagged with: javascript
downvote count: 0
tagged with: variables
favorite count: 0
has answer: http://stackoverflow.com/a/29689990
has body: I want to take text from an html tag and save it in a js variable. What I am looking at is this: JavaScript: function Myfunction(){ var x; //Fist num here var y; //second num here var z=x+y; alert(z); } HTML: 2 3 I am working on a calculator and want to take the values from the "screen" and save them to a variable, to do math with. Each number is separated like this in the calc program: Any Number (+,-,*,/) Any Number Answer prints here Once the answer is saved to a variable, the numb1, op, and numb2 are cleared and answer is printed.
has answer: http://stackoverflow.com/a/29690013
answer count: 5
has answer: http://stackoverflow.com/a/29690070
has comment: http://stackoverflow.com/comment/47516903
tagged with: http://stackoverflow.com/tag/html
tagged with: text
has answer: http://stackoverflow.com/a/29690016
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29689975
score: 1
has answer: http://stackoverflow.com/a/29689975
upvote count: 1
has comment: http://stackoverflow.com/comment/47516679
accepted answer: http://stackoverflow.com/a/29689990
type: Question

http://stackoverflow.com/q/29695207
score: 0
has comment: http://stackoverflow.com/comment/47527271
tagged with: tabs
has title: Incorrect display of multiple jquery tabs
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47526867
tagged with: php
has comment: http://stackoverflow.com/comment/47527478
type: Question
has body: I came across a problem that I dont know how to solve or what is causing it. Basically I have a page with jquery tabs. The tabs are loaded via ajax, just like in the example on the official jquery page. On the loaded pages however, I have further tabs. In other words you open the first page, that has tabs and one of the pages that opens within that tab has another list of tabs. I made sure all the IDs are unique. However, what happens is that the page loads ok, no errors, everything working. I switch to the next tab, again, no problems, everything working and the new page loads with another list of tabs in it. And even those tabs work again. But then, when I swith back to the first original tab, it throws me a javascript error that tabs() is not a function and the whole structure of the page messes up. Here is the first page I want to load: http://meteopage.com/subdom/downloads/template/pages/station/report_annual.php?y=2012 The "Extremes" tab should then load this page: http://meteopage.com/subdom/downloads/template/pages/station/report_annual1.php?y=2012 Separately they work fine, but if you try clicking the Extremes tab on the first page, it loads the second fine, but then when you switch back to the original Summary tab and again to the Extremes tab it is all messed up. In other words, if you keep on switching between the tabs, it only works ok the first time the page loads, but after switching there and back it throws me that error. Thanks for any tips in advance The code would basically be like this: The first main page: <?php echo lang("Summary")?> Then the second page, which is loaded in the second tab has the exact same code, excelt the #tabs is called #tabs2 and the divs tabs-21, tabs22 etc.
has comment: http://stackoverflow.com/comment/47526709
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29738464
answer count: 1
downvote count: 0
has body: Is there an easy way to apply a search filter like angular: &lt;input type="text" ng-model="resultFilter" placeholder="Search"&gt; &lt;ul&gt; &lt;li ng-repeat="result in results | filter:resultFilter"&gt;{{result.name}}&lt;/li&gt; &lt;/ul&gt; this filters the result by what ever is typed in the input box making an awsomely simple search feature. Is there a simple Emberjs equivalent or this one of those simple perks of anuglarjs?
has comment: http://stackoverflow.com/comment/47619195
tagged with: ember-cli
favorite count: 0
has title: Emberjs equivalent to Angular filter ng model search
tagged with: angularjs
tagged with: ember.js
has answer: http://stackoverflow.com/a/29745395
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47645099
has comment: http://stackoverflow.com/comment/47611214
accepted answer: http://stackoverflow.com/a/29745395
tagged with: javascript
score: 4
upvote count: 4

http://stackoverflow.com/q/29696479
possible better answer: http://stackoverflow.com/a/29696576
has answer: http://stackoverflow.com/a/29696622
accepted answer: http://stackoverflow.com/a/29696622
downvote count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47529208
has comment: http://stackoverflow.com/comment/47529303
has comment: http://stackoverflow.com/comment/47529085
favorite count: 0
has comment: http://stackoverflow.com/comment/47529856
has comment: http://stackoverflow.com/comment/47530059
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47529099
has comment: http://stackoverflow.com/comment/47530228
has body: Edit: So, after messing around with the code and following everyones advice, I found out that, indeed, the id -does- work, but somethign else blocks it. This is the entire line of code, now: where is the problem located? HTML: {{item.name}} {{item.email}} DATA: $scope.users = [ { id: 1, name: "user", email : ""}, { id: 2, name: "anotherUser", email: ""}]; Problem: the ID stays "{{item.id}}" and isn't converted to, eg: "1". I tried with ng-attr-id as well, but it didn't work either. Why isn't the ID "transformed" to what it should be? To bring the problem a bit further: if I do data-id="{{item.id}}, it DOES work.
has answer: http://stackoverflow.com/a/29696576
has comment: http://stackoverflow.com/comment/47529108
has comment: http://stackoverflow.com/comment/47530203
type: AnsweredQuestion
has title: angularJs - ngRepeat with custom id
score: -1
has comment: http://stackoverflow.com/comment/47529897
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/47530106
answer count: 2
has comment: http://stackoverflow.com/comment/47529097
tagged with: javascript

http://stackoverflow.com/a/29836523
has body: Your problem are resources. Check them and their orders. In jsFiddle you are missing jquery-ui. I added to html window under the jquery.event.drag source and i changed dialog like This is an animated dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon. and in js window into your event add .dialog like in documentation if ($(e.target).hasClass('states')) { $('#states').dialog(); } and dialog now working fine on click button states.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29827802
type: Answer
answers question: http://stackoverflow.com/q/29827802
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/q/29762223
type: Question
tagged with: obout
has body: I have a grid from obout: &lt;cc1:Grid ID="GridEvalEmp" runat="server" AllowPageSizeSelection="False" AllowPaging="True" PageSize="10" AutoGenerateColumns="False" FolderStyle="styles/style_8" Language="es" Width="600" AllowFiltering="false"&gt; &lt;ClientSideEvents OnClientCallbackError="onGridErrorEval" OnClientAdd="onAddEvalEmp" OnClientEdit="onEditEvalEmp" OnBeforeClientInsert="validarFechas" OnBeforeClientUpdate="validarFechas"/&gt; &lt;Columns&gt; &lt;cc1:Column ID="ClmCodEval" DataField="codEvaluacion" HeaderText="Capacitación" Visible="false" Index="0" /&gt; &lt;cc1:Column ID="ClmNombreCapacitacion" Width="300" HeaderText="Capacitación" DataField="nombreEvaluacion" Index="1" Visible="true" Wrap="True" /&gt; &lt;cc1:Column ID="ClmFechaActEval" Width="180" HeaderText="Fecha de Evaluación" DataFormatString="{0:dd/MM/yyyy}" DataField="fechaEvaluacion" Index="2" Visible="true" Wrap="True" /&gt; &lt;cc1:Column ID="ClmPuntaje" Width="200" HeaderText="Puntaje" DataField="puntajeEval" Index="3" Visible="true" Wrap="True" /&gt; &lt;cc1:Column ID="ClmEditCap" Width="160" AllowDelete="false" AllowEdit="true" HeaderText="" Index="3" /&gt; &lt;/Columns&gt; &lt;/cc1:Grid&gt; I want to disable the ClmPuntaje column on client add. For that I have a javascript function but it doesn't work: function onAddEvalEmp(record) { document.getElementById('ClmPuntaje').disabled = true; } How can I make this work? Thanks! Sabrina
tagged with: javascript
tagged with: asp.net
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/29762361
has answer: http://stackoverflow.com/a/30033104
type: UnansweredQuestion
has title: Obout Grid Asp.Net disable text column on adding
has answer: http://stackoverflow.com/a/29762314

wicket
tags question: http://stackoverflow.com/q/29810628
tags question: http://stackoverflow.com/q/29826104
type: Tag
tag name: wicket

http://stackoverflow.com/comment/47688740
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29779241
has text: @DrCord agreed, will update accordingly :-)

http://stackoverflow.com/q/29784515
has comment: http://stackoverflow.com/comment/47699071
has title: OnClick event not binding/firing
has answer: http://stackoverflow.com/a/29784644
has comment: http://stackoverflow.com/comment/47698963
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47699033
tagged with: ruby-on-rails-4.2
accepted answer: http://stackoverflow.com/a/29784644
type: AnsweredQuestion
tagged with: slim-lang
type: Question
has comment: http://stackoverflow.com/comment/47699148
has comment: http://stackoverflow.com/comment/47698939
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
favorite count: 0
has body: I'm trying to create a select link that fire all checkbox on the current page but it doesn't work just reloads the page. file_items.js $('a.select-all-current').click(function(e){ e.preventDefault(); alert(e); $('input:not(:checked)').each(function(index, element){ $(element).click(); }); return false; }); index.html.slim ... .col-lg-6.pull-right.align-right .pull-right = link_to 'Deselect All', '#', class: 'label' .dropdown.col-lg-2.pull-right a#selectAllMenu.dropdown-toggle[ data-toggle='dropdown' aria-expanded='true'] .label.select-all = "Select All " span.caret.pull-right ul.dropdown-menu[role='menu' aria-labelledby='selectAllMenu'] li | SELECT li hr li = link_to 'current page', '', class: 'select-all-current' li = link_to 'all files', '', class: 'select-all-files' li = link_to 'all untagged files', '', class: 'select-all-untagged' ...

remote-debugging
tag name: remote-debugging
type: Tag
tags question: http://stackoverflow.com/q/29725467

http://stackoverflow.com/comment/47556769
score: 0
comment on: http://stackoverflow.com/a/29709620
type: Comment
type: AnswerComment
has text: Either way, using a simple HTML form to submit the stuff would be probably a much better and simpler idea. I don't know what the complications are with your current code, but you should consider restructuring it. Just a suggestion though. Getting all the concepts at first might be not so easy, but it comes with time. You should read more on basic HTML and PHP, SQL injection, JavaScript, forms, etc. I know it all seemed confusing to me at first :)

http://stackoverflow.com/comment/50751753
type: Comment
score: 2
comment on: http://stackoverflow.com/a/29728520
type: AnswerComment
has text: @Tushar: That's not an *actual* problem. People just like to go around claiming it is.

http://stackoverflow.com/comment/47519883
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29691480
has text: You could also just move the existing ones couldnt you? Another idea would be to create an iframe and load another ad within this frame (not sure if working)
score: 0

http://stackoverflow.com/a/29823632
type: AcceptedAnswer
upvote count: 1282
has comment: http://stackoverflow.com/comment/133164523
has comment: http://stackoverflow.com/comment/111100671
score: 1275
has comment: http://stackoverflow.com/comment/136798255
type: Answer
has comment: http://stackoverflow.com/comment/129129198
answers question: http://stackoverflow.com/q/29775797
downvote count: 7
accepted answer of: http://stackoverflow.com/q/29775797
has body: With ES2017 async/await support, this is how to POST a JSON payload: (async () =&gt; { const rawResponse = await fetch('https://httpbin.org/post', { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringify({a: 1, b: 'Textual content'}) }); const content = await rawResponse.json(); console.log(content); })(); Can't use ES2017? See @vp_art's answer using promises The question however is asking for an issue caused by a long since fixed chrome bug. Original answer follows. chrome devtools doesn't even show the JSON as part of the request This is the real issue here, and it's a bug with chrome devtools, fixed in Chrome 46. That code works fine - it is POSTing the JSON correctly, it just cannot be seen. I'd expect to see the object I've sent back that's not working because that is not the correct format for JSfiddle's echo. The correct code is: var payload = { a: 1, b: 2 }; var data = new FormData(); data.append( "json", JSON.stringify( payload ) ); fetch("/echo/json/", { method: "POST", body: data }) .then(function(res){ return res.json(); }) .then(function(data){ alert( JSON.stringify( data ) ) }) For endpoints accepting JSON payloads, the original code is correct
has comment: http://stackoverflow.com/comment/89479643

http://stackoverflow.com/a/45154118
score: 20
downvote count: 0
has body: I have created a thin wrapper around fetch() with many improvements if you are using a purely json REST API: // Small library to improve on fetch() usage const api = function(method, url, data, headers = {}){ return fetch(url, { method: method.toUpperCase(), body: JSON.stringify(data), // send it as stringified json credentials: api.credentials, // to keep the session on the request headers: Object.assign({}, api.headers, headers) // extend the headers }).then(res =&gt; res.ok ? res.json() : Promise.reject(res)); }; // Defaults that can be globally overwritten api.credentials = 'include'; api.headers = { 'csrf-token': window.csrf || '', // only if globally set, otherwise ignored 'Accept': 'application/json', // receive json 'Content-Type': 'application/json' // send json }; // Convenient methods ['get', 'post', 'put', 'delete'].forEach(method =&gt; { api[method] = api.bind(null, method); }); To use it you have the variable api and 4 methods: api.get('/todo').then(all =&gt; { /* ... */ }); And within an async function: const all = await api.get('/todo'); // ... Example with jQuery: $('.like').on('click', async e =&gt; { const id = 123; // Get it however it is better suited await api.put(`/like/${id}`, { like: true }); // Whatever: $(e.target).addClass('active dislike').removeClass('like'); });
type: Answer
answers question: http://stackoverflow.com/q/29775797
upvote count: 20

http://stackoverflow.com/a/29780691
has body: You have three options. Change the title tag to call a function that retrieves the title directly: &lt;div flex&gt;{{getTitle()}}&lt;/div&gt; Add to your controller: $scope.getTitle = function() { return titleService.get(); } Don't use a title service at all, but include the template for the title bar in each view's page. You can do this by making a custom directive where you can set the title and include this directive on each view's template. It might look something like: angular.module('sycf').directive('titleBar', function() { return { restrict: 'EA', scope: { title: '@' }, templateUrl: 'path/to/title.html' }; }); Then, you include the following where ever you want the title to appear: &lt;div title-bar title="Title for this Page" /&gt; You can set a watch on the title service's get() method in your sycfCtrl controller: $scope.$watch(function() { return titleService.get(); }, function(newTitle) { $scope.title = newTitle; });
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29779962
upvote count: 1

http://stackoverflow.com/comment/47550847
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29707391
has text: No problem! Glad to help out. As a note you could drop off the value attributes if you are doing it the first way...you only need to pass the value into the function.
type: AnswerComment

http://stackoverflow.com/a/29705543
has body: There are a number of ways of achieving this, depending on the result you want to get. Maybe the simplest way is not using a plugin at all; just add a hidden div with the content of the popup in it. And then, from jQuery, capture the click of your tag a and show up that hidden div. From CSS you can style that div in any way you need. If you want to use a plugin, you could use Fancybox or any other similar, given the fact that you already have jQuery on your website.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29700811

http://stackoverflow.com/comment/89914460
has text: Thank you. This is the only solution that worked for me. I tried all of the above ones. I have been looking for a solution like this for hours.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/50996154

http://stackoverflow.com/q/29805916
score: 1
upvote count: 1
type: Question
type: AnsweredQuestion
tagged with: c#
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/47739963
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29806075
answer count: 1
downvote count: 0
has body: Basically what I want to do is: Click on a button to delete a record. Delete the record if a specific column (Location) is null (this is done and works fine) Delete the record, BUT if the specific column is not null, ask the user to confirm. So step 3 is the tricky part. With the AJAX, I call the deleteChannel(url) that you see below, which calls the proper method in code-behind. Now here is the tricky part: if (channel != null && channel.Location != null) { // How do I do this? (Notice that this is code-behind) ShowDialogThatAsksUserToConfirm() } The code: ShowDialogThatAsksUserToConfirm() needs to call back to the client saying that "The Location column is not null", and wait for user to say delete anyway, or cancel. I have this code that will call a method in code behind: function deleteChannel(url) { $.ajax({ url: url, type: "POST", cache: false, contentType: 'application/html; charset=utf-8', data: $("form").serialize(), dataType: 'html', success: function (msg) { showDialog('successDiv'); }, error: function (msg) { alert("error"); showDialog('errorDiv'); } }); } And the showDialog(...) looks like this: function showDialog(divID) { $("#" + divID).dialog({ show: "clip", hide: "clip", buttons: { Ok: function () { $(this).dialog("close"); } } }); } The code-behind looks like this: [HttpPost] public ActionResult DeleteChannel(int id) { var statusCode = new HttpStatusCode(); using (var context = new MaaneGrisContext()) { var channel = context.Channels.FirstOrDefault(x => x.ID == id); if (channel != null && channel.Location != null) { if (Confirmation()) //The Confirmation() method not implemented yet, but it should ask user to confirm { context.Channels.Remove(channel); context.SaveChanges(); List<ChannelModel> updatedChannelList = new List<ChannelModel>(); context.Channels.AddRange(context.Channels); return View("ChannelDetails", updatedChannelList); } } } Here is the View: Name ... @{ foreach (var item in Model) { @Html.DisplayFor(m => item.ChannelName) @Html.Disp…
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/29806075
has title: Call js function from code-behind (Not as startupScript)

http://stackoverflow.com/q/29806037
tagged with: angularjs
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47740142
type: Question
has title: Form $setValidity back to true not working
score: 3
has comment: http://stackoverflow.com/comment/47740211
has comment: http://stackoverflow.com/comment/47740260
has comment: http://stackoverflow.com/comment/47740018
has answer: http://stackoverflow.com/a/35977085
has comment: http://stackoverflow.com/comment/47741923
answer count: 1
linked to: http://stackoverflow.com/q/17947639
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47740253
upvote count: 3
has comment: http://stackoverflow.com/comment/47740900
has comment: http://stackoverflow.com/comment/47740361
has comment: http://stackoverflow.com/comment/47740601
has body: I set up a form to validate on the server side OnBlur event. The server-side validation is working fine and returning errors as expected. However, once I set validity to false for a field, setting it back to true is not removing the $error messages. Isn't $setValidity true supposed to remove errors from form? This is the controller: angular.module('artists').controller('ArtistsController', ['$scope', '$stateParams', '$location', 'Authentication', 'Artists', function($scope, $stateParams, $location, Authentication, Artists) { $scope.authentication = Authentication; $scope.processForm = function(val){ var artist = new Artists({ name: $scope.artistForm.name.$viewValue, quote: $scope.artistForm.quote.$viewValue }); artist.$save(function(response) { $scope.artistForm.$setValidity(val,true); }, function(errorResponse) { if(val in errorResponse.data){ $scope.artistForm.$setValidity(val,false,errorResponse.data[val].message); }else{ $scope.artistForm.$setValidity(val,true); } }); }; }]);

http://stackoverflow.com/a/29899608
has body: No need to do a merge. I realize that you may be doing this in C#, and I'm going to show you the answer in Javascript, but we know that C# has arrays and HashMaps and a JSONSerializer class, so this should serve as reasonable pseudocode. var data = [ ['Electronics', 'Mobile', 'Black'], ['Electronics', 'Mobile', 'Green'], ['Electronics', 'Laptop', 'Black'], ['HomeNeeds', 'VaccumCleaner', 'white'], ['HomeNeeds', 'Refigerator', 'Red'], ['Wearable', 'AppleWatch', 'Red'] ]; function force(collection, key) { if (!collection[key]) collection[key] = {}; return collection[key]; } function tableToTree(data) { var result = {}; data.forEach(function(item) { force(force(result, item[0]), item[1]).color = item[2]; }); return result; } console.log(JSON.stringify(tableToTree(data))); The trick is simple... whatever the language, you need to be able to say... result[category][item]["color"] = color; ...without anything barking at you. And then you can use one of the available JSON serializers. The code should be easy to read, even if it isn't the absolute most performant bit of code. If speed is important, or you'll be doing this a lot, building a collection only to serialize and deconstruct it is expensive. Invest a bit of time writing a JSON encoder for your object which will do the popping and pushing and comparing and will append strings as it works through your collection.
answers question: http://stackoverflow.com/q/29713542
upvote count: 1
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/a/29767079
upvote count: 6
has body: An alternative would be to build a function : var where_clause_string = "(((true &amp;&amp; ['SACRAMENTO','CITRUS HEIGHTS'].indexOf(raw_data[i]['city']) &gt; -1) || (false &amp;&amp; [].indexOf(raw_data[i]['city']) === -1)) || false)"; var evaler = new Function('raw_data', 'i', "return "+where_clause_string); var raw_data_length = raw_data.length , filtered_data = []; for(var i = 0; i &lt; raw_data_length; i++) { if (evaler(raw_data, i)) { filtered_data.push(raw_data[i]); } } If you want to go further, you could use the filter function of Array.prototype. It would also ensure the function generation isn't a possible cause of deoptimization (see Optimization Killers) : var where_clause_string = "(((true &amp;&amp; ['SACRAMENTO','CITRUS HEIGHTS'].indexOf(raw_data[i]['city']) &gt; -1) || (false &amp;&amp; [].indexOf(raw_data[i]['city']) === -1)) || false)"; var filtered_data = raw_data.filter(new Function( 'v', "return "+where_clause_string.replace(/raw_data\[i\]/g,'v') )); But it's usually better to start with structured data instead of a raw string you want to evaluate. Using a function as I propose gets you better performances but you still get the maintenance, readability and security problems of a code in a string. Maybe it could be something like var criterium = { ok_cities:['SACRAMENTO','CITRUS HEIGHTS'], nok_cities:[] };
answers question: http://stackoverflow.com/q/29766991
has comment: http://stackoverflow.com/comment/47665271
has comment: http://stackoverflow.com/comment/47668302
has comment: http://stackoverflow.com/comment/47669980
score: 6
has comment: http://stackoverflow.com/comment/47667908
has comment: http://stackoverflow.com/comment/47666658
accepted answer of: http://stackoverflow.com/q/29766991
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47666467
has comment: http://stackoverflow.com/comment/47665288
has comment: http://stackoverflow.com/comment/47666254
type: Answer

http://stackoverflow.com/comment/47536862
type: AnswerComment
comment on: http://stackoverflow.com/a/29700376
type: Comment
has text: Guessing shouldn't be an answer, it should be a comment.
score: 1

http://stackoverflow.com/q/29717023
accepted answer: http://stackoverflow.com/a/29717677
linked to: http://stackoverflow.com/q/1458724
tagged with: cookies
has comment: http://stackoverflow.com/comment/47571227
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47573240
downvote count: 0
tagged with: javascript
score: 1
has answer: http://stackoverflow.com/a/29718104
has body: I've created a simple [voting form] using jQuery AJAX and JSON. I want to know how to create a Cookie so that the user will not be able to vote more than once. Following is my code. I am new to Cookies and jQuery. Please tell me how to complete my task. JavaScript PHP <?php $vote = $_REQUEST['vote']; $filename = "poll_result.txt"; $content = file($filename); // $decode = json_decode($encode); $array = explode("||", $content[0]); $male = $array[0]; $female = $array[1]; if ($vote == '0') { $male = $male + 1; } if ($vote == '1') { $female = $female + 1; } $insertvote = $male."||".$female; $fp = fopen($filename,"w"); fputs($fp,$insertvote); fclose($fp); $table = ( " Results: Male : ". (100*round($male/($female+$male),2))." %" . " Female : ". (100*round($female/($female+$male),2))." %" ." " ); $list = array('vote' => $table); $encode = json_encode($list); echo $encode; ?> HTML What is your Gender? Male : Female :
tagged with: jquery
favorite count: 0
tagged with: ajax
type: Question
tagged with: php
has title: Creating a Cookie to not vote again in a poll
has answer: http://stackoverflow.com/a/29717677
possible better answer: http://stackoverflow.com/a/29717671
has comment: http://stackoverflow.com/comment/47568703
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/29717671

http://stackoverflow.com/q/29775368
has answer: http://stackoverflow.com/a/29775583
has answer: http://stackoverflow.com/a/29776101
has body: I try to make a version of "tic tac toe" with AngularJS and be as minimalistic as possible. The only solution for my problem is to assign every button a unique ID (f+i). HTML {{getXO()}} JavaScript $scope.XObool=false; $scope.toTrue = function() { if(!$scope.XObool){ $scope.XObool=true; } else if($scope.XObool) { $scope.XObool=false; } }; $scope.getXO = function(){ if($scope.XObool){ return 'X'; } else { return 'O'; } };
tagged with: angularjs
type: AnsweredQuestion
has title: How to make a custom HTML id by evaluating an expression
upvote count: 5
accepted answer: http://stackoverflow.com/a/29775583
possible better answer: http://stackoverflow.com/a/29775670
type: Question
has answer: http://stackoverflow.com/a/29775670
score: 5
downvote count: 0
tagged with: javascript
favorite count: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47785132
score: 1
comment on: http://stackoverflow.com/q/29829283
has text: What's going on with "warning here" in that last example? There's no error when I paste that code into the Playground.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29813617
has answer: http://stackoverflow.com/a/29813699
has comment: http://stackoverflow.com/comment/47754885
type: Question
has body: Now I have something like this: &lt;input type="text" ng-model="cell.location"&gt; What I want is while you put 'ABC' in this field, this field will become disabled status, I know I can put a boolean param to control it via its controller. However what I expect is something like this: &lt;input type="text" ng-disabled="{{cell.location = 'ABC'}}" ng-model="cell.location"&gt; Which is clearer and simpler, unfortunately this approach doesn't work as expected, it will assign 'ABC' to this field rather than disable it. is that possible to implement in this kind of way? Thanks.
possible better answer: http://stackoverflow.com/a/29815755
has answer: http://stackoverflow.com/a/29815755
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29813699
score: 0
answer count: 2
has title: How to write the expression to disable an input text after entered a particular string
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47757779
type: AnsweredQuestion

http://stackoverflow.com/q/29755065
possible better answer: http://stackoverflow.com/a/63752149
downvote count: 2
has body: I'm currently playing around with React Native. I'm trying to structure my app, however it's starting to get messy with imports. --app/ -- /components -- Loading.js -- index.ios.js Now, within my index.ios.js i'm able to simply do: import Loading from './components/Loading'; However, when I start to create more components, with a deeper directory struture, it starts to get messy: import Loading from '.../../../../components/Loading'; I understand the preferred solution would be to make private npm modules for things, but that's overkill for a small project. You could do a global.requireRoot type solution on the browser, but how do I implement this with import?
has title: ES6 import from root
has comment: http://stackoverflow.com/comment/50503864
tagged with: import
has answer: http://stackoverflow.com/a/78839754
has answer: http://stackoverflow.com/a/52177267
type: Question
has comment: http://stackoverflow.com/comment/49582069
upvote count: 86
tagged with: javascript
has comment: http://stackoverflow.com/comment/51068170
linked to: http://stackoverflow.com/q/20185627
has answer: http://stackoverflow.com/a/63752149
has answer: http://stackoverflow.com/a/41181321
has comment: http://stackoverflow.com/comment/47646427
score: 84
has answer: http://stackoverflow.com/a/46245467
has answer: http://stackoverflow.com/a/49625616
has comment: http://stackoverflow.com/comment/50603831
has answer: http://stackoverflow.com/a/47098949
favorite count: 0
has answer: http://stackoverflow.com/a/31937237
answer count: 9
accepted answer: http://stackoverflow.com/a/31937237
has comment: http://stackoverflow.com/comment/49614301
has answer: http://stackoverflow.com/a/54314658
tagged with: node.js
linked to: http://stackoverflow.com/q/75806206
type: AnsweredQuestion

http://stackoverflow.com/a/29690833
score: 4
answers question: http://stackoverflow.com/q/29690802
type: AcceptedAnswer
downvote count: 0
has body: div .hidable is sibling of clicked buttons closest parent div.buttons. thus you need to traverse to .buttons and then use .next() to target the first .hideable: var element = $(this).closest('.buttons').next(); Working Demo
has comment: http://stackoverflow.com/comment/47518581
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/29690802

http://stackoverflow.com/comment/47527475
has text: Can you show an working (or in your case, nearly working) example of your code in a jsfiddle.net example? If the `tr` isn't a child of your $elem why even use `find()` on it? Maybe you could try just `var tr = $('tr[data-cellId]')` instead?
type: AnswerComment
comment on: http://stackoverflow.com/a/29695498
score: 0
type: Comment

http://stackoverflow.com/comment/47539691
has text: You can save it on the disk and then upload it on any web server.
type: AnswerComment
comment on: http://stackoverflow.com/a/29701276
score: 0
type: Comment

http://stackoverflow.com/a/29750936
has body: What you're seeing is the expected behavior, and it's not likely to change. Service workers intentionally have very short lifespans. They are "born" in response to a specific event (install, activate, message, fetch, push, etc.), perform their task, and then "die" shortly thereafter. The lifespan is normally long enough that multiple events might be handled (i.e. an install might be followed by an activate followed by a fetch) before the worker dies, but it will die eventually. This is why it's very important not to rely on any global state in your scripts, and to bootstrap any state information you need via IndexedDB or the Cache Storage API when your service worker starts up. Service workers are effectively background processes that get installed whenever you visit certain web pages. If those background processes were allowed to run indefinitely, there's an increased risk of negative impact on battery and performance of your device/computer. To mitigate this risk, your browser will only run those processes when it knows it's necessary, i.e. in response to an event. A use case for WebSockets is having your client listen for some data from the server. For that use case, the service worker-friendly alternative to using WebSockets is to use the Push Messaging API and have your service worker respond to push events. Note that in the current Chrome implementation, you must show a user-visible notification when handling a push event. The "silent" push use case is not supported right now. If instead of listening to data from the server, you were using WebSockets as a way of sending data from your client to your server, there's unfortunately no great service worker-friendly way of doing that. At some point in the future, there may be a way of registering your service worker to be woken up via a periodic/time-based event at which point your could use fetch() to send data to the server, but that's currently not supported in any browsers. P.S.: Chrome (normally) won't kill a …
has comment: http://stackoverflow.com/comment/139050328
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47656928
has comment: http://stackoverflow.com/comment/129045932
has comment: http://stackoverflow.com/comment/118612935
has comment: http://stackoverflow.com/comment/98373600
has comment: http://stackoverflow.com/comment/136964034
has comment: http://stackoverflow.com/comment/48758130
type: Answer
upvote count: 56
has comment: http://stackoverflow.com/comment/104908348
accepted answer of: http://stackoverflow.com/q/29741922
answers question: http://stackoverflow.com/q/29741922
downvote count: 0
score: 56
has comment: http://stackoverflow.com/comment/118412127
has comment: http://stackoverflow.com/comment/138732264
has comment: http://stackoverflow.com/comment/123408998

http://stackoverflow.com/a/29807203
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29804356
type: Answer
downvote count: 0
score: 1
has body: The problem is that the map variable is being redefined on each iteration of your loop, so by the time your event listener callback runs it will operate on the second google.maps.Map object. The simplest solution is to capture the value of the map variable on each iteration using a closure, like so: (function (map) { var listener = new google.maps.event.addListenerOnce(map, "bounds_changed", function () { if (!opts.center) { map.setZoom(opts.zoom); }; }); }) (map); I forked your JSFiddle to demonstrate the idea: https://jsfiddle.net/e8qbr8qL/
answers question: http://stackoverflow.com/q/29804356
upvote count: 1

http://stackoverflow.com/comment/47596641
type: Comment
comment on: http://stackoverflow.com/q/29725845
score: 0
has text: Also check out the accounts entry package on Atmosphere
type: QuestionComment

http://stackoverflow.com/a/29696201
has comment: http://stackoverflow.com/comment/47529660
has comment: http://stackoverflow.com/comment/47530674
type: Answer
has body: var yourElement = $('h1.latest'); This will return you a jQuery Object containing matching NodeList. yourElement.text().length; will give two as you have two h1 Instead it must be: jQuery("h1.latest").each(function() { if(jQuery(this).text().length < 21 ) { jQuery(this).addClass("pt45") } }); .pt45 { font-size: 10px; color:red; } 123456789 123456789123456789123456789123456789 You must iterate the Nodelist and check for the length
has comment: http://stackoverflow.com/comment/47528524
has comment: http://stackoverflow.com/comment/47531530
downvote count: 0
score: 7
has comment: http://stackoverflow.com/comment/47529803
has comment: http://stackoverflow.com/comment/47530033
accepted answer of: http://stackoverflow.com/q/29696147
has comment: http://stackoverflow.com/comment/47531015
has comment: http://stackoverflow.com/comment/47529791
answers question: http://stackoverflow.com/q/29696147
has comment: http://stackoverflow.com/comment/47528445
upvote count: 7
type: AcceptedAnswer

http://stackoverflow.com/comment/47541334
score: 0
type: Comment
has text: I've implemented the simpler logic: http://jsfiddle.net/mattography/kmbo423j/, but when applied to the project, its still showing all cropping results as "SQUARE".
type: AnswerComment
comment on: http://stackoverflow.com/a/29701340

http://stackoverflow.com/comment/47541021
type: QuestionComment
has text: Do you have any example how can I make this ?
score: 0
comment on: http://stackoverflow.com/q/29702565
type: Comment

http://stackoverflow.com/comment/47905921
score: 0
type: Comment
has text: @Gilsha Whether you have exported a d3.js as PDF ?http://stackoverflow.com/questions/29846745/export-or-download-d3-js-sunburst-collapsible-tree-charts-as-pdf-file
comment on: http://stackoverflow.com/a/29817728
type: AnswerComment

http://stackoverflow.com/a/29769140
has body: you should try this code snippet var x = 'abcd/data/efgh'; var s = 'newtext'; console.log(x.replace(/(/.[^/]+/)/g, '/'+s+'/')); Hope this would help you. Thanks!!
type: Answer
answers question: http://stackoverflow.com/q/29768709
score: 0

http://stackoverflow.com/a/29835761
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29835679
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29835679
has body: It looks like you are using the conditional (if/else) correctly, but you have some syntax errors in how you are setting the value of FIREuni. Conditionals work by evaluating the expression that you pass to them, if the expression evaluates to something truthy (which can pretty much anything other than null, undefined, false, '', void 0, or 0) then the block of code that follows will be executed, otherwise it will move on to the next else if or else if they are present. When setting values outside of an object, you should use =, not :. So it should be: FIREuni = true; or FIREuni = false in the else condition.
score: 1

http://stackoverflow.com/q/29718798
score: 1
upvote count: 1
type: Question
has body: how to save the automatically generated "div id " which is visible on screen when user scroll... and jump back to the saved div id..when user reloadsloads the page. i am able to generate the id's dynamically with the following code generateid: function() { $("#generate br ~ br").each(function(index, element) { $(this).after("&lt;div id=\"bookmark-" + index + "\"&gt;&lt;/div&gt;"); }); }, and trying to scroll the save the id ,but unable achieve ..the code looks as follow check: function() { $(window).scroll(function() { $("div[id^='bookmark-']").each(function(index, element) { if ($(this).is(":visible"), $(window)) { console.log($(this).attr('id') + " is visible"); } else { } }); }); }, but statically able to pass the id and scroll to the div.with the following code scroll: function() { var container = $('div'), scrollTo = $('#bookmark-65'); container.animate({ scrollTop: scrollTo.offset().top - container.offset().top + container.scrollTop() }); },
tagged with: javascript
has title: how to save the automatically generated "div id " . i am trying to save the div id which is visible on screen when user scroll
tagged with: jquery
has answer: http://stackoverflow.com/a/29719008
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29719021
downvote count: 0
has comment: http://stackoverflow.com/comment/47572241
has comment: http://stackoverflow.com/comment/47572374
favorite count: 0
has comment: http://stackoverflow.com/comment/47573057
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/47572150

http://stackoverflow.com/comment/47808318
has text: @Shaggy I would prefer n and k be in the same cell (for later export), but all solution is ok for the moment. Anyways both current answers are good and I think I'll do it using their idea.
comment on: http://stackoverflow.com/q/29828819
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47540480
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29701362
type: AnswerComment
has text: It was also a bad idea to include your bit of jQuery in one of the loops as it ran 10 times when it only needed to be done once.

http://stackoverflow.com/q/29718349
has body: I got a button with the following code: Wrong details I can't figure out a way to make it fade out, when I click it it does nothing at all
type: AnsweredQuestion
has title: Javascript fade out this span
score: -1
has answer: http://stackoverflow.com/a/29718388
accepted answer: http://stackoverflow.com/a/29718388
type: Question
has answer: http://stackoverflow.com/a/29719103
possible better answer: http://stackoverflow.com/a/29718696
downvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47571247
answer count: 3
has answer: http://stackoverflow.com/a/29718696
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 0

http://stackoverflow.com/comment/79688185
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29688447
has text: See: Challenge-Handshake Authentication Protocol ([CHAP](https://en.wikipedia.org/wiki/Challenge-Handshake_Authentication_Protocol)).
score: 0

http://stackoverflow.com/comment/47591057
comment on: http://stackoverflow.com/a/29727542
type: AnswerComment
type: Comment
score: 0
has text: can you please provide an example with router instead of app, and a call to a remote server using http? I can't seem to adapt your example to it...

api
tags question: http://stackoverflow.com/q/29775789
tags question: http://stackoverflow.com/q/29734601
tags question: http://stackoverflow.com/q/29808761
tags question: http://stackoverflow.com/q/29689235
tags question: http://stackoverflow.com/q/29824040
tags question: http://stackoverflow.com/q/29826367
type: Tag
tags question: http://stackoverflow.com/q/29713288
tags question: http://stackoverflow.com/q/29733784
tags question: http://stackoverflow.com/q/29844661
tags question: http://stackoverflow.com/q/29773833
tag name: api
tags question: http://stackoverflow.com/q/29763936
tags question: http://stackoverflow.com/q/29688692

http://stackoverflow.com/comment/47578636
type: QuestionComment
comment on: http://stackoverflow.com/q/29721835
score: 0
has text: Yes, I am using my EC2's public IP in the place of X.X.X.X but I am surprised that its working if I use dedicated internet line. Can you please tell me if a port forwarding is needed from Public IP to Private IP in server end?
type: Comment

http://stackoverflow.com/comment/47593550
type: AnswerComment
score: 0
type: Comment
has text: the call to sentobox() function is now made. no matter the checkbox or unchecked. Then in the function ajax call is made to fetch and display data from db which is from the file getuser.php. BUt how do I remove the item from the appended list, if the same value is passed to the function maybe?
comment on: http://stackoverflow.com/a/29729826

http://stackoverflow.com/comment/47590514
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29728367
score: 0
has text: (can't really help without seeing how you created myArray)

http://stackoverflow.com/comment/47666390
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29766748
has text: Thanks... will see about those minifying and obfuscating methods... Had never heard of them before. Thanks for letting me know...

http://stackoverflow.com/comment/47576527
type: Comment
comment on: http://stackoverflow.com/a/29720412
has text: Thanks Man. I do follow it in my actual code. Hereafter i 'll follow it everywhere. Thanks.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47584046
score: 1
comment on: http://stackoverflow.com/a/29718634
type: AnswerComment
has text: I was in a hurry to leave when I wrote that code out so it's an ugly one liner. Use the version mplungjan wrote out. It's prettier.
type: Comment

http://stackoverflow.com/a/29800559
has body: I think this might be the solution you're looking for: document.getElementById('notClickable').ondragstart = function() { return false; }; Please let me know if it worked!
accepted answer of: http://stackoverflow.com/q/29791367
has comment: http://stackoverflow.com/comment/47810203
answers question: http://stackoverflow.com/q/29791367
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/47543918
comment on: http://stackoverflow.com/q/29703497
score: 1
has text: I do not agree. The question points to parallel realtime processes without timers in node.js. not an ideology discussion.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47586179
type: QuestionComment
has text: HTML5 drag & drop does not allow full access to the hardrive like writting and listing files in a directory. Also websockets are limited in a number of ways.
comment on: http://stackoverflow.com/q/29725580
score: 0
type: Comment

http://stackoverflow.com/q/29736786
has comment: http://stackoverflow.com/comment/47606913
answer count: 1
accepted answer: http://stackoverflow.com/a/29736973
downvote count: 0
has comment: http://stackoverflow.com/comment/47607012
favorite count: 0
has comment: http://stackoverflow.com/comment/47607039
has body: I read on this ECMAScript page that 'class' is part of JavaScript. On this page about TypeScript, I see the 'class' is available in Typescript too. My question is, the right approach to develop JavaScript applications FOR FUTURE is to take advantage of (a) the Object Oriented features in JavaScript and the features that will be availablein EMACScript 7.0 or (b) use libraries like TypeScript
has answer: http://stackoverflow.com/a/29736973
has title: class in JavaScript Vs Typescript
type: AnsweredQuestion
tagged with: typescript
has comment: http://stackoverflow.com/comment/47606991
tagged with: javascript
score: 4
type: Question
upvote count: 4

http://stackoverflow.com/q/29811566
tagged with: javascript
tagged with: jquery
score: 0
has title: difference between jquery styles
has comment: http://stackoverflow.com/comment/47751124
answer count: 1
has answer: http://stackoverflow.com/a/29811762
has body: which style is fastest? when would you use one over the other? Type 1: function makeMap(){ getLatlong(); draw(); } function getLatlong(){ ... } function draw(){ ... } makeMap(); Type 2: var map = { init: function(){ ... } getLatlong: function(){ ... } draw: function(){ ... } } $test = map.init()
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47751078
has comment: http://stackoverflow.com/comment/47751269
type: Question
accepted answer: http://stackoverflow.com/a/29811762

http://stackoverflow.com/a/29759261
score: 2
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
has body: It's actually really easy with Array#reduce: var obj = yourArray.reduce(function(obj, entry) { obj[entry[0]] = entry[1]; return obj; }, {}); Array#reduce loops through the entries in the array, passing them repeatedly into a function along with an "accumulator" you initialize with a second argument. Or perhaps Array#forEach would be clearer and more concise in this case: var obj = {}; yourArray.forEach(function(entry) { obj[entry[0]] = entry[1]; }); Or there's the simple for loop: var obj = {}; var index, entry; for (index = 0; index &lt; yourArray.length; ++index) { entry = yourArray[index]; obj[entry[0]] = entry[1]; }
accepted answer of: http://stackoverflow.com/q/29759206
answers question: http://stackoverflow.com/q/29759206

http://stackoverflow.com/comment/47698109
type: QuestionComment
has text: Oh man... It works! I'm sure I had tried it already! Sometimes my debugger does not refresh and that combined with poor sleeping may have caused the problem. Meh I know I have tested, I must be going crazy. Sorry for bothering you all with such stupid question.
comment on: http://stackoverflow.com/q/29762060
score: 0
type: Comment

http://stackoverflow.com/comment/47676890
has text: and then the user clicks on the textarea the text disappears ( i've already done that )
score: 0
comment on: http://stackoverflow.com/q/29773092
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29762354
has comment: http://stackoverflow.com/comment/47656523
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47656484
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47656603
answers question: http://stackoverflow.com/q/29762116
accepted answer of: http://stackoverflow.com/q/29762116
has body: Try using the setTimeout() javascript function. Documentation: http://www.w3schools.com/jsref/met_win_settimeout.asp For example: setTimeout(function(){ animate1(); }, 5000); setTimeout(function(){ animate2(); }, 5000); setTimeout(function(){ animate3(); }, 5000); This basically 'pauses' your JavaScript/jQuery code for 5 seconds before running the function and continuing.

http://stackoverflow.com/a/29809918
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29809887
has body: You can search with regex, this should work in Node User.find({ username: /^Mich/}) Note that Mongo supports regex objects, which means you can do var regexp = new RegExp("^"+ req.params.username); User.find({ username: regexp}); or Mongos own regex constructor User.find({ username: {$regex : "^" + req.params.username}});
upvote count: 61
accepted answer of: http://stackoverflow.com/q/29809887
type: Answer
has comment: http://stackoverflow.com/comment/79497739
score: 61
downvote count: 0
has comment: http://stackoverflow.com/comment/47747922

http://stackoverflow.com/comment/47527074
score: 0
comment on: http://stackoverflow.com/q/29695435
type: QuestionComment
type: Comment
has text: Do you append `row` to the DOM at any point?

http://stackoverflow.com/comment/47529912
type: Comment
score: 2
has text: possible duplicate of [Possible to detect if a user has multiple tabs of your site open?](http://stackoverflow.com/questions/4038629/possible-to-detect-if-a-user-has-multiple-tabs-of-your-site-open)
type: QuestionComment
comment on: http://stackoverflow.com/q/29696953

http://stackoverflow.com/q/29803850
tagged with: text
upvote count: 14
tagged with: onclick
score: 13
downvote count: 1
type: Question
has body: I am trying to create 3 buttons, and using javascript, If button 1 is clicked then it changes the "Click a button" text to "You pressed Button 1" Same for Button 2 and 3! And if Button 3 is pressed, the text colour changes to GREEN However, I can't seem to get it to work! Any help would be appreciated Here is my Current Code: Button Click on a Button
tagged with: javascript
has answer: http://stackoverflow.com/a/29803963
tagged with: function
has answer: http://stackoverflow.com/a/29803995
has title: Javascript - change paragraph Text on Each Button Click
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29804038
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29804284
answer count: 4

http://stackoverflow.com/comment/47795248
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29834212
type: AnswerComment
has text: Thanks for the reply! But how can I pull up the HTML if there's no ID attached to it? Also how can I differentiate between checked and non-checked items? Thanks a bunch :)

http://stackoverflow.com/q/29756605
has title: How to load and override Google Web Fonts subsequently?
tagged with: script-tag
has comment: http://stackoverflow.com/comment/47647484
type: Question
has answer: http://stackoverflow.com/a/29758220
tagged with: javascript
score: 0
tagged with: google-webfonts
answer count: 1
has comment: http://stackoverflow.com/comment/47648238
type: UnansweredQuestion
tagged with: loading
has comment: http://stackoverflow.com/comment/47645499
has body: After loading one set of Google Web Fonts, how can you load a new set to override the previously loaded set (assuming the elements making use of the old fonts are going to point to the newer font-families). The Goal is to provide a way for a designer to choose any Google Web Fonts by copying one or more identifiers (Name:Size:Charset) in a Game Configuration popup (this interacts with the game at runtime, letting the user tweak various parameters). Example: Load Lato:900:latin. Wait for user to type in new font to load (in a text input). When the user clicks "OK", load the new Web Font(s) + trigger a new onComplete callback. I've tried reusing the Google JS snippet, but any calls after the 1st doesn't seem to trigger the "fontloading" callback (unsure if it fails). var loadWebFont = function(fontFamilies, onComplete) { //Ensure 1st argument is of Array[String] type: if(!_.isArray(fontFamilies)) fontFamilies = [fontFamilies]; else fontFamilies = fontFamilies.concat(); //Get rid of blank/null fonts: for(var f=fontFamilies.length; --f&gt;=0;) { var theFont = fontFamilies[f]; if(!theFont || $.trim(theFont)==="") { fontFamilies.splice(f, 1); } } //Setup the font families Object and "fontloading" callback on window object. var loadCount = fontFamilies.length; window.WebFontConfig = { "fontloading": function(a, b) { if((--loadCount)&lt;=0) onComplete(); }, google: { families: fontFamilies } }; //Remove previously attached WebFonts &lt;script&gt; tag: if(window._WF_SCRIPT) { console.log("Removing previous Google Web Fonts node: " + window._WF_SCRIPT); window._WF_SCRIPT.parentNode.removeChild(window._WF_SCRIPT); window._WF_SCRIPT = null; } console.log("Loading fonts: " + fontFamilies); var wf = window._WF_SCRIPT = document.createElement('script'); wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; wf.type = 'text/javascript'; wf.async = 'true'; var s = document.getElementsByTagName('script')[0]; s.p…
has comment: http://stackoverflow.com/comment/47645511

http://stackoverflow.com/q/29745821
has comment: http://stackoverflow.com/comment/47623897
has comment: http://stackoverflow.com/comment/47625782
tagged with: javascript
has comment: http://stackoverflow.com/comment/47625101
answer count: 1
has comment: http://stackoverflow.com/comment/47624109
has title: how to download server side file javascript
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: We developing web sit.we have two textFiles in server http://192.168.3.134:8080/Helphands/forTest1.txt and http://192.168.3.134:8080/Helphands/forTest2.txt .We need is When we button click we need download forTest1.txt file and then count 1 write to forTest2.txt Please guide me . We are new this We download like this &lt;/script&gt; &lt;a href="http://192.168.3.134:8080/Helphands/forTest1.txt" download&gt; aaaa &lt;/a&gt; now we need count number of download that as to be sent to forTest2.txt
tagged with: php
downvote count: 4
upvote count: 0
has comment: http://stackoverflow.com/comment/47623912
tagged with: onclick
has comment: http://stackoverflow.com/comment/47624782
tagged with: filewriter
score: -4
has answer: http://stackoverflow.com/a/29748046
has comment: http://stackoverflow.com/comment/47624858
type: Question

http://stackoverflow.com/a/29722734
has body: (Not a full solution but I ran out of room in the comment section.) To answer your basic question, there's nothing special you should need to do to allow AS3-to-JS communication beyond what you've shown. However, you may have sandbox security issues on localhost; to avoid problems, set your SWFs as local-trusted (right-click Flash Player > Global Settings > Advanced > Trusted Location Settings). I'm guessing this not your problem, though, because you'd normally get a sandbox violation error. More likely IMO is that something is broken due to decompilation and recompilation. SWFs aren't meant to do that, it's basically a hack made mostly possible due to SWF being an open format. What I suggest is that you debug your running SWF. Using break-points and stepping through the code you should be able to narrow down where things are going wrong. You can also more easily see any errors your SWF is throwing.
has comment: http://stackoverflow.com/comment/47581919
score: 0
answers question: http://stackoverflow.com/q/29720177
type: Answer
has comment: http://stackoverflow.com/comment/47580351
has comment: http://stackoverflow.com/comment/47596270
has comment: http://stackoverflow.com/comment/47580220
has comment: http://stackoverflow.com/comment/47581438
has comment: http://stackoverflow.com/comment/47581445

http://stackoverflow.com/a/29805106
answers question: http://stackoverflow.com/q/29804987
has comment: http://stackoverflow.com/comment/47756925
has body: That's because it will print F1(abc) So it will look for a variable called abc. You should use TableCell.Attributes.Add("onclick", "F1(\""+value +"\")"); So the output will be F1("abc")
score: 0
type: Answer

http://stackoverflow.com/comment/47865303
comment on: http://stackoverflow.com/q/29840674
score: 1
has text: Yes, exactly that. Now you can extend that pattern by using the prototype for methods that don't need to be privileged, and you can [inherit from the "class" as always](http://stackoverflow.com/a/10898859/1048572)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/49425902
comment on: http://stackoverflow.com/q/29799757
score: 0
type: QuestionComment
has text: See my answer to this [similar question](https://stackoverflow.com/questions/28324303/matter-js-mouse-click-on-body#comment49425500_28324303)
type: Comment

http://stackoverflow.com/comment/47629993
comment on: http://stackoverflow.com/q/29748856
score: 0
type: Comment
type: QuestionComment
has text: What seems to be the issue? Do you have a question?

http://stackoverflow.com/q/29730226
has title: Google maps click event not working on StyledMarker Objects
favorite count: 0
has answer: http://stackoverflow.com/a/29730562
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29730562
downvote count: 2
has body: What am I doing wrong here? Clicking on the green markers has no effect in this webpage Kostverlorenvaart, en aansluiting Westelijk Marktkanaal ...
type: Question
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/47594359
tagged with: google-maps
upvote count: 0
answer count: 1

http://stackoverflow.com/comment/47632770
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29737939
has text: Perhaps this [page](http://www.w3schools.com/js/js_datatypes.asp) will help you with the JavaScript types
type: Comment

http://stackoverflow.com/comment/47658565
has text: what you have given instead of "url".. I didnt give exact code.. it is just a sample you have to modify according to your code
type: AnswerComment
comment on: http://stackoverflow.com/a/29763319
score: 0
type: Comment

http://stackoverflow.com/q/29767870
has comment: http://stackoverflow.com/comment/47666676
type: AnsweredQuestion
score: 1
type: Question
has answer: http://stackoverflow.com/a/29767963
accepted answer: http://stackoverflow.com/a/29767963
upvote count: 1
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: angularjs
has body: I am doing a project using angularjs and in this project I am using a jquery slider. Using this slider I have to change a selectbox value its defined in one $scope array but its not working. Here is an example code in this I just want to know how to change the scope value based on jquery slider Html code <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/layout.css" type="text/css" /> <script src="<?php echo base_url(); ?>assets/angular/angular.js" type="text/javascript"/> {{value}} <script src="<?php echo base_url(); ?>assets/includes/jquery.1.11.1.min.js"> <script src="<?php echo base_url(); ?>assets/includes/jquery.1.10.2.js"> <script src="<?php echo base_url(); ?>assets/includes/jquery.ui.1.11.1.js"> script code Thanks in advance.
tagged with: http://stackoverflow.com/tag/html
has title: Using jquery slider angularjs scope value is not changing

http://stackoverflow.com/comment/47749186
type: Comment
has text: @syms I am having some issues implementing the localstorage......The website you gave me says name value pairs......but I don't have name value pairs on the code above......I have been working on this and researching other websites for about 8 hours now. Can you give me some insight as to how to implement localstorage in the code above please.
type: AnswerComment
comment on: http://stackoverflow.com/a/29796641
score: 0

http://stackoverflow.com/q/29752779
has title: How can I preview image before uploading with the correct orientation with JavaScript?
linked to: http://stackoverflow.com/q/19463126
favorite count: 0
type: UnansweredQuestion
tagged with: filereader
tagged with: exif
has answer: http://stackoverflow.com/a/35816312
has answer: http://stackoverflow.com/a/29786767
has answer: http://stackoverflow.com/a/32592902
linked to: http://stackoverflow.com/q/16221005
tagged with: image
type: Question
score: 5
upvote count: 5
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I have a upload button and I want users being able to preview the image before clicking 'save'. I have &lt;input type="file" accept="image/*" id="avatarInput" onchange="PreviewImage();"/&gt; as my HTML and for my JS: function PreviewImage() { var oFReader = new FileReader(); oFReader.readAsDataURL(document.getElementById("avatarInput").files[0]); oFReader.onload = function (oFREvent) { $('.image').attr('src', oFREvent.target.result); }; }; But now, when I try to upload portrait image on my mobile, the preview image is rotated 90 degree. How can I cope with this? I've seen this and this but I don't know the codes can be incorporated in my case. Thanks. Update: Now I have function PreviewImage() { var oFReader = new FileReader(); oFReader.onloadend = function () { var showPicture = $('.mainavatar img'); var exif; exif=EXIF.readFromBinaryFile(new BinaryFile(this.result)); console.log(exif); $('.mainavatar img').attr('src', this.result); }; oFReader.readAsBinaryString(document.getElementById("avatarInput").files[0]); }; with exif.js and binary.js included, but I am getting error Uncaught TypeError: First argument to DataView constructor must be an ArrayBuffer
answer count: 3

http://stackoverflow.com/comment/47791470
has text: @cwilso Thanks for clarifying. Still, no error is thrown in Chrome and Safari, and Firefox is throwing "illegal string error", which makes it pretty confusing.
type: AnswerComment
comment on: http://stackoverflow.com/a/29822824
type: Comment
score: 1

http://stackoverflow.com/a/29810951
has comment: http://stackoverflow.com/comment/125461767
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29810914
has comment: http://stackoverflow.com/comment/47764326
has comment: http://stackoverflow.com/comment/54431538
answers question: http://stackoverflow.com/q/29810914
has comment: http://stackoverflow.com/comment/72268275
score: 1668
downvote count: 8
has comment: http://stackoverflow.com/comment/87688257
type: Answer
has body: Easy Way Use an arrow function: return ( &lt;th value={column} onClick={() =&gt; this.handleSort(column)}&gt;{column}&lt;/th&gt; ); This will create a new function that calls handleSort with the right params. Better Way Extract it into a sub-component. The problem with using an arrow function in the render call is it will create a new function every time, which ends up causing unneeded re-renders. If you create a sub-component, you can pass handler and use props as the arguments, which will then re-render only when the props change (because the handler reference now never changes): Sub-component class TableHeader extends Component { handleClick = () =&gt; { this.props.onHeaderClick(this.props.value); } render() { return ( &lt;th onClick={this.handleClick}&gt; {this.props.column} &lt;/th&gt; ); } } Main component {this.props.defaultColumns.map((column) =&gt; ( &lt;TableHeader value={column} onHeaderClick={this.handleSort} /&gt; ))} Old Easy Way (ES5) Use .bind to pass the parameter you want, this way you are binding the function with the Component context : return ( &lt;th value={column} onClick={this.handleSort.bind(this, column)}&gt;{column}&lt;/th&gt; );
has comment: http://stackoverflow.com/comment/124773280
has comment: http://stackoverflow.com/comment/73766413
has comment: http://stackoverflow.com/comment/104314474
has comment: http://stackoverflow.com/comment/68085566
upvote count: 1676
has comment: http://stackoverflow.com/comment/51828867
has comment: http://stackoverflow.com/comment/62066082
has comment: http://stackoverflow.com/comment/91654399
has comment: http://stackoverflow.com/comment/63777226
has comment: http://stackoverflow.com/comment/123930337
has comment: http://stackoverflow.com/comment/54837756
has comment: http://stackoverflow.com/comment/51776008

scope
tags question: http://stackoverflow.com/q/29778725
tags question: http://stackoverflow.com/q/29811657
tags question: http://stackoverflow.com/q/29713829
tag name: scope
tags question: http://stackoverflow.com/q/29833181
type: Tag
tags question: http://stackoverflow.com/q/29782302
tags question: http://stackoverflow.com/q/29752556
tags question: http://stackoverflow.com/q/29809570
tags question: http://stackoverflow.com/q/29753865

http://stackoverflow.com/q/29707322
type: AnsweredQuestion
has body: I would like to get attributes about objects using CasperJS, for example I have something like this: var casper = require('casper').create(); casper.start('http://www.seznam.cz', function() { if (this.exists('div#info')) { require('utils').dump(this.getElementInfo('div#info')); } else { this.echo(' not found', 'ERROR'); } }); casper.run(); I can see in console many attributes for example position of the element. Now given this, is it somehow possible to get these coordinates and perform for example this.click(coordinates)? If it is, how? I also would like to know hot to get another properties, like parentNode, childNodes.
has title: How to click on an element based on coordinates and how to retrieve element properties with CasperJS?
upvote count: 1
tagged with: dom
type: Question
accepted answer: http://stackoverflow.com/a/29708298
tagged with: javascript
tagged with: click
answer count: 1
downvote count: 0
score: 1
favorite count: 0
tagged with: casperjs
has answer: http://stackoverflow.com/a/29708298

http://stackoverflow.com/a/29809157
accepted answer of: http://stackoverflow.com/q/29808887
answers question: http://stackoverflow.com/q/29808887
type: Answer
score: 3
downvote count: 0
upvote count: 3
type: AcceptedAnswer
has body: Simply stop the animation if it's running between each element's hover event: jQuery( document ).ready( function( $ ) { $(".animation" ).hover( function() { $( ".animated" ).stop().hide( 500 ); }, function() { $( ".animated" ).stop().show( 500 ); } ); }); Fiddle

http://stackoverflow.com/q/29836429
favorite count: 0
score: 0
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has title: reloading a select drop down box without refreshing the page
has answer: http://stackoverflow.com/a/29836509
accepted answer: http://stackoverflow.com/a/29836509
possible better answer: http://stackoverflow.com/a/29836544
type: Question
type: AnsweredQuestion
answer count: 2
upvote count: 1
tagged with: javascript
has body: I have a drop down list that is dynamically filled with categories using php embeded in the html as follows: Choose the Catagory for your Video Here <?php $sql = ("SELECT albumId, albumName FROM albums"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($mysqli, $sql); while($row = mysqli_fetch_array($result)) { $albumid = ($row['albumId']); $album_name = ($row['albumName']); echo " $album_name "; } ?> Create New Catagory Here on the option with id of "createCatagory" a pop up opens and allows the creation of a new category folder on the server using an ajax call as follows: What I would like to happen is when the create button is clicked that the select list will reload and reflect the new category in the drop down list without the need to refresh the page after the pop up box is closed. is this possible please
has answer: http://stackoverflow.com/a/29836544
tagged with: jquery

http://stackoverflow.com/q/29820898
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29821094
score: 0
answer count: 2
has body: I am new to java script. And now have gone into a really serious problem. Please help..................! stackoverflow I have one jsp page for deleting entries. where user can delete data. As soon as he clicks delete button , he gets a confirmation window saying "Are you sure you want to delete..?". Problem is when user deletes 4,5 entries he gets an alert from the browser saying " [*] Prevent this page from creating additional dialogues." when user clicks the checkbox and prevents himself getting additional dialogues. my confirmation message "Are you sure you want to delete?" also gets blocked and user is unable to delete the data and the whole portal becomes useless. please help me and let me know is there any way to handle that using javascript.
tagged with: confirm
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47770439
has comment: http://stackoverflow.com/comment/47768159
has title: window.confirm message not working when user disables additional dialogue from the browser
has answer: http://stackoverflow.com/a/29821457
has comment: http://stackoverflow.com/comment/47768085

http://stackoverflow.com/comment/47760857
comment on: http://stackoverflow.com/a/29816921
type: AnswerComment
has text: I want this to be hh/mm/ss. How can I have it in this format?
score: 2
type: Comment

wordpress
tags question: http://stackoverflow.com/q/29702609
tags question: http://stackoverflow.com/q/29720668
tags question: http://stackoverflow.com/q/29692046
tags question: http://stackoverflow.com/q/29702837
tags question: http://stackoverflow.com/q/29778432
tags question: http://stackoverflow.com/q/29723588
tags question: http://stackoverflow.com/q/29713562
tags question: http://stackoverflow.com/q/29796745
tags question: http://stackoverflow.com/q/29826383
tags question: http://stackoverflow.com/q/29734853
tags question: http://stackoverflow.com/q/29733607
tags question: http://stackoverflow.com/q/29755655
tags question: http://stackoverflow.com/q/29798236
tags question: http://stackoverflow.com/q/29726928
tags question: http://stackoverflow.com/q/29730535
tags question: http://stackoverflow.com/q/29838142
tags question: http://stackoverflow.com/q/29826006
tags question: http://stackoverflow.com/q/29689603
tags question: http://stackoverflow.com/q/29723872
tags question: http://stackoverflow.com/q/29738477
tags question: http://stackoverflow.com/q/29691196
tags question: http://stackoverflow.com/q/29824412
tags question: http://stackoverflow.com/q/29743018
tags question: http://stackoverflow.com/q/29730479
tags question: http://stackoverflow.com/q/29739624
tags question: http://stackoverflow.com/q/29712861
tags question: http://stackoverflow.com/q/29700145
tags question: http://stackoverflow.com/q/29784721
tags question: http://stackoverflow.com/q/29844569
tags question: http://stackoverflow.com/q/29774233
tags question: http://stackoverflow.com/q/29739371
tags question: http://stackoverflow.com/q/29749091
tags question: http://stackoverflow.com/q/29725865
tag name: wordpress
tags question: http://stackoverflow.com/q/29843262
tags question: http://stackoverflow.com/q/29694811
tags question: http://stackoverflow.com/q/29740728
tags question: http://stackoverflow.com/q/29795325
tags question: http://stackoverflow.com/q/29828973
tags question: http://stackoverflow.com/q/29705395
tags question: http://stackoverflow.com/q/29759638
tags question: http://stackoverflow.com/q/29739568
tags question: http://stackoverflow.com/q/29759257
tags question: http://stackoverflow.com/q/29815613
tags question: http://stackoverflow.com/q/29802304
tags question: http://stackoverflow.com/q/29700642
tags question: http://stackoverflow.com/q/29807029
tags question: http://stackoverflow.com/q/29813235
tags question: http://stackoverflow.com/q/29784775
type: Tag
tags question: http://stackoverflow.com/q/29830829
tags question: http://stackoverflow.com/q/29792879

http://stackoverflow.com/a/29800491
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29799916
accepted answer of: http://stackoverflow.com/q/29799916
type: AcceptedAnswer
has body: The loop iterates through the first half of the array, up to but not including the middle value for an array with an odd number of elements (since the middle value stays in the same place when the array is reversed). The first time through the loop, the values of the first and last positions in the array are reversed. The second time through the loop, the values of the second and second last positions in the array are reversed. etc...
type: Answer
score: 1

http://stackoverflow.com/comment/47538707
comment on: http://stackoverflow.com/q/29698836
score: 0
type: Comment
type: QuestionComment
has text: Which version of IE?

http://stackoverflow.com/a/29750185
downvote count: 0
score: 2
answers question: http://stackoverflow.com/q/29750096
accepted answer of: http://stackoverflow.com/q/29750096
upvote count: 2
type: AcceptedAnswer
has body: This is a bug in IE8, not in IE11, as doing document.createElement("&amp;nbsp;") shouldn't really work anywhere, as a non-breaking space is not an element. Chrome gives the error Uncaught InvalidCharacterError: Failed to execute 'createElement' on 'element': The tag name provided ('&amp;nbsp;') is not a valid name. and I'd suspect almost any browser but IE8 would throw an error on that If you want to add a non-breaking space to the element, you could do shim.innerHTML = shim.innerHTML + "&amp;nbsp;";
type: Answer

http://stackoverflow.com/comment/47708125
comment on: http://stackoverflow.com/q/29789506
type: Comment
has text: Take a look at the network traffic, check if the request and response are the ones you expect to be (Developer tools/Firebug -> Network)
score: 0
type: QuestionComment

http://stackoverflow.com/comment/76679271
has text: consider using self instead of that. That is fairly misleading as it should be synonymous with "this" (not important really though, to each his own)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29810914
score: 2

http://stackoverflow.com/comment/47813927
type: Comment
has text: @Regent Yes. Updated post attempts approach of utilizing `.splice()` to create "new" array of file objects to "keep" , _not_ attempting to modify, "delete" , or upload original `FileList` object. See also http://stackoverflow.com/questions/26245482/sorting-algorithm-in-javascript/26246038#comment41172485_26246038
comment on: http://stackoverflow.com/a/29841225
type: AnswerComment
score: 0

cordova
tags question: http://stackoverflow.com/q/29689058
tags question: http://stackoverflow.com/q/29734856
tags question: http://stackoverflow.com/q/29699713
tags question: http://stackoverflow.com/q/29775712
tags question: http://stackoverflow.com/q/29814095
tags question: http://stackoverflow.com/q/29715052
tags question: http://stackoverflow.com/q/29756065
tags question: http://stackoverflow.com/q/29759767
tags question: http://stackoverflow.com/q/29723827
tags question: http://stackoverflow.com/q/29752721
tags question: http://stackoverflow.com/q/29754952
tags question: http://stackoverflow.com/q/29766550
tags question: http://stackoverflow.com/q/29813776
tags question: http://stackoverflow.com/q/29764117
tags question: http://stackoverflow.com/q/29761218
tags question: http://stackoverflow.com/q/29814286
tags question: http://stackoverflow.com/q/29734464
tags question: http://stackoverflow.com/q/29713098
tags question: http://stackoverflow.com/q/29760578
tags question: http://stackoverflow.com/q/29774238
tags question: http://stackoverflow.com/q/29842663
tags question: http://stackoverflow.com/q/29714062
tags question: http://stackoverflow.com/q/29718956
tags question: http://stackoverflow.com/q/29836239
tags question: http://stackoverflow.com/q/29699178
tags question: http://stackoverflow.com/q/29717462
tags question: http://stackoverflow.com/q/29734790
tags question: http://stackoverflow.com/q/29843370
tags question: http://stackoverflow.com/q/29733980
tag name: cordova
tags question: http://stackoverflow.com/q/29774123
tags question: http://stackoverflow.com/q/29840090
tags question: http://stackoverflow.com/q/29712400
tags question: http://stackoverflow.com/q/29802947
tags question: http://stackoverflow.com/q/29695779
tags question: http://stackoverflow.com/q/29789135
tags question: http://stackoverflow.com/q/29769952
tags question: http://stackoverflow.com/q/29692162
tags question: http://stackoverflow.com/q/29785903
tags question: http://stackoverflow.com/q/29782424
tags question: http://stackoverflow.com/q/29747004
tags question: http://stackoverflow.com/q/29774549
type: Tag
tags question: http://stackoverflow.com/q/29786248
tags question: http://stackoverflow.com/q/29840935
tags question: http://stackoverflow.com/q/29797374
tags question: http://stackoverflow.com/q/29803100
tags question: http://stackoverflow.com/q/29789299
tags question: http://stackoverflow.com/q/29802650

http://stackoverflow.com/a/29752822
type: Answer
has body: Try seeing if there is a css stylesheet overiding your change. Maybe explicitly create a table style on the new page to double check.
answers question: http://stackoverflow.com/q/29739098
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29739098
type: AcceptedAnswer
downvote count: 0
score: 1

http://stackoverflow.com/comment/47588509
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29727233
has text: I removed all the extra code and output from question. In the future, try to limit code samples/output to just what pertains to the problem at hand. It makes questions more readable.
score: 0

http://stackoverflow.com/comment/47634645
type: Comment
has text: Yeah. Use `parseFloat(tax_value)` to give a number you can use.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29751266

http://stackoverflow.com/a/29795319
has comment: http://stackoverflow.com/comment/47721913
has comment: http://stackoverflow.com/comment/47722224
upvote count: 0
has comment: http://stackoverflow.com/comment/47720921
has comment: http://stackoverflow.com/comment/47721634
has comment: http://stackoverflow.com/comment/47725158
answers question: http://stackoverflow.com/q/29792518
has comment: http://stackoverflow.com/comment/47722126
has comment: http://stackoverflow.com/comment/47725287
has body: The response is in xmlhttp.responseXML. Add alert(xmlhttp.responseXML); before the last } to see server response.
type: Answer
has comment: http://stackoverflow.com/comment/47721183
downvote count: 1
score: -1

http://stackoverflow.com/comment/47601526
type: Comment
has text: despite some disposition problems, the hover and active pseudo-classes are well handled and clicking on the links loads the new location. Tested on firefox an chrome.
type: QuestionComment
comment on: http://stackoverflow.com/q/29733746
score: 0

rsvp.js
type: Tag
tag name: rsvp.js
tags question: http://stackoverflow.com/q/29834906

http://stackoverflow.com/comment/47572977
has text: @mplungjan: "simple text simple text simple text http://www.domain.ext/subdir again text text text https://yourbank.com/transfertomealltheirmoney/witharegex text text text and again text". SO eliminates h t t p: / / from my strings
score: 0
comment on: http://stackoverflow.com/q/29718962
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29762939
has comment: http://stackoverflow.com/comment/47657610
tagged with: php
has comment: http://stackoverflow.com/comment/47684560
has comment: http://stackoverflow.com/comment/47657799
has comment: http://stackoverflow.com/comment/47657905
has comment: http://stackoverflow.com/comment/47657885
has title: why is ajax and php script not posting back into original form
has comment: http://stackoverflow.com/comment/47657594
tagged with: forms
has answer: http://stackoverflow.com/a/29763384
has comment: http://stackoverflow.com/comment/47657661
has comment: http://stackoverflow.com/comment/47685161
type: Question
answer count: 1
tagged with: javascript
tagged with: ajax
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47657669
has body: I have this form and I'm using ajax to send data to a simple php script (just trouble shooting with simple php script) but it is not posting back data to original html form... here are the two scripts contact.html Contact Us <!--[if lt IE 9]> <![endif]--> Contact Us aldkfjasdkfjaskdfasdfkasdkfjadsfjsdkfjaskfjasdkfjasjfaskdfjsdkfjsksdsdkjsd Name: Email: Subject: Text: Send GOOGLE MAP HERE! contact.php <?php if (isset($_POST['name'])) { $name = $_POST['name']; } if (isset($_POST['email'])) { $email = $_POST['email']; } echo "Name: " . $name . " Email: " . $email; ?>
has comment: http://stackoverflow.com/comment/47657616
type: UnansweredQuestion

http://stackoverflow.com/q/29781468
possible better answer: http://stackoverflow.com/a/29781620
tagged with: arrays
tagged with: javascript
tagged with: jquery
has title: Separate and append values from Array
score: 0
accepted answer: http://stackoverflow.com/a/29781546
upvote count: 1
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/29781620
has answer: http://stackoverflow.com/a/29781546
has comment: http://stackoverflow.com/comment/47693072
has body: I have an array like this: ["demo", "4532t78"] It came from two steps: var userInfo = $.parseJSON(JSONallUserInfo); console.log(userInfo.available_client_ids); // gives me `["demo", "4532t78"]` How do I separate this array further so I can, for example, append each value to a select?
has answer: http://stackoverflow.com/a/29781603
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47693039
has comment: http://stackoverflow.com/comment/47693005
downvote count: 1
has answer: http://stackoverflow.com/a/29781616
type: Question

http://stackoverflow.com/comment/47530709
score: 1
comment on: http://stackoverflow.com/q/29696618
type: Comment
has text: ".readOnly" is supported in every major browser including firefox. That's probably not the point. What exactly is not working? Debug it using FireBug and provide some more information please.
type: QuestionComment

http://stackoverflow.com/comment/47629627
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29748127
type: Comment
has text: I am using 1.3.6 and I added an example

http://stackoverflow.com/a/29828189
has comment: http://stackoverflow.com/comment/72202574
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/29823757
answers question: http://stackoverflow.com/q/29823757
has body: Managed to figure a workaround, although this doesn't feel quite right. Anyway, if anyone has better suggestion feel free to post :) element.all(by.repeater('link in links')).map( function(link, index) { return { index: index, href: link.getAttribute('href') }; }) .then(function(links) { for (var i = links.length - 1; i &gt;= 0; i--) { browser.get(links[i].href); // do some page specific stuff here. }; });
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47678422
comment on: http://stackoverflow.com/q/29772709
has text: You can view them in the development console/inspector if you open a dialogue at a time (or all for that matter).
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29733646
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47601610
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/29734357
has comment: http://stackoverflow.com/comment/47601833
answer count: 2
upvote count: 1
possible better answer: http://stackoverflow.com/a/29733828
has answer: http://stackoverflow.com/a/29733828
has body: I'm new to Angular. I created a small directive where the user can input a timestamp and add/substract 1 day. The directive needs to be isolated so that it can appear multiple times in my application. This is the part where I initialize my dates: $scope.dateFrom = { label : 'Date From', date : mii.utils.date.dateToIntDate(start) } $scope.dateUntil = { label : 'Date Until', date : mii.utils.date.dateToIntDate(end) } In the HTML of my view I create 2 instances of my directive: &lt;date-input date="dateFrom"&gt;&lt;/date-input&gt; &lt;date-input date="dateUntil"&gt;&lt;/date-input&gt; The result looks like the below image. Two seperate input fields, each has its own label and default value. So far the isolation seems to be working. The problem is however, when I click the plus sign of Date From, it will add a day to the value of Date Until. When I look in the debugger on function _addDays I see that $scope.dateInfo is indeed pointing to the dateUntil object even though I am interacting with date From. What am I missing? date.html &lt;div id="date-input"&gt; &lt;span&gt; &lt;img src="assets/img/minus.png" class="icon left" ng-click="yesterday()"/&gt; {{dateInfo.label}} &lt;img src="assets/img/add.png" class="icon right" ng-click="tomorrow()"/&gt; &lt;/span&gt; &lt;input ng-model="dateInfo.date" class="center"/&gt; &lt;/div&gt; dateController.js app.directive("dateInput", function() { return { restrict: "E", templateUrl : "app/shared/dateInput/date.html", scope : { dateInfo : "=date" }, link : function($scope, $element, $attrs) { $scope.yesterday = function(){ _addDays(-1); }; $scope.tomorrow = function(){ _addDays(1); } _addDays = function(days){ var d = mii.utils.date.intDateToDate($scope.dateInfo.date); var newD = new Date(d); newD.setDate(d.getDate()+days); $scope.dateInfo.date = mii.utils.date.dateToIntDate(newD); } } } });
tagged with: javascript
has answer: http://stackoverflow.com/a/29734357
has title: Isolation of directives with AngularJS

http://stackoverflow.com/a/29712887
has comment: http://stackoverflow.com/comment/47563046
has comment: http://stackoverflow.com/comment/47563439
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/47563318
has body: Try changing setTimeout("jQuery('#saveMessage').hide('slow');", 5000); to setTimeout(function() { jQuery('#saveMessage').hide('slow'); }, 5000);
has comment: http://stackoverflow.com/comment/47563332
answers question: http://stackoverflow.com/q/29712861
has comment: http://stackoverflow.com/comment/47563655
downvote count: 0
has comment: http://stackoverflow.com/comment/47571822
has comment: http://stackoverflow.com/comment/47563401
type: Answer

http://stackoverflow.com/a/29777698
answers question: http://stackoverflow.com/q/29777404
downvote count: 0
type: Answer
has body: Following the snippet that appears on the Google tag manager page you can modify it to make sure that when is inserted it adds the attribute id to the script element with the value you want. this is default the Google tag manager snippet: And this is how you can customize it to make sure that uses an ID: You just need to add the tag manager id at the bottom where are defined all the values, and later when the script is being created (variable j) we set the attribute id with the customID variable (the tag manager ID). I hope it helps!
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47696008

http://stackoverflow.com/comment/47792976
type: QuestionComment
has text: I expect to return the data when I call the GetKey in the controller
score: 0
comment on: http://stackoverflow.com/q/29832114
type: Comment

http://stackoverflow.com/a/29792830
answers question: http://stackoverflow.com/q/29791961
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47750409
upvote count: 1
has body: I had a similar issue a while back one thing to note, I was not able to send the file to PHP via the $_FILE global, but we can do the exact same thing with the $_SERVER['HTTP_X_FILENAME']. I wrote the following JS function. function UploadFile(file) { var xhr = new XMLHttpRequest(); if (xhr.upload &amp;&amp; file.size &lt;= $id("MAX_FILE_SIZE").value) { // start upload xhr.open("POST", $id("upload").action, true); xhr.setRequestHeader("X-FILENAME", file.name); xhr.onload = function(e) { if (this.status == 200) { ... Some processing script for returning messages } }; xhr.send(file); } } On the PHP side use the following to access the file: $fn = (isset($_SERVER['HTTP_X_FILENAME']) ? $_SERVER['HTTP_X_FILENAME'] : false); if ($fn) { $file = "desired location/" . $fn; file_put_contents($file,file_get_contents('php://input')); } You need to pass your JS variable into the UploadFile function and write a handler for the returning data.
score: 1

http://stackoverflow.com/q/29720904
answer count: 0
tagged with: npm
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/52809893
type: Question
has body: I recently read a great article outlining the downside of using Grunt/Gulp; which in turns offers leveraging the "npm scripts" approach. Eventually I found this article: http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/ I took a shot and tried to implement the as described in the article, and came across a two questions: Question #1: $ npm run build:js ( actual command is: "browserify src/javascript/someModule.js" ) // ----------- Why these two lines are added to the stdout ? -------- // &gt; my-new-app@1.0.0 build:js /Users/elad.chen/Projects/incapsula/daedalus/new-app &gt; browserify src/javascript/core/sidebar.js // -------------------------------------------------------------------- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&amp;&amp;require;if(!u&amp;&amp;a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&amp;&amp;require;for(var o=0;o&lt;r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ module.exports = function() { console.log("hi") }; },{}]},{},[1]); I then realized that npm -s, --silent or even --loglevel flags can resolve that. So, if I type "npm run build:js -s" in console, the stdout doesn't include the redundant logs, But, If I simply add one of the flags to the actual task value, e.g: "build:js": "browserify src/javascript/core/sidebar.js --silent" I still get that extra log info. Question #2: When I used Gulp I was able to add breakpoints and debug any running task with ease since I'm using Intellij Idea. How can I debug when using npm scripts as the build tool?
has comment: http://stackoverflow.com/comment/52790801
tagged with: javascript
has title: npm as a build tool
upvote count: 1
tagged with: intellij-idea
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/47587250
has text: Didn't put a z-index in the CSS of #PortContent thats why the button didn't respond. Cause the was a layer above it
comment on: http://stackoverflow.com/a/29726628
type: AnswerComment
score: 0
type: Comment

source-maps
type: Tag
tag name: source-maps
tags question: http://stackoverflow.com/q/29749695

http://stackoverflow.com/a/29769094
type: Answer
answers question: http://stackoverflow.com/q/29768630
downvote count: 0
score: 5
has comment: http://stackoverflow.com/comment/47669117
has body: Your $scope changes inside accordion. Solution is attach this property in an object on $scope. See working fiddle here. Updated plunkr. It's not much difficult once you find out your mistake in previous question.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29768630
upvote count: 5

http://stackoverflow.com/comment/47532578
type: AnswerComment
comment on: http://stackoverflow.com/a/29697617
has text: `$('#date_to, #date_from').on('change', remove)` would be more compact.
type: Comment
score: 0

http://stackoverflow.com/comment/47616185
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29703923
has text: Apologies for the delay in replying, all the answers were right but @M.Doye was in first so will accept his answer but you all had the same solution. Thank you so much for your help and I should have noticed that sooner

http://stackoverflow.com/q/29818858
type: Question
has comment: http://stackoverflow.com/comment/47765704
tagged with: javascript
linked to: http://stackoverflow.com/q/226663
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29820045
tagged with: http://stackoverflow.com/tag/xml
type: AnsweredQuestion
tagged with: rss
score: 1
has title: Parse RSS title into HTML using Javascript
accepted answer: http://stackoverflow.com/a/29820045
upvote count: 1
has body: I am trying to populate a menu on a webpage with the 5 latests topics from our site's RSS newsfeed using Javascript (e.g. jQuery - we import v. 1.9.1 already), and I have been trawling the content in here to find something that work, but the answer most suiting my problem seems to be using deprecated scripts. The RSS feed is stored on our own server, so reading rights should be ensured. I would prefer using Javascript of some sort and I simply need to have the titles of e.g. the latest X news and their links tossed into first news header second news header One of the answers in here led me to this JSfiddle:Code but it doesn't seem to work? Another answer in here code gives a jQuery code that I have no clue how to utilize in my HTML afterwards, so it might as simple as guiding me to the use of this? I have very limited experience using JS, so I would greatly appreciate some pretty low-tech advice on how to get things working both in terms of what to include in a .js file and how to make it appear in my HTML afterwards. The news feed is here:Link Thanks!

http://stackoverflow.com/q/29696860
favorite count: 0
has answer: http://stackoverflow.com/a/29697081
upvote count: 1
has title: Add a value in combobox without a store
type: AnsweredQuestion
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/29697081
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: extjs
tagged with: rest
has body: I am using REST services to communicate with the server and that function returns a HashMap. I need to use this HashMap to populate the combobox. I have made an ajax request for retrieving that HashMap (in a javascript var). Now that I have this HashMap I need to add the 'keys' as options in the combobox. Is it possible with the help of some insert function without creating a store since my HashMap is itself like a store. How do I accomplish this? I wanted to do something like this : for (var field in json) { combo.add(field) // Is there any function or a way by which I can do this }
tagged with: combobox

http://stackoverflow.com/a/29722020
has comment: http://stackoverflow.com/comment/74545571
answers question: http://stackoverflow.com/q/29720806
type: Answer
has comment: http://stackoverflow.com/comment/47715115
has body: Thank you @Evilzebra, it was simply adding decodeURIComponent at the start of the JS that resolved it. decodeURIComponent(readCookie('cookie_name'));
upvote count: 4
type: AcceptedAnswer
score: 4
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29720806

eclipse
tag name: eclipse
tags question: http://stackoverflow.com/q/29741170
tags question: http://stackoverflow.com/q/29688888
tags question: http://stackoverflow.com/q/29805566
type: Tag

http://stackoverflow.com/comment/47560287
comment on: http://stackoverflow.com/a/29712235
has text: What is it saying when you try it?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29842939
answers question: http://stackoverflow.com/q/29842802
has comment: http://stackoverflow.com/comment/47812094
score: 0
has comment: http://stackoverflow.com/comment/47812442
has comment: http://stackoverflow.com/comment/47812223
type: Answer
has comment: http://stackoverflow.com/comment/47812314
has comment: http://stackoverflow.com/comment/47812285
has body: check the result by alert in between response condition &amp; use window.location.href='correctfilepath.php'; correct path of file to be redirected. Check your user.php also as it will not print anything if it will have some error in code
has comment: http://stackoverflow.com/comment/47811979

http://stackoverflow.com/comment/47548240
score: 0
type: Comment
has text: @VKid see i update my code see snippet . when you click image it gives alert then image is removed
comment on: http://stackoverflow.com/a/29706201
type: AnswerComment

http://stackoverflow.com/comment/47849529
comment on: http://stackoverflow.com/a/29828190
type: Comment
score: 0
type: AnswerComment
has text: @Touffy A pedantic note: using `undefined` as the first value more closely preserves the original behaviour. As this answer is currently written, the subtraction in `months[mm - 1]` forces `mm` to be parsed as an integer, such that `'03'` also gets converted to `'March'`. (That might actually be desirable, but it's technically not what the OP asked.)

http://stackoverflow.com/a/29834629
has comment: http://stackoverflow.com/comment/47948031
has body: The show close button is only for when you are using the default infobox template. When you use custom HTML that functionality is overridden. Your approach of using a link that calls JavaScript to close the infobox is the correct approach to take.
has comment: http://stackoverflow.com/comment/47990360
type: Answer
answers question: http://stackoverflow.com/q/29816364
upvote count: 2
score: 2
has comment: http://stackoverflow.com/comment/47807623
downvote count: 0
has comment: http://stackoverflow.com/comment/47924206
has comment: http://stackoverflow.com/comment/47834109

http://stackoverflow.com/q/29704388
answer count: 2
possible better answer: http://stackoverflow.com/a/29704541
has answer: http://stackoverflow.com/a/29704541
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/29781053
has title: d3 arc tween won't work inside a function call
score: 2
type: AnsweredQuestion
has body: I'm making a pie chart using this blocks example for growing the pie slice on mouseover. In addition to the tween, I also want to have the pie slices change colors and have a tooltip, so I want to have another function called that can work with d and i. The problem is that although the arcTween function works as written on the mouseover, it will not work if it is wrapped in another function -- which I want to do so that I can access the index for tooltip. Can someone explain to me why this isn't working? I have tried many ways of returning the function with different variables and can't get it working. Full code: &lt;!DOCTYPE html&gt; &lt;meta charset="utf-8"&gt; &lt;style&gt; path { stroke: #333; fill-opacity: 90%; stroke-width: 1.5px; transition: fill 250ms linear; transition-delay: 150ms; } path:hover { stroke: #000; fill-opacity: 100%; transition-delay: 0; } &lt;/style&gt; &lt;body&gt; &lt;script src="http://d3js.org/d3.v3.min.js"&gt;&lt;/script&gt; &lt;script&gt; var data = [44, 16, 9, 8,8,8,4,3]; function findColor(index){ var colors = [ "#cb5b49", "#8bbbd3", "#1f61a3", "#c7dae4", "#f0d0bd", "#e89d7b", "#a91729", "#408cb9"]; return colors[index]; } var width = 960, height = 500; var outerRadius = height / 2 - 20, cornerRadius = 10; var pie = d3.layout.pie(); var arc = d3.svg.arc() .padRadius(outerRadius); var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height) .append("g") .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); svg.selectAll("path") .data(pie(data)) .enter().append("path") .each(function(d) { d.outerRadius = outerRadius - 20; }) .attr("d", arc) .attr("fill",function(d, i){return findColor(i)}) .on("mouseover", arcTween(outerRadius + 20, 0)) //THIS WORKS //THE BELOW DOES NOT WORK FOR SOME REASON // .on("mouseover", function(d,i){console.log(i); return arcTween(outerRadius + 20, 0);}) .on("mouseout", arcTween(outerRadius - 20, 150)); function arcTween(outerRadius, delay) { return function() { d3.sel…
upvote count: 2
tagged with: d3.js
type: Question
has answer: http://stackoverflow.com/a/29781053

http://stackoverflow.com/comment/47701016
score: 0
has text: As mentioned I am already passing a model and this particular value is not in the model. Can you post sample code?
type: AnswerComment
comment on: http://stackoverflow.com/a/29781949
type: Comment

http://stackoverflow.com/comment/47782592
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29827169
score: 0
has text: And it certainly is callback hell. I'm planning on rewriting the ajax-related code using Backbone Models soon.

http://stackoverflow.com/comment/47630628
type: Comment
has text: I added some info on the select element inside the answer
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29745291

http://stackoverflow.com/comment/47675884
type: QuestionComment
has text: You sure you are using Jetty? `io.undertow.server.protocol.http` indicates you are using Undertow a similar project, but not Jetty.
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29761957

http://stackoverflow.com/q/29692413
type: Question
has answer: http://stackoverflow.com/a/29692683
tagged with: javascript
has title: How can i get data from service in angular
answer count: 2
has body: I have LoginController and securityService. This is LoginCtrl // place the message if something goes wrong $scope.authMsg = ''; $scope.login = function () { $scope.authMsg = ''; var loginData = {email: $scope.account.email, password: $scope.account.password}; securityService.login(loginData); }; This is securityService login: function (logData) { var _vm = this; $http .post('/api-token-auth/', logData) .then(function (response) { // assumes if ok, response is an object with some data, if not, a string with error // customize according to your api if (!response.data.token) { _vm.authMsg = 'Incorrect credentials.'; } else { $cookieStore.put('djangotoken', response.data.token); $http.defaults.headers.common.Authorization = 'JWT ' + response.data.token; $http.get('/api/account/restricted/').then(function (response) { authService.loginConfirmed(); _vm.currentUser = response.data; $rootScope.currentUser = response.data; }); } }, function (x) { _vm.authMsg = 'Server Request Error'; }); }, This login is working fine but my problem is i don't know how can get the authMesg from service to controller because that is async. Everytime i get blank message in case of invalid login
downvote count: 0
possible better answer: http://stackoverflow.com/a/29692650
favorite count: 0
has answer: http://stackoverflow.com/a/29692650
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29692683
has comment: http://stackoverflow.com/comment/47521652
type: AnsweredQuestion
score: 1
upvote count: 1

http://stackoverflow.com/q/29720879
score: 0
has comment: http://stackoverflow.com/comment/47576350
has comment: http://stackoverflow.com/comment/47576287
has answer: http://stackoverflow.com/a/29757369
accepted answer: http://stackoverflow.com/a/29757369
linked to: http://stackoverflow.com/q/6974328
possible better answer: http://stackoverflow.com/a/29720927
linked to: http://stackoverflow.com/q/7910989
has answer: http://stackoverflow.com/a/29720927
has body: I am working with a invoice form, and I don't have a clue in how can I generate a id in each td, when I try to edit the invoice form... Because I use ajax to call the different data of each product and when I need to change some product, per example in the second or third "td" always change the first "td"... part of the invoice form: &lt;td&gt;&lt;input type="text" name="cat[]" id="cat_(HERE I NEED PUT A ID)" class="form-control"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="subcat[]" id="subcat_(HERE I NEED PUT A ID)" class="form-control"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="vineta[]" id="vineta_(HERE I NEED PUT A ID)" class="form-control"&gt;&lt;/td&gt;
has comment: http://stackoverflow.com/comment/47576302
has title: generate id in each td in invoice form
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47576463
has comment: http://stackoverflow.com/comment/47576395
type: Question
has comment: http://stackoverflow.com/comment/47576297
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47576341

http://stackoverflow.com/q/29766548
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29770661
favorite count: 0
has title: Knockout function if values are equal
has body: i've tried to scroll to an Element within an ul which is made with knockout. The Div should be scrolled to the Element, if a condition is true. The code I have is: M ⊢ What I want to have: There should be the ability to call a function on the li if $parentContext.$index() ==simulator.machineIndex() which gives me the li-Element, so that I can scroll to it. Thanks for your help.
has answer: http://stackoverflow.com/a/29770661
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: knockout.js
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47672581
has comment: http://stackoverflow.com/comment/47669294
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/47586907
score: 0
comment on: http://stackoverflow.com/a/29726295
type: Comment
has text: added a try catch statement to see if the JSON.parse is throwing an exception due to improper json objects
type: AnswerComment

http://stackoverflow.com/comment/47622253
has text: Oh that's true ! I didn't know that binding 'this' to the callback function of the query could make it work because the parameter this.doodle_id was undefined. Thank you very much I'll be aware of that now :D
comment on: http://stackoverflow.com/a/29743824
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47769239
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29819877
has text: Yes, they are right after the CSS links. I have also tried placing them at the bottom but it's no good either
score: 0

http://stackoverflow.com/comment/47704875
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29784236
has text: There is always a way.. check my answer

http://stackoverflow.com/q/29782878
tagged with: node.js
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47696006
type: Question
has comment: http://stackoverflow.com/comment/47695992
has body: I am attempting to install the SDK for Javascript using npm on my EC2 instance. I have Node.js installed (v 0.10.33) and npm installed as well. I have been able to install other things such as Express.js without issue. However when trying to install the AWS SDK for Node I get the following error: node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ TypeError: Object #&lt;Object&gt; has no method 'tmpDir' at /usr/lib/node_modules/npm/node_modules/osenv/osenv.js:49:13 at Object.tmpdir (/usr/lib/node_modules/npm/node_modules/osenv/osenv.js:14:15) at Object.&lt;anonymous&gt; (/usr/lib/node_modules/npm/lib/config/defaults.js:76:18) at Module._compile (module.js:432:26) at Object..js (module.js:450:10) at Module.load (module.js:351:31) at Function._load (module.js:310:12) at Module.require (module.js:357:17) at require (module.js:368:17) at Object.&lt;anonymous&gt; (/usr/lib/node_modules/npm/lib/config/core.js:4:18) Does anyone have any idea what is causing this error or what I can do to fix it? -- Edit: result of running node and os = require('os');, os.tmpDir(); &gt; os = require('os'); { endianness: [Function], hostname: [Function], loadavg: [Function], uptime: [Function], freemem: [Function], totalmem: [Function], cpus: [Function], type: [Function], release: [Function], networkInterfaces: [Function], arch: [Function], platform: [Function], tmpdir: [Function], tmpDir: [Function], getNetworkInterfaces: [Function: deprecated], EOL: '\n' } &gt; os.tmpDir(); '/tmp'
tagged with: amazon-ec2
has comment: http://stackoverflow.com/comment/47696035
tagged with: javascript
tagged with: amazon-web-services
has title: TypeError: Object #<Object> has no method 'tmpDir' when installing AWS SDK for Node.js using npm
has comment: http://stackoverflow.com/comment/47699347
upvote count: 1
has comment: http://stackoverflow.com/comment/47696628
favorite count: 0
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/29783098
score: 1
has comment: http://stackoverflow.com/comment/47736474
tagged with: html5sortable
has body: I am using the currently-maintained version of html5sortable, found here: https://github.com/voidberg/html5sortable If I load up the plain (non-Angular) HTML sample page included, I see two different behaviours for "ghosts" that are attached to the cursor during drag operations: In the very first list, when you drag an item in Chrome, the ghost fades to nothing (gradient from original to transparency) around the edges. In the grid list, which is initialized with the same options, the ghost is just a slightly transparent clone of the original. In other words it doesn't fade as a "gradient", the whole element is just faded out a bit. I can't figure out how to intentionally get this second behaviour. In my application, I keep getting the first. I couldn't discern from the code how to just append a ghost to the DOM. Is it being created at the browser API level? (vs. jQuery UI where it is literally a new element appended to the document). I did discover a class for general styling purposes; however, even when this style does not include a "fade to transparent edges" effect, there is one in place. Normally I'd be happy just writing it off to the HTML5 implementation just "doing it" for me but I can see examples in the same browser on the same page with the same JS initialization (another example is the connected list) in which that fade doesn't happen. I must be missing something glaringly obvious! FWIW, my markup looks something like this: item 1 item 2 item 3 item 4 and my initialization looks like this: $(".source, .target").sortable({ connectWith: ".connected", }); I have some styles but none of them include gradients or even transparency for that matter. I have looked at the html5sortable source code and see references to neither transparency nor gradients. -- Alternatively, if I could figure out how to append a sample "ghost" to the DOM, that would be great... but inspecting the DOM on drag leads me to believe that it's at the browser implementation level rather tha…
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
type: Question
has title: html5sortable - understanding "ghost" element

http://stackoverflow.com/comment/47683001
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29775955
has text: As i see it, the logic should be inside .onkeyup , besides, pay attention that this event is thrown beforce the actual key is shown on the textbox.Therfore, u deny any event of any key besides numbers and so it cancles thier effect (adding key or doing a space, etc..)

http://stackoverflow.com/comment/47618118
has text: thanks Stephen When I put code at the bottom. It works
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29741623

http://stackoverflow.com/comment/47779483
type: AnswerComment
has text: So I need a state specific click event that is all. So all 50 states could say something different when you click on them. Does that makes sense?
type: Comment
comment on: http://stackoverflow.com/a/29826490
score: 0

http://stackoverflow.com/q/29747894
tagged with: angularjs
has answer: http://stackoverflow.com/a/30452491
has comment: http://stackoverflow.com/comment/48753227
has comment: http://stackoverflow.com/comment/48438832
score: 14
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/48342724
tagged with: angular-template
downvote count: 0
has body: I'm using a template to create a popup menu that will show alerts if there is a new one and it's working till now. But i wanted to add manual alert, that's why i thought to add an input text but Oupss, i can't write on the input field and i don't even know why.The input field is sort of Disabled!!! My directive is like so : $scope.tb = { x: 0, y: 0 }; module.directive('myDraggable', function ($document, $interval) { return { restrict: 'EA', replace: true, //scope : true, scope: { menu: '=drSrc'}, link: function (scope, element, attr) { var startX = 0, startY = 0, x = scope.menu.x || 0, y = scope.menu.y || 0, positionX = [], positionY = [], time = [], width, height, moveInterval; element.draggable({ position: 'relative', cursor: 'pointer', top: y + 'px', left: x + 'px' }); element.on('mousedown', function (event) { // Prevent default dragging of selected content event.preventDefault(); startX = event.pageX - x; startY = event.pageY - y; $document.on('mousemove', mousemove); $document.on('mouseup', mouseup); $interval.cancel(moveInterval); }); function mousemove(event) { y = event.pageY - startY; x = event.pageX - startX; //calculate the borders of the document width = $(document).width() - 350; height = $(document).height() - 150; positionX.push(x); positionY.push(y); time.push(Date.now()); } } } }); I tried to make scope true but i faced 2 problems, : I can't move my popup anymore (yes my popup menu is Draggable) And Also the input text does not show my text i'm typing. Here's my cache template : $templateCache.put('control.tpl.html', ' Manage Alert {{Alert.id}} '); I'm new with AngularJS and Directive and I don't know how to solve this but I think it's a problem with Scopes!! Thank you. UPDATE : If I delete scope:{menu:"=drSrc"} That work and i can type what i want but the problem is that my element is no more draggable. I think it's sth related to scopes. can anyone help please?
accepted answer: http://stackoverflow.com/a/30330884
has comment: http://stackoverflow.com/comment/48993567
linked to: http://stackoverflow.com/q/14050195
type: Question
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/30330884
tagged with: javascript
upvote count: 14
has comment: http://stackoverflow.com/comment/48754551
answer count: 2
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/48956606
has title: Issue with multiple child HTML elements using Directives in AngularJS
possible better answer: http://stackoverflow.com/a/30452491

http://stackoverflow.com/comment/47527642
score: 0
type: AnswerComment
has text: ,what is inside in the stufftoddo() ?
comment on: http://stackoverflow.com/a/29695012
type: Comment

http://stackoverflow.com/comment/47801089
has text: Yeah. By wrapping it.
comment on: http://stackoverflow.com/q/29837190
score: 0
type: Comment
type: QuestionComment

tcp
type: Tag
tags question: http://stackoverflow.com/q/29755296
tags question: http://stackoverflow.com/q/29750798
tag name: tcp

http://stackoverflow.com/comment/47665140
score: 0
type: Comment
type: QuestionComment
has text: Please suggest best solution.
comment on: http://stackoverflow.com/q/29766415

http://stackoverflow.com/comment/47674026
has text: yes, that works. but as a user no one can type such a way right? then what is mean to use `html5` support here?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29771322

http://stackoverflow.com/comment/47562291
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29699178
has text: you can use this geolcation plugin too http://cordova.apache.org/docs/en/3.3.0/cordova_geolocation_geolocation.md.html#Geolocation

papaparse
type: Tag
tag name: papaparse
tags question: http://stackoverflow.com/q/29831985

django
tags question: http://stackoverflow.com/q/29775956
tags question: http://stackoverflow.com/q/29768376
tags question: http://stackoverflow.com/q/29827459
tags question: http://stackoverflow.com/q/29795013
type: Tag
tags question: http://stackoverflow.com/q/29743151
tags question: http://stackoverflow.com/q/29761503
tags question: http://stackoverflow.com/q/29844941
tag name: django
tags question: http://stackoverflow.com/q/29833320
tags question: http://stackoverflow.com/q/29811667
tags question: http://stackoverflow.com/q/29701246
tags question: http://stackoverflow.com/q/29821063
tags question: http://stackoverflow.com/q/29759239
tags question: http://stackoverflow.com/q/29821498
tags question: http://stackoverflow.com/q/29794877

http://stackoverflow.com/q/29723690
linked to: http://stackoverflow.com/q/11563638
upvote count: 5
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29723705
answer count: 3
has title: Use getElementById in Alert
favorite count: 0
accepted answer: http://stackoverflow.com/a/29723729
has answer: http://stackoverflow.com/a/29723720
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29723729
duplicate of: http://stackoverflow.com/q/11563638
has body: This is my code: &lt;form method="GET"&gt; &lt;input type="text" class="form" name="name" placeholder="Enter your name!" id="name"&gt; &lt;input type="submit" onclick="return clicked();" value="I'm ready!"&gt; &lt;/form&gt; &lt;script&gt; function clicked() { return confirm('Hiya,'); } var email = document.getElementById('name').value; &lt;/script&gt; I've had a search around, but I cannot find any single topic which matches my question. On the return confirmation where it currently just says Hiya, I would like it to then also include the name which the user entered into the text input. Help would be appreciated.
type: Question
score: 5
possible better answer: http://stackoverflow.com/a/29723705

http://stackoverflow.com/comment/47728423
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29790980
has text: Hi thanks, is there a way to have a filter on the distance to make it a whole number. Something like
type: AnswerComment

http://stackoverflow.com/comment/47626003
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29745925
score: 0
has text: I am trying to use it inside Unity alongside with C# scripts.

http://stackoverflow.com/comment/47800738
type: QuestionComment
has text: what does the console say?
score: 0
comment on: http://stackoverflow.com/q/29837027
type: Comment

http://stackoverflow.com/a/29790430
type: Answer
score: 2
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/47776584
has body: To get all the documents that are doctors but have ANY sort of value on the name field, you need the $exists and $ne operators in your query, since the $exists operator matches the documents that contain the field, including documents where the field value is null and the $ne operator selects the documents where the name field is not null: db.user.find({"name": { "$exists": true, "$ne": null }, "information": "doctor"});
answers question: http://stackoverflow.com/q/29790124

http://stackoverflow.com/q/29713638
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47566169
score: 0
has comment: http://stackoverflow.com/comment/47562899
has comment: http://stackoverflow.com/comment/47563206
tagged with: jquery
has comment: http://stackoverflow.com/comment/47563217
tagged with: joomla
tagged with: ajax
type: UnansweredQuestion
has body: I have a div element holding two fields; a textbox and a text editor. I also have a button that says "Add". I need that button, when clicked, to add a new row, ie, dynamically repeat the div. How can I create this using jQuery AJAX. Also I must delete the selected row on onclick? js = jQuery; js('#add').on('click',function(){ var id = js(".row-fluid:last").attr('id'); var appendDiv = js(js(".row-fluid:last")[0].outerHTML); appendDiv.attr('id', ++id).insertAfter(".row-fluid:last"); }); js('#remove').on('click',function(){ var id = js(".row-fluid:last").attr('id'); if(id != 0) js('#'+id).remove(); else alert('parent field cannot be deleted'); }); I tried using this. This works for me. But the text editor so created is not editable. So I am trying to create using jQuery AJAX. But I don't know how to write it. This is the working HTML which I used with the jQuery &lt;div&gt; &lt;a href="#" name="add_more" id="add"&gt;Add&lt;/a&gt;&amp;nbsp; &lt;a href="#" name="remove" id="remove"&gt;Remove&lt;/a&gt; &lt;/div&gt; &lt;div id="0" class="row-fluid"&gt; &lt;div class="span10 form-horizontal"&gt; &lt;fieldset class="adminform"&gt; &lt;div class="control-group"&gt; &lt;div class="control-label"&gt;Days&lt;/div&gt; &lt;div class="controls"&gt;&lt;input type="text" name="days[]"/&lt;/div&gt; &lt;/div&gt; &lt;div class="control-group"&gt; &lt;div class="control-label"&gt;Details&lt;/div&gt; &lt;div class="controls"&gt; &lt;?php $editor =&amp; JFactory::getEditor(); $params = array( 'smilies'=&gt; '0' , 'style' =&gt; '1' , 'layer' =&gt; '0' , 'table' =&gt; '0' , 'clear_entities'=&gt;'0' ); echo $editor-&gt;display( 'details[]', '', '400', '400', '20', '20', false, $params ); ?&gt; &lt;/div&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/div&gt; &lt;/div&gt;
has comment: http://stackoverflow.com/comment/47562664
answer count: 0
has comment: http://stackoverflow.com/comment/47566369
has title: Dynamically Create a div Using jQuery AJAX in Joomla?

http://stackoverflow.com/q/29799915
type: Question
tagged with: javascript
has title: jQuery change text of all next elements
has comment: http://stackoverflow.com/comment/47728608
score: 0
has comment: http://stackoverflow.com/comment/47727976
tagged with: jquery-selectors
answer count: 1
accepted answer: http://stackoverflow.com/a/29800202
tagged with: jquery
has body: I would like to get all next specific class Elements and change the text of them. Specifically the number of the entry because i've made an ajax request to delete a record in a datatabse and i don't want to reload the page. First i get the actual entry number to know which text (or entry Number) should be replaced (for loop) $entryHeadContent = $this.closest('.entry').find('.entry-head').text(); $entryID = parseInt($entryHeadContent.split('|')[0].replace(/ /g,'')); Then i would like to go through all next entry-heads to change the actual entry number (decrease the number by 1). alert($this.nextAll('.entry-head').length); // Is 0 $this.nextAll('.entry-head').each(function(index){ alert($this.nextAll('.entry-head').length); for (i = entryID; i <= $this.nextAll('.entry-head').length; i++) { index.text().replace(i, (i -1)) alert('Index: ' + index + ' | '); } }); But somehow that code don't seems to be executed but i don't get it. Why? $this is the form (test). I'm still in the ajax request (in the .done part of the ajax request. This is the entry html(tpl) file, for one entry: #{$entryNumber} | Name: {$entry.name} .... {$entry.message}
tagged with: text
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47728101
has answer: http://stackoverflow.com/a/29800202

http://stackoverflow.com/comment/47754793
type: AnswerComment
type: Comment
has text: In your bootstrap.min.css, remove the !important tag from the .hide class (display:none rather than display:none!important)
score: 1
comment on: http://stackoverflow.com/a/29813461

http://stackoverflow.com/q/29820182
type: Question
tagged with: angularjs-ng-model
tagged with: javascript
score: 0
has body: I am using a time-picker on certain inputs, The time picker does not update the ng-model, I made a plunker Basically in controller: $('.TimePickers').timepicker(); in html: Model which in not updating: {{MonOpen}}
answer count: 1
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29820824
has title: Timepicker not updating ng-model
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29820824

http://stackoverflow.com/q/29834876
score: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47796910
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29834903
has comment: http://stackoverflow.com/comment/47796586
upvote count: 3
tagged with: http-redirect
downvote count: 3
tagged with: http
has title: Site automatic redirect
type: Question
has body: I want to redirect my site with javascript. The intended behavior is that the user waits for a certain period of time then gets taken to a new page.
accepted answer: http://stackoverflow.com/a/29834903

http://stackoverflow.com/q/29734601
accepted answer: http://stackoverflow.com/a/29734649
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/29734649
tagged with: api
answer count: 1
has title: Twitch API -- Get Name
has body: just wondering if anyone who's experienced using JQuery or twitch API could help with this. Basically I am trying to get a username, but I do not want to have to click a button or display it in an input box. Here is the code from the API examples: $('#get-name button').click(function() { Twitch.api({method: 'user'}, function(error, user) { $('#get-name input').val(user.display_name); }); }) So does anyone know how I would get the username without displaying it in an input box or have to click a button to display their username.
favorite count: 0

http://stackoverflow.com/comment/47610227
comment on: http://stackoverflow.com/q/29738477
has text: or even better, in PHP `<?php if ( is_home() ) echo $img; ?>`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29693277
type: Question
score: 2
tagged with: firefox
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47523032
has comment: http://stackoverflow.com/comment/47522954
has comment: http://stackoverflow.com/comment/47526494
favorite count: 0
has title: Password remember dialog not showing in chrome
tagged with: angularjs
has body: In My project i have used angular js and ruby on rails(REST Client). When I login in, browser doesn't ask me to save password. Instead when i logout from the website, that time it asks me to save password. My html code &lt;form action="#login" method="post" name="candidate_loginform" id="candidate_loginform" ng-submit="Login(candidate_loginform);" novalidate onsubmit="return false;"&gt; &lt;input id="log" type="text" name="log" ng-model="login.email" required placeholder="User Id"/&gt; &lt;input id="pwd" type="password" name="pwd" ng-model="login.password" required placeholder="Password"/&gt; &lt;input type="submit" value="Log In" class="btn btn-green full-width"&gt; &lt;/form&gt; The above code works fine in Firefox, but in Chrome if fails. I tried all possible solutions found on stackoverflow and ended till here. I am using angularjs 1.2.28. My login code: var transform = function(data) { return $.param(data); }; $http.post(rest_url+'users/sign_in', {'user':$scope.login},{ headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}, transformRequest: transform }).success(function(data){ $location.path("/dashboard"); }).error(function(data){ hideLoader(); error_notification(data.message); });
upvote count: 2
type: UnansweredQuestion
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/47524182
answer count: 0

http://stackoverflow.com/a/29782919
score: 2
answers question: http://stackoverflow.com/q/29782632
downvote count: 0
has comment: http://stackoverflow.com/comment/47731731
upvote count: 2
has body: Start with an empty string and copy the original string. Find the index of the string to replace in the copy (setting them both to lowercase makes the search case-insensitive). If it's not in the copy, skip to step 7. Add everything from the copy up to the index, plus the replacement. Trim the copy to everything after the part you're replacing. Go back to step 2. Add what's left of the copy. Just for fun I've created an interactive version where you can see the results of both a regex and indexOf, to see if escaping a regex breaks anything. The method used to escape the regex I took from jQuery UI. If you have it included on the page it can be found with $.ui.autocomplete.escapeRegex. Otherwise, it's a pretty small function. Here's the non-regex function, but since the interactive section adds a lot more code I have the full code snippet hidden by default. function insensitiveReplaceAll(original, find, replace) { var str = "", remainder = original, lowFind = find.toLowerCase(), idx; while ((idx = remainder.toLowerCase().indexOf(lowFind)) !== -1) { str += remainder.substr(0, idx) + replace; remainder = remainder.substr(idx + find.length); } return str + remainder; } // example call: insensitiveReplaceAll("Find aBcc&def stuff ABCabc", "abc", "ab"); function insensitiveReplaceAll(original, find, replace) { var str = "", remainder = original, lowFind = find.toLowerCase(), idx; while ((idx = remainder.toLowerCase().indexOf(lowFind)) !== -1) { str += remainder.substr(0, idx) + replace; remainder = remainder.substr(idx + find.length); } return str + remainder; } function escapeRegex(value) { return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); } function updateResult() { var original = document.getElementById("original").value || "", find = document.getElementById("find").value || "", replace = document.getElementById("replace").value || "", resultEl = document.getElementById("result"), regexEl = document.getElementById("regex"); if (original && find && replace) { …
has comment: http://stackoverflow.com/comment/47700532
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47748643
type: Answer
accepted answer of: http://stackoverflow.com/q/29782632

http://stackoverflow.com/comment/48628572
comment on: http://stackoverflow.com/a/30247523
score: 0
type: AnswerComment
type: Comment
has text: You're welcome! Let me know if it fits to your request, it took me hours to develop it in the best way!! **XD**

http://stackoverflow.com/a/29751354
has comment: http://stackoverflow.com/comment/47638793
has comment: http://stackoverflow.com/comment/47637371
has body: you can show your loader right after or before $.ajax({...}) but you should never use async:false, this is the root of evil, it will freeze the browser while the request has not succeeded. like this: var callController = function (FirstName, documentId, fileName, SL) { //here showLoader(); $.ajax({ type: "POST", url: "http://localhost:63902/Home/Preview?DocumentId=" + documentId + "&amp;FileName=" + fileName + "&amp;SL=" + SL, cache: false, //controller happens... success: function (returnedValue) { rememberDocumentId(documentId); location.reload("#mainIframe"); setTimeout(function () { }, 3000); document.getElementById("mainIframe").style.display = "none"; document.getElementById("documentIframe").style.display = "block"; document.getElementById("documentIframe").src = "http://localhost:63902/FileProcessing/PDFProcessing/TempPDF/" + returnedValue; //hide Here hideLoader(); }, error: function (jqXHR, textStatus, errorThrown) { alert(jqXHR + " " + textStatus + " " + errorThrown); //hide Here hideLoader(); } }); }
has comment: http://stackoverflow.com/comment/47637447
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47636483
answers question: http://stackoverflow.com/q/29751095
has comment: http://stackoverflow.com/comment/47637274
type: Answer
has comment: http://stackoverflow.com/comment/47638821
accepted answer of: http://stackoverflow.com/q/29751095
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47637534

http://stackoverflow.com/q/29737174
has comment: http://stackoverflow.com/comment/47607564
has comment: http://stackoverflow.com/comment/47607824
has comment: http://stackoverflow.com/comment/47607609
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47607767
has comment: http://stackoverflow.com/comment/47607712
has comment: http://stackoverflow.com/comment/47607657
has title: adding images by using function in dropdownlist
has comment: http://stackoverflow.com/comment/47607829
type: Question
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47607820
score: 0
has comment: http://stackoverflow.com/comment/47704998
has answer: http://stackoverflow.com/a/29737915
has comment: http://stackoverflow.com/comment/47607782
tagged with: http://stackoverflow.com/tag/html
has body: I've a homework about html and javascript and I have done somethings butIi didnt managed to work This is what school gave me: "You will create a file namely hw3_2.html that contains a javascript function taking an input from user and displaying two images. There is a dropdown list in this page and a user can select one of the three images. The image that the user selected is displayed as first image. When the user makes this selection, a random number is generated between 1 - 3 and the corresponding image is displayed as second image. Then a message will also be displayed whether these two images are same or different. The user interface of the web page is shown below. You may use photos of your hometown instead of the images of Eskisehir." Here is what I've done so far: can you help me? < !-- do i need to add more attibute? --> Photos: eskisehir1 eskisehir2 eskisehir3 maybe i made lots of mistakes but i wanna learn this
has comment: http://stackoverflow.com/comment/47607617

http://stackoverflow.com/q/29696945
has answer: http://stackoverflow.com/a/34028168
tagged with: spring-boot
has comment: http://stackoverflow.com/comment/47550972
tagged with: javascript
type: UnansweredQuestion
tagged with: spring-data-rest
has comment: http://stackoverflow.com/comment/47529905
downvote count: 0
has body: hello i'm using spring boot , restful web service and angularjs, this is my restControlleur @RestController @RequestMapping("/structure") public class StructureNotificationRestContolleur { @Autowired StructureNotificationService StructureNotif; @Autowired ChampService champService; @RequestMapping(value = "/deleteChamp/{ch}", method=RequestMethod.DELETE ) public @ResponseBody void DeleteChamp(@PathVariable (value="ch") int ch) { champService.DeleteChamp(ch); } there is the button to delete : $scope.deleteST= function(ids) { $http.delete('/structure/deleteChamp/'+ids). success(function(data) { alert(ids); }); } but there is the error : o.s.web.servlet.PageNotFound : Request method 'DELETE' not supported ???
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47530111
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47530157
type: Question
has title: Request method 'DELETE' not supported angularsjs springboot
has comment: http://stackoverflow.com/comment/47567520
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/47779079
type: QuestionComment
score: 1
has text: You'd be surprised how complicated it can be to achieve what you want. Instead of re-inventing the wheel, I'd suggest using an existing plugin that already covers all the edge cases you'll run into: https://github.com/SamWM/jQuery-Plugins/tree/master/numeric
type: Comment
comment on: http://stackoverflow.com/q/29826239

http://stackoverflow.com/a/29736743
type: Answer
accepted answer of: http://stackoverflow.com/q/29736521
score: 2
answers question: http://stackoverflow.com/q/29736521
has comment: http://stackoverflow.com/comment/47606713
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has body: The problem is this line: var section = $(element.text()); as per knockout's documentation element — The DOM element involved in this binding text is a jQuery function not a DOM function so I think you are looking for something like: $(element).text() or $($(element).text()) instead? I'd assume the former since it makes more sense. As for the nested binding handler I'm not sure why that is in the viewmodel since it's exposed on the knockout global object you're not protecting yourself from anything just making your code more unreadable. They are designed to be resuable so you can use them with different viewModels
has comment: http://stackoverflow.com/comment/47606749

http://stackoverflow.com/comment/53532625
score: 0
comment on: http://stackoverflow.com/q/29802430
type: Comment
type: QuestionComment
has text: possible duplicate of [Dynamically turn on/off antialiasing and shadows in WebGLRenderer](http://stackoverflow.com/questions/27554969/dynamically-turn-on-off-antialiasing-and-shadows-in-webglrenderer)

http://stackoverflow.com/q/29819822
upvote count: 0
has answer: http://stackoverflow.com/a/29819987
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/47766419
has comment: http://stackoverflow.com/comment/47766465
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47766892
has comment: http://stackoverflow.com/comment/47766384
has body: I have an app where I want to display different RSS feeds on one page, when the corresponding team is clicked. For example, when I click "Aberdeen" I want the page to show the RSS for Aberdeen. When I click "Celtic", i want the same page to display the RSS for Celtic. I will attach my code in one section - basically when the page #feed loads, I need to run the getFeed() function. I am using jQuery Mobile. HTML for "feed" page Header Add to My Teams Function to getFeed var feedURL="http://www.football365.com/arsenal/rss"; var n = 12; function getFeed(url, success, n){ url= feedURL.replace("??", n.toString()); if(window.navigator.onLine) { $.jGFeed(url, function(feeds) { // Check for errors if(!feeds){ // there was an error return; } else { localStorage.setItem(url, JSON.stringify(feeds)); success(feeds.title, feeds.entries); } },n ); } else { // Get the fall-back... var feed = JSON.parse(localStorage.getItem(url)); if(feed && feed.length > 0) { success(feed.title, feed.entries); } } } $(document).on('pagebeforeshow',function(){ getFeed(feedURL,function(title,items){ $("#title").text(title); for(var index=0; index<items.length; index+=1){ $("#list").append(formatItem(items[index])); } $("#list").listview('refresh'); },20); } ); Function to find RSS URL based on team function getIndex(teamlist, teamname){ for(var i = 0; i<teamlist.length; i++){ if(teamlist[i].teamname == teamname){ return i; // if found index will return } } return -1; // if not found -1 will return } var a = getIndex(teamlist,name); // will give a as 0 console.log(a); feedURL = teamlist[a].rss_url; console.log(feedURL); As you can see, the RSS URL for a specific team is found via index in array. Once it has found the array, it assigns it to the feedURL variable. This part works fine However, when the page opens, it does not take into consideration the change in variable. I need to refresh or rerun the getFeed() function to take into account the new value of feedURL. Hope this clears things up :) Thank…
has comment: http://stackoverflow.com/comment/47766244
has title: Run function on page load (Refresh RSS feed with new URL) Javascript
has comment: http://stackoverflow.com/comment/47766355
downvote count: 1
type: Question

http://stackoverflow.com/q/29739988
favorite count: 0
has answer: http://stackoverflow.com/a/29740135
has answer: http://stackoverflow.com/a/29740279
has comment: http://stackoverflow.com/comment/47613310
type: Question
has answer: http://stackoverflow.com/a/29740699
has comment: http://stackoverflow.com/comment/47613058
upvote count: 1
accepted answer: http://stackoverflow.com/a/29740699
tagged with: http://stackoverflow.com/tag/json
has title: i just want to calculate age with the help of DOB
answer count: 4
tagged with: javascript
has answer: http://stackoverflow.com/a/29740103
has body: i am getting DOB from json var date=data.dob; by using this ` var today = new Date(86400000); var date=data.dob; var timeDiff = Math.abs(today - date); rangeOneMin1 = parseInt(timeDiff); var age1 = Math.ceil(rangeOneMin1 / (1000 * 3600 * 24)) / 365; by applying above code in age1 i'am getting NaN please help please let me know if you want something more
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47613084
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/29740103

http://stackoverflow.com/comment/47558269
type: Comment
type: QuestionComment
has text: https://jsfiddle.net/wgL6unL5/
comment on: http://stackoverflow.com/q/29711108
score: 0

http://stackoverflow.com/q/29688447
has comment: http://stackoverflow.com/comment/47514115
tagged with: security
has answer: http://stackoverflow.com/a/29688507
accepted answer: http://stackoverflow.com/a/29688507
has comment: http://stackoverflow.com/comment/47514335
has comment: http://stackoverflow.com/comment/79688185
has comment: http://stackoverflow.com/comment/47513961
has answer: http://stackoverflow.com/a/46361296
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/46361296
tagged with: authentication
type: Question
has body: What is the challenge/response method to securely authenticate with a Server without HTTPS (without sending out password)? I have an app (Javascript client) that connects over CORS (authenticate) to our backend which in turns will return a token containing the claim (JWT) over non-HTTPS. The REST is stateless so we do token-based and not have session at all. When the client gets that token, (containing claim) it is added to the header for each request of the client and therefore the backend knows which User Id is doing that request and do the appropriate thing. So far this works for us. My concern is with the authentication process and with the security of each request. To authenticate the clients sends out email and hashed password pair, however I want to know if there's a more secure way even without using HTTPS for now. I've read to not send the password but do a challenge/response, but what is the implementation of that idea? And last question would be, even if we get around with the authentication process securely, how about on each request which contains the token with claim can it be secured also?
has comment: http://stackoverflow.com/comment/47514172
has title: What is the challenge/response method to securely authenticate with a Server without HTTPS (without sending out password)?
has comment: http://stackoverflow.com/comment/47514618
has comment: http://stackoverflow.com/comment/47513982
has comment: http://stackoverflow.com/comment/48623284
score: 0
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/47583525

http://stackoverflow.com/q/29698779
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/29698846
has title: Get path of element in object without looping through all elements (second hierachy level unkown)
type: AnsweredQuestion
tagged with: loops
accepted answer: http://stackoverflow.com/a/29698846
type: Question
has body: I have the following object: var oBadge = { COMMENT_CREATED: { FIRST_COMMENT_CREATED: { code: "FIRST_COMMENT_CREATED", src: "", name: "Socializer", text: "Create a comment for an idea", condition: { today: null, over_all: 1 } } } }; i need to check if a string i get (for example "FIRST_COMMENT_CREATED") is contained in the oBadge model. The object contains more elements - not only the comment_created element. Therefore i cannot define to check it there. I found the following function to determine wether the element is contained within the object or not, but I also need the contained data, not only the statement whether it is contained or not. oBadge.hasOwnProperty("FIRST_COMMENT_CREATED") What i'm basically looking for is a way to skip the second hierachy level on my check - like: if(oBadge.[&lt;all&gt;]["FIRST_COMMENT_CREATED"] !== undefined) { // return data }
tagged with: object
possible better answer: http://stackoverflow.com/a/29698930
has answer: http://stackoverflow.com/a/29698930
score: 0

http://stackoverflow.com/comment/47636450
score: 0
type: Comment
type: QuestionComment
has text: I don't see any problem in the demo with expanding of subgrids after the first load. I tested it in IE10/IE11/Chrome/Firefox. Which web browser you use in your tests? Could you describe the exact test case which can be used to reproduce the problem which you reported in the JSFiddle demo.
comment on: http://stackoverflow.com/q/29740372

http://stackoverflow.com/q/29816584
tagged with: sdk
has body: I am using a SDK (Finger Print SDK) which is used to integrate finger print scanner with my application. The application is working fine in my local server environment but not on the web server.The application uses activeX which i have already enabled. When ever i am trying to run the SDK it gives an error Object doesn't support property or method 'Initialize'.I did some r &amp; d and reset my IE settings to default but it didn't work. So what i am doing wrong?
favorite count: 0
has comment: http://stackoverflow.com/comment/47760286
answer count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47761527
tagged with: php
has comment: http://stackoverflow.com/comment/47761532
score: 2
has title: Object doesn't support property or method
tagged with: activex
type: Question
tagged with: fingerprint
has comment: http://stackoverflow.com/comment/47807996
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47697460
type: Comment
comment on: http://stackoverflow.com/a/29783387
has text: As I said in my answer it's most likely a comparison of value vs reference issue. Try using the .Equals method and see if it still gives you issues. Other than that place a break point and see what the value of Read is when it is compared to whatever.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47619799
has text: I did not mean `document.load`... I mean `document.ready()`! Have updated my own answer to clarify these options.
type: Comment
comment on: http://stackoverflow.com/a/29743433
score: 0
type: AnswerComment

http://stackoverflow.com/a/29842725
has body: Basically, I created 2 loops, 1 will go over all the elements and the second is to go over all the other elements so we can compare positions. Use this code: var arr = document.getElementsByTagName('img'); for(i=0; i&lt;arr.length; i++) { console.log(arr[i]); for(j=0; j&lt;arr.length-1; j++) { if((arr[i].offsetTop == arr[j].offsetTop) &amp;&amp; (arr[i].offsetLeft == arr[j].offsetLeft)) { alert('top: ' + arr[i].offsetTop + ' left: ' + arr[j].offsetLeft); } } }
has comment: http://stackoverflow.com/comment/47811580
upvote count: 2
has comment: http://stackoverflow.com/comment/47822377
answers question: http://stackoverflow.com/q/29842462
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47822794
has comment: http://stackoverflow.com/comment/47811556

http://stackoverflow.com/a/29785019
has body: Is this an implementation issue? Is there another inheritance pattern that will work? No, this behaviour is correct as by the spec. The Set methods must be invoked on actual sets (objects initialised with set-specific internal slots), and are not generic as the Array methods (which basically work on everything that has a .length property). As the spec states: The Set constructor is designed to be subclassable. It may be used as the value in an extends clause of a class definition. Subclass constructors that intend to inherit the specified Set behaviour must include a super call to the Set constructor to create and initialize the subclass instance with the internal state necessary to support the Set.prototype built-in methods. So you will have to use ES6 class syntax to inherit from the built-ins. class MySet extends Set {} // default constructor has super() call var mySet = new MySet(); mySet.add(1); Whether this subclassing is supported depends on the implementation, not all runtimes and transpilers are ES6-compliant yet.
upvote count: 4
has comment: http://stackoverflow.com/comment/75371035
downvote count: 0
has comment: http://stackoverflow.com/comment/75385484
score: 4
answers question: http://stackoverflow.com/q/29782259
type: Answer

http://stackoverflow.com/comment/47817096
comment on: http://stackoverflow.com/a/29845262
type: AnswerComment
has text: So you can rate my answer if you think it's helpful :) I hope I correctly understood your question. You can use pure JS ... not a big deal to avoid using jQuery ... it just make the code simplier.
score: 0
type: Comment

http://stackoverflow.com/comment/47780860
comment on: http://stackoverflow.com/a/29827022
type: Comment
score: 0
type: AnswerComment
has text: Effect is different than using "slide" inside show(). In my animation img not show whole of them immediately but appear as for the wall.

http://stackoverflow.com/q/29794424
tagged with: processing.js
has answer: http://stackoverflow.com/a/29803161
type: Question
has comment: http://stackoverflow.com/comment/47736734
has comment: http://stackoverflow.com/comment/47734206
tagged with: processing
has comment: http://stackoverflow.com/comment/47721628
tagged with: javascript
has comment: http://stackoverflow.com/comment/47724187
score: 0
has comment: http://stackoverflow.com/comment/47734133
tagged with: canvas
answer count: 1
has title: Processing JS over the top of a HTML element?
accepted answer: http://stackoverflow.com/a/29803161
favorite count: 0
upvote count: 2
has body: I am currently using Processing JS with the HTML canvas element on a website. The intention is to have the Processing JS run over the top of the HTML elements on the page. The site is [usandthings.com][1] (it should be pretty obvious what I'm trying to do by looking at the site - rub away black to reveal a white background, showing the html text). HOWEVER as you can see it is very slow - it works smoothly when it is not over any html, however when you drag it over the text, it is very slow and doesn't really work. Is there anyway I can get around this? Edited - this is the most simple way of showing what I mean: Us and Things TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE TEXT HERE
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47732300
downvote count: 2

http://stackoverflow.com/comment/47609537
has text: It might be because the jQuery ` ` tags are included at the bottom of the ` ` of your page instead of inside the ` `. I tried to click on a picture on desktop _before_ the page finished loading and the lightbox didn’t open. When I _waited_ for the page to load it did open a lightbox.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29738160

http://stackoverflow.com/comment/47783188
has text: Could you add some code snippet showing how your factory is implemented?
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29826031
type: Comment

http://stackoverflow.com/q/29743923
answer count: 1
accepted answer: http://stackoverflow.com/a/29746157
downvote count: 0
favorite count: 0
type: AnsweredQuestion
score: 3
has title: How to normalize weighted list?
upvote count: 3
tagged with: weighted-average
has answer: http://stackoverflow.com/a/29746157
type: Question
tagged with: javascript
has body: I would like to weight a list of elements and select random element from the list. I have the following javascript, which do that: var generateWeighedList = function(list, weight) { var weighed_list = []; // Loop over weights for (var i = 0; i &lt; weight.length; i++) { var multiples = weight[i] * 100; // Loop over the list of items for (var j = 0; j &lt; multiples; j++) { weighed_list.push(list[i]); } } return weighed_list; }; var list = ['javascript', 'php', 'ruby', 'python']; var weight = [0.5, 0.2, 0.2, 0.1]; var weighed_list = generateWeighedList(list, weight); console.log(weighed_list.length); The User can give the weight as number between 1 and 100. The input will be something like this: var list = ['javascript', 'php', 'ruby', 'python']; var weight = [10, 50, 70, 90]; How to customize the Algorithmus, sothat the sum of the weight list at the end is 100 and every element has the right ratio to 100%?

http://stackoverflow.com/a/29757676
type: Answer
answers question: http://stackoverflow.com/q/29734937
score: 0
has body: Kind of a hack, but it seems to work. I don't like how it initiates two ajax requests. I suppose I could dynamically change the rules to remove the remote method from validator's rules, however, then I would need to manually add the message. Technically for my application, I don't need the message displayed, but am using return input.next().html(); to get the message as shown in https://jsfiddle.net/vctt9utd/. http://jsfiddle.net/msprwad5/ testit var validator = $("#myForm").validate({ rules: { myelement: { minlength: 2, maxlength: 4, required: true, remote: { url: "/echo/html/", type: "POST", data: { html: 0, delay: .5 } } } }, messages: { myelement: { remote: "error message" } } }); $('#testit').click(function () { if ($('#myelement').valid()) { $.post("/echo/html/", { html: 0, delay: .5 }, function (status) { if(!+status){alert('failed remote validation');} }); } else {alert('failed normal validation if first attempt, otherwise could be either.');} })

http://stackoverflow.com/comment/47759096
type: QuestionComment
type: Comment
score: 2
has text: But it's always the same object. Look: an artist wears a blue dress and gives you her address. Then she wears a red dress and gives you her address. She wears a pink dress and gives you her address. Then she asks you to come over (and doesn't change any more). You immediately go to the first address - what dress is she wearing there? Yellow. You go to the second address (but wait, it's the same address!) What dress? Still yellow. You go to the third one: still here, still yellow. What happened to the girl in red and the girl in blue? When you push the object, you aren't copying it.
comment on: http://stackoverflow.com/q/29815747

http://stackoverflow.com/q/29807346
has comment: http://stackoverflow.com/comment/47743988
has comment: http://stackoverflow.com/comment/47743846
tagged with: ajax
has title: Insert record into database using javascript, mysql, and php
accepted answer: http://stackoverflow.com/a/29808120
has comment: http://stackoverflow.com/comment/47744368
tagged with: mysqli
has comment: http://stackoverflow.com/comment/47743942
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47744967
has answer: http://stackoverflow.com/a/29808601
has comment: http://stackoverflow.com/comment/47744310
type: Question
has comment: http://stackoverflow.com/comment/47743438
answer count: 2
possible better answer: http://stackoverflow.com/a/29808601
has body: I have the following js function, which makes an ajax request, but it is not doing it for some reason. I checked alerting url and it displays it as it supposed to be, so all variables are declared. var request = new XMLHttpRequest(); var url = "ajax_js/q_ajax.php?q="+ques+ "&amp;ans="+ans+ "&amp;a="+inp[0].value+ "&amp;b="+inp[2].value+ "&amp;c="+inp[4].value+ "&amp;d="+inp[6].value+ "&amp;cor="+checked+ "&amp;def="+input+ "&amp;q_n="+q_name+ "&amp;c_id="+c_id; request.onreadystatechange=function (){ if(request.readyState==4 &amp;&amp; request.status==200){ alert(request.responseText); } request.open("GET", url, true); request.send(); } Here is the code from php file. &lt;?php require("db_conx.php"); $q = $_GET['q']; $ans = $_GET['ans']; $a = $_GET['a']; $b = $_GET['b']; $c = $_GET['c']; $d = $_GET['d']; $cor = $_GET['cor']; $def = $_GET['def']; $q_n = $_GET['q_n']; $c_id = $_GET['c_id']; $q = mysqli_escape_string($con, $q); $ans = mysqli_escape_string($con, $ans); $a = mysqli_escape_string($con, $a); $b = mysqli_escape_string($con, $b); $c = mysqli_escape_string($con, $c); $d = mysqli_escape_string($con, $d); $cor = mysqli_escape_string($con, $cor); $def = mysqli_escape_string($con, $def); $q_n = mysqli_escape_string($con, $q_n); $c_id = mysqli_escape_string($con, $c_id); /* Modify id for the system */ $query = mysqli_query($con, "INSERT INTO course_quiz (course_id, quiz_name, question, des_answer, ChoiceA, ChoiceB, ChoiceC, ChoiceD, correct, def) VALUES ('$c_id', '$q_n', '$q', '$ans', '$a', '$b', '$c', '$d', '$cor', '$def')"); echo('Question has been saved'); /* header('Location: ../instr_home.php'); */ I also have an another ajax call(works perfect) in the same page, which I think the reason of the problem. Variables for XMLHttpRequest are named different as well. Thank You in advance!
has answer: http://stackoverflow.com/a/29808120
tagged with: javascript
has comment: http://stackoverflow.com/comment/47744670
has comment: http://stackoverflow.com/comment/47743664
score: 0
has comment: http://stackoverflow.com/comment/47744192

drupal
type: Tag
tags question: http://stackoverflow.com/q/29822146
tag name: drupal

http://stackoverflow.com/comment/47659400
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29763905
has text: I'm not sending the request, the page himself does. I'm just writing a userscript for this page, so i cant do this.
score: 1

http://stackoverflow.com/comment/47574062
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29719739
has text: I**M**HO you should've waited for OP to respond to your comment.
type: AnswerComment

http://stackoverflow.com/q/29824503
type: Question
tagged with: javascript
tagged with: mocha.js
upvote count: 2
has body: In the document of http://zombie.js.org/, there is an example: browser.visit('/path', function() { assert(browser.location.href == 'http://example.com/path'); }); It does the assertion in the callback of browser.visit, is it the correct way? When I use mocha to run such a test, I found it always success, even if the assertion is failed. I searched the keyword browser.visit in the codebase of zombie, didn't find similar usage, instead, it does the assertion out of the visit, like: before(function(done) { browser.visit('/path', function() { done(); }); }); it("should do something", function() { assert(browser.location.href == 'http://example.com/path'); }); I'm not sure which is the correct way.
tagged with: zombiejs
favorite count: 0
has title: Can we do the assertion in the callback of `browser.visit` as the document shows?
answer count: 0
type: UnansweredQuestion
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47775293

http://stackoverflow.com/q/29698955
tagged with: javascript
score: 0
has body: I just read this: https://developers.facebook.com/docs/graph-api/reference/v2.3/event and it seems as if there is no data about the location of an event. Only a "Page" Attribute which in turn has a contact_address value. Now my question is: What about those events that don't belong to a place? They have addresses too in FB but there seems to be no way to get this data from the FB graph API. Or did I miss something? Does anybody know a workaround to get hold of this data? We wanna analyze a bunch of events and put them all on a map. but that won't work if we cannot get the address for the event..
answer count: 1
tagged with: facebook-graph-api
accepted answer: http://stackoverflow.com/a/29762045
tagged with: facebook
has answer: http://stackoverflow.com/a/29762045
has title: Facebook Graph Event query no address
type: Question
type: AnsweredQuestion

http://stackoverflow.com/a/29838051
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29837788
type: Answer
answers question: http://stackoverflow.com/q/29837788
downvote count: 0
has comment: http://stackoverflow.com/comment/47802745
score: 3
has comment: http://stackoverflow.com/comment/47804044
has body: The path of least resistance would be to use Sequelize and sqlite3 in your application. Start off by running npm install sequelize sqlite3. Then in your code var Sequelize = require( 'sequelize' ) var connection = Sequelize.connect( undefined, { dialect: 'sqlite', storage: __dirname + '/db.sqlite' }) Tada, you have a database connection syncing to a local sqlite DB. You'll likely need to consult the Sequelize documentation to use this connection. If, however, you wanted an API for your angular demo, json-server is what you're looking for.
upvote count: 3
has comment: http://stackoverflow.com/comment/47802623

http://stackoverflow.com/q/29802244
score: 2
upvote count: 2
type: Question
has body: I have pages that I have to print, but when I launch printing, the preview is ugly and I can't select and modify the elements I want (there's only few elements I want to print, and others that I hide only for the printing). I don't succeed to do it with less (with @media print), so I made a template and I inject inside it the elements I want to show for the printing (with AngularJS). The problem is that the original page is something like http://example.com/id/page-name/?tab=media. But I put in my script a listener which catch the print event and redirect the user on http://example.com/id/page-name/?tab=media&amp;print=true. Then a timeout launches the printing script (window.print()), and when the user leave the printing page, the script redirects him to http://example.com/id/page-name/?tab=media. The problem is that it makes a lot of closing/opening windows, and it may be uncomfortable for the user. I think my solution is weird and awkward, but I found nothing else to do it... So do you have a solution to print a distant page, which will not make a lot of closing/opening frames? For example, when I Ctrl+P on http://example.com/id/page-name/?tab=media, it prints the http://example.com/id/page-name/?tab=media&amp;print=true page, and not the original ? A thing like document.location.href="http://example.com/id/page-name/?tab=media&amp;print=true".print(); or print('http://example.com/id/page-name/?tab=media&amp;print=true'); ? I hope it's possible!
linked to: http://stackoverflow.com/q/29567205
tagged with: javascript
tagged with: printing
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has title: Print a distant page in JS, JQ, or Angular
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29802386

http://stackoverflow.com/q/29811543
has title: Input value not changing with user input
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47751064
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I'm working my way through the Odin Project, attempting to make the "etch-a-sketch" type website with jQuery. The idea is to have a div with a grid inside of it that when moused over, the grid squares change color. The user should also be able to input how many grid squares they want, so if they put 16 in the form, they'll get a 16x16 grid. I set an initial value to 16. When I input a different number and hit "go", the value just changes back to 16 and the grid remains the same. Where am I going wrong? Thanks! Relevant code is as follows: HTML: Enter the width in pixels: Reset JS: $('#setWidth').click(function () { $('.box').css("background-color", "#fff"); $('.box').remove(); var $divWidth = $('#formbox').val(); for (var i = 0; i < $divWidth; i++) { $('#canvas').append(' '); $('.divHolder').css("height", Math.floor(500 / $divWidth)); } for(var i = 0; i < $divWidth; i++) { $('.divHolder').append(' '); $('.box').css("width", Math.floor(500 / $divWidth)); $('.box').css("height", Math.floor(500 / $divWidth)); } });
has answer: http://stackoverflow.com/a/29811632
accepted answer: http://stackoverflow.com/a/29811632

http://stackoverflow.com/a/59547718
answers question: http://stackoverflow.com/q/29721205
score: 0
type: Answer
has body: Replace if (typeof obj === 'undefined') { return undefined;} // return undefined for undefined if (obj === 'null') { return null;} // null unchanged with if (obj === undefined) { return undefined;} // return undefined for undefined if (obj === null) { return null;} // null unchanged

http://stackoverflow.com/a/29809336
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29805800
has body: your code works for me under chrome. Just append the script tag to the head before the event registration. updated: tested on FireFox 37.0.2 Just paste the below content in the console of the standard development tool of FireFox. (function() { function performAction() { console.log("perform action called"); var $body = $("body"); $body.empty(); $body.append( $(' ').append( $('').text("I like to drive cars"), $(' ').html('the above vehicle will be replaced in 3 seconds!') ) ); setTimeout(function(){ var $iSentence = $("#jqHook i"); var iSentenceTXT = $iSentence.text(); var iSentenceTXT = iSentenceTXT.replace(/car/g, "motorbike"); $iSentence.fadeOut(function(){ $(this).html(iSentenceTXT).fadeIn(function(){ console.log('modification performed !'); }); }); },3000); }; var e = "1.6.4"; var t = false; var n = document.createElement("script"); n.src = "https://ajax.googleapis.com/ajax/libs/jquery/" + e + "/jquery.min.js"; document.getElementsByTagName("head")[0].appendChild(n); n.onload = n.onreadystatechange = function() { if (!t && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { performAction(); }; }; })();

http://stackoverflow.com/q/29714884
score: 5
downvote count: 1
upvote count: 6
accepted answer: http://stackoverflow.com/a/29715071
has title: Am I using ghcjs correctly?
type: AnsweredQuestion
has body: I'm quite new to Haskell and ghcjs. I'm starting with the very first "Hello, world!" program to learn. Here is my Haskell program, copied from GHCJS wiki: module Main where main = putStrLn "Hello world!" I use the command ghcjs -o hello hello.hs to compile it to javascript, and I tried to run it on my Terminal with the command node hello.jsexe/all.js, but when I tried to open the generated file "index.html": But when I open this in Chrome the page is blank. Does anyone know what's wrong here?
tagged with: haskell
type: Question
tagged with: ghcjs
tagged with: javascript
has answer: http://stackoverflow.com/a/29715071
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/47778360
type: Comment
comment on: http://stackoverflow.com/a/29814461
type: AnswerComment
has text: it works, but only for firefox/chrome browser, not IE11 ? I believe it clicked the image, but the image i have is suppose to fire event within that click.
score: 0

http://stackoverflow.com/q/29748991
has answer: http://stackoverflow.com/a/29749121
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47630233
accepted answer: http://stackoverflow.com/a/29749093
tagged with: jquery
has comment: http://stackoverflow.com/comment/47630260
has comment: http://stackoverflow.com/comment/47630688
has comment: http://stackoverflow.com/comment/47630855
has comment: http://stackoverflow.com/comment/47630347
has comment: http://stackoverflow.com/comment/47630298
has comment: http://stackoverflow.com/comment/47630355
has answer: http://stackoverflow.com/a/29749093
possible better answer: http://stackoverflow.com/a/29749396
has answer: http://stackoverflow.com/a/29749396
type: AnsweredQuestion
has body: I am wondering how to get the value of a input box by storing the id in a variable then fetching the value by that id variable. Here is what I have tried. &lt;script&gt; var c=$("#inp").val(); var temp = "i"+c; var obj = document.getElementById(temp).value; alert(obj); &lt;/script&gt; &lt;input type='text' class='form-control' value='$q6[$t2]' id='inp'&gt;/php is used/
has comment: http://stackoverflow.com/comment/47630334
has title: get value of input box by id stored in a variable?
has comment: http://stackoverflow.com/comment/47630580
type: Question
has comment: http://stackoverflow.com/comment/47630255
has comment: http://stackoverflow.com/comment/47630369
tagged with: javascript
has comment: http://stackoverflow.com/comment/47630206

http://stackoverflow.com/q/29775789
answer count: 1
tagged with: url
has comment: http://stackoverflow.com/comment/47682183
has comment: http://stackoverflow.com/comment/47681995
has answer: http://stackoverflow.com/a/29776837
accepted answer: http://stackoverflow.com/a/29776837
has comment: http://stackoverflow.com/comment/47682076
has comment: http://stackoverflow.com/comment/47682312
tagged with: ruby-on-rails
has body: Let's assume I have a Users controller with a returnjson action. Say I want to create an API so when the client calls on that method, it would return the user's data to the client. For example: https://www.example.com/returnjson?username&amp;password A get request would be made by JavaScript with that URL and than the rails would than return the user info in a JSON format. How would I got about doing this? Thanks in advance!
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
favorite count: 0
type: Question
has title: Basic API in Rails
tagged with: javascript
tagged with: api
upvote count: 1
has comment: http://stackoverflow.com/comment/47682478

http://stackoverflow.com/comment/47728336
comment on: http://stackoverflow.com/q/29799320
score: 0
has text: @zeroflagL please write an answer with a working example of your proposed solution.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29719618
answers question: http://stackoverflow.com/q/29719571
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/47573890
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29719571
has body: Match 2 spaces or 4+ spaces, with word boundaries around them: newstr = str.replace(/\b(\s\s|\s{4,})\b/g, ' '); \b matches word boundaries, that will keep \s\s from matching the two spaces inside a 3-character sequence. The g modifier makes it replace all the matches in the input string.
upvote count: 3

http://stackoverflow.com/q/29692843
accepted answer: http://stackoverflow.com/a/29692858
tagged with: css
type: AnsweredQuestion
upvote count: 2
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29692858
has body: I have a parent element: .product-container Then, inside it, I have a &lt;p&gt; element, which is styled in css via: .product-container p Now, I need to apply some style to this &lt;p&gt;, when .product-container is hovered. But this does not work: .product-container:hover .product-container p So, is there a way to target this &lt;p&gt; on parent hover via css, without applying class or id to the &lt;p&gt;?
score: 2
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has title: Target tag inside parent on hover
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47750219
type: QuestionComment
has text: Okay, now that helped a bit. The only thing that is wrong is that I need to be able to append this function to each of the options so that they can do different things...as apposed to all triggering the same function. Is this possible? Thanks.
comment on: http://stackoverflow.com/q/29810975
type: Comment
score: 0

deferred
tags question: http://stackoverflow.com/q/29779683
tags question: http://stackoverflow.com/q/29826231
tags question: http://stackoverflow.com/q/29808394
tags question: http://stackoverflow.com/q/29713678
tags question: http://stackoverflow.com/q/29811418
tag name: deferred
type: Tag

http://stackoverflow.com/comment/47808757
type: Comment
comment on: http://stackoverflow.com/a/29841115
has text: @Loko. Edited my answer. This time the code checks if at all there is an input present in the page. You can also use `input.length` instead of `[0]` .
score: 0
type: AnswerComment

http://stackoverflow.com/q/29705135
has comment: http://stackoverflow.com/comment/47591727
linked to: http://stackoverflow.com/q/5827612
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29804224
score: 1
favorite count: 0
answer count: 2
tagged with: node-webkit
upvote count: 1
has body: I tried the below code in NW.js to read in all files with full path under a given folder but not working. What's wrong? Thanks. function chooseFiles() { var files = $('#fileDialog')[0].files; for (var i = 0; i &lt; files.length; ++i) { console.log(files[i].path); } } chooseFiles('#fileDialog'); &lt;input type="file" id="fileDialog" nwdirectory /&gt;
has title: node-webkit read full path of files from directory
tagged with: node.js
linked to: http://stackoverflow.com/q/29149553
accepted answer: http://stackoverflow.com/a/29804224
has comment: http://stackoverflow.com/comment/47564189
has comment: http://stackoverflow.com/comment/47601177
has comment: http://stackoverflow.com/comment/47572370
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29813457
has answer: http://stackoverflow.com/a/29813457
has comment: http://stackoverflow.com/comment/47601032

google-apps-script
tags question: http://stackoverflow.com/q/29696293
tags question: http://stackoverflow.com/q/29702104
tags question: http://stackoverflow.com/q/29834664
tags question: http://stackoverflow.com/q/29772171
tags question: http://stackoverflow.com/q/29798623
tags question: http://stackoverflow.com/q/29749029
tags question: http://stackoverflow.com/q/29796925
type: Tag
tag name: google-apps-script
tags question: http://stackoverflow.com/q/29783262
tags question: http://stackoverflow.com/q/29796483
tags question: http://stackoverflow.com/q/29769467
tags question: http://stackoverflow.com/q/29777714
tags question: http://stackoverflow.com/q/29711435
tags question: http://stackoverflow.com/q/29783551
tags question: http://stackoverflow.com/q/29795191
tags question: http://stackoverflow.com/q/29707600
tags question: http://stackoverflow.com/q/29760851
tags question: http://stackoverflow.com/q/29777164
tags question: http://stackoverflow.com/q/29823403
tags question: http://stackoverflow.com/q/29784096

http://stackoverflow.com/comment/47770581
type: QuestionComment
has text: what `obj` in `obj.select2();`, can't it be `$(this).select2();`?
score: 2
comment on: http://stackoverflow.com/q/29822183
type: Comment

http://stackoverflow.com/comment/47657779
type: AnswerComment
has text: You can, you just need to actually have the variable in the ruby, instead of the javascript ;) or post to the ruby from the javascript after you get the value.
type: Comment
comment on: http://stackoverflow.com/a/29763020
score: 0

http://stackoverflow.com/q/29772811
tagged with: javascript
tagged with: jquery
has body: I am trying to take some JSON and fill the options of dropdown menu.I am using Materialize a front end css framework which I think may be the root of the problem here. I say this because if I do it with the default browser dropdown it works exactly as I expect, but not with their (Materialize's) dropdown. I do have to init the dropdown when the page loads, so maybe the solution is I have to re-init it, but I do not know how to do that. This is the html where the form is: Select Indicator Indicators Search Targets Name Score {{item.Name}} {{item.Country}} This is all of the JS I have, including the initialization of the dropdown @ the bottom: (function($){ angular.module('myapp', []) .controller('MainCtrl', function($scope, $http) { var records; $scope.selCountry = ''; $scope.searchText = ''; $http.get('http://www.w3schools.com/angular/customers.php').success(function(dt) { //window.alert(angular.toJson(dt)); $scope.countries = []; $scope.records = dt.records; dt.records.forEach(function(o) { var c = o.Country; if ($scope.countries.indexOf(c) == -1) $scope.countries.push(c); }); $scope.total = $scope.countries.length; ready(); }); $scope.matches = 0; $scope.onChange = function(src) { if (src === 'txt') { $scope.selCountry = ''; $scope.search = $scope.searchText; } else { $scope.searchText = ''; $scope.search = $scope.selCountry; } search($scope.search); }; }); $(function(){ $('.button-collapse').sideNav(); }); // end of document ready $('.datepicker').pickadate({ selectMonths: true, // Creates a dropdown to control month selectYears: 15 // Creates a dropdown of 15 years to control year }); $(document).ready(function(){ $('ul.tabs').tabs('select_tab', 'tab_id'); $('select').material_select(); }); })(jQuery); // end of jQuery name space If the solution is to re-initialize the dropdown after the JSON is pulled, I am not sure how to do so.
favorite count: 0
possible better answer: http://stackoverflow.com/a/29773040
has answer: http://stackoverflow.com/a/29773040
type: Question
has comment: http://stackoverflow.com/comment/47676152
has title: Dropdown options not populating with JSON
upvote count: 2
has answer: http://stackoverflow.com/a/29772982
answer count: 2
accepted answer: http://stackoverflow.com/a/29772982
has comment: http://stackoverflow.com/comment/47676039
tagged with: http://stackoverflow.com/tag/json
score: 2
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/47557906
has text: well, that will stop cors, but the problem is "lower" than that, if you correct the forbidden, then cors will probably work. if you can't do OPTIONs, then you can only do a small subset of cors requests, to a php page.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29710266

http://stackoverflow.com/a/29762429
upvote count: 2
has comment: http://stackoverflow.com/comment/47656818
has body: Assuming that you are running your JavaScript once the DOM is loaded, you should just have to replace cell.src with this.src. var cells = document.getElementsByClassName("PieceImg"); for(var j = 0; j&lt;cells.length;j++) { var cell = cells[j]; cell.addEventListener("click", function() { // Replace cell. with this. this.src="Directory/RedPiece.png"; alert('Test'); }) } The reason is simple: every time you loop, you create a variable called "cell" (var cell = cells[j];). This non-global variable is overwritten every time the loop is run. If you are running this code inside of a function, your cell variable will not even exist when it comes time to change the src. It will be undefined. Note that making this variable global would result in cell being the last element by class name PieceImg, so that wouldn't work any better. However, if you use this instead, you will be referencing the "clicked" (remember addEventListener("click")) element when you click it, in this case your image. Thus you are able to change the src. Do a console.log of "this" inside your eventListener to see more things you can access. This gives a similar effect as adding the "click" handler inline: &lt;img src="fox.png" onclick="alert(this.src);" alt="Fox" /&gt; Let me know if that makes sense to you. Here's a fully function fiddle: https://jsfiddle.net/7se0vyf5/
accepted answer of: http://stackoverflow.com/q/29762362
has comment: http://stackoverflow.com/comment/47656693
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29762362
has comment: http://stackoverflow.com/comment/47689634
type: Answer
has comment: http://stackoverflow.com/comment/47692977
score: 2

http://stackoverflow.com/q/29784668
type: Question
tagged with: javascript
score: 0
answer count: 2
tagged with: meteor
tagged with: iron-router
type: UnansweredQuestion
has title: Routing Issue with Iron Router in Meteor
has body: Im getting the "waiting on local host" in Chrome and Firefox but doubt there is an issue with browsers with my laptop; the issue is with Iron Router. See my router.js: Router.configure({ layoutTemplate: 'layout', loadingTemplate: 'loading', notFoundTemplate: 'notFound', waitOn: function() { return Meteor.subscribe('jobs'); } }); Router.route('/', {name: 'jobsList'}); Router.route('/jobs/:_id/', { name: 'jobPage', data: function() { return Jobs.findOne(this.params._id); } }); // route to edit a job post Router.route('/jobs/:_id/edit/', { name: 'jobEdit', data: function() { return Jobs.findOne(this.params._id); } }); Router.route('/jobs/create', {name: 'jobCreate'}); var requireLogin = function() { if (! Meteor.user()) { if (Meteor.loggingIn()) { this.render(this.loadingTemplate); } else { this.render('accessDenied'); } } else { this.next(); } } Router.onBeforeAction('dataNotFound', {only: 'jobPage'}); Router.onBeforeAction(requireLogin, {only: 'jobCreate'}); Going to /jobs/sgjdhdbhbbd the page does not load, but if I change Router.route('/jobs/:_id/', { to Router.route('/:_id/', {, the page loads. I am lost. Are there any tweaks to try? ********EDIT******** I am also using Polymer if that helps.
has answer: http://stackoverflow.com/a/29816150
has answer: http://stackoverflow.com/a/29784999

http://stackoverflow.com/comment/47550175
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29692511
type: Comment
has text: @ClintonVlasak Unfortunately you messed the things now even more. Tomorrow I'll check it again as it is late now here in Europe and I need some rest. Please be patient until then.

http://stackoverflow.com/comment/47806036
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29838631
type: Comment
has text: Not sure here due to my lack of experience how to write correct HTML/CSS to handle this screen orientation change case, I wish I did. If you have a link that covers this specific case I'd love to know, and probably others on SO; and thanks for your help and for letting me know there's a different more elegant way. I'm an old guy, 55, and I don't work in a company setting -- when I did this for a living I learned a lot more much more quickly when I had coworkers as resources. Thanks again.

http://stackoverflow.com/q/29788382
tagged with: word-wrap
has answer: http://stackoverflow.com/a/29791668
has answer: http://stackoverflow.com/a/29800663
tagged with: categories
type: Question
answer count: 2
has body: I am facing an issue in Highchart with the category labels, i.e. the first category label of the chart is not wrapping and is overlapping with the second label, whereas rest labels are appearing fine. I have made a demo on jsFiddle, which can explain better : jsFiddle Demo. My code is as follows: HTML code: JavaScript code: $(function () { $('#chartContainer').highcharts( { plotOptions: { }, drilldown: { series: [ { id: 'Drilldown_749_6', index: 0, name: 'Y-Axis Label', data: [ { name: 'Abc def ghi jkl mno pqr stu vwx yx 123 456 789 0', y: 90000 }, { name: 'Abc def ghi jkl mno pqr stu vwx yx 123 456 789 0', y: 710000 }, { name: 'Abc def ghi jkl mno pqr stu vwx yx 123 456 789 0', y: null }, { name: 'Abc def ghi jkl mno pqr stu vwx yx 123 456 789 0', y: 1740000 }, { name: 'Abc def ghi jkl mno pqr stu vwx yx 123 456 789 0', y: 800000 }, { name: 'Abc def ghi jkl mno pqr stu vwx yx 123 456 789 0', y: 800000 }] } ], drillUpButton: { position: { y: -3, x: -30 }, relativeTo: 'spacingBox' } }, series: [ { id: 749, index: 0, visible: true, name: 'Y-Axis Label', data: [ { drilldown: 'Drilldown_749_6', name: 'Abc def ghi jkl mno pqr stu vwx yx 123 456 789 0', y: 4140000 }] } ], yAxis: [ { title: { text: ' Y-Axis Label ', useHTML: true }, max: 4140000, opposite: false, gridLineWidth: 1 }], title: { text: ' sdf ', useHTML: true }, credits: { enabled: false }, chart: { renderTo: 'chartContainer', events: { drilldown: function () { $('#chartContainer').highcharts().reflow(); }, drillup: function () { } }, type: 'line' }, xAxis: { title: { text: 'Category Axis Label', margin: 30 }, labels: { autoRotation: [-20, -40, -80], padding: 10 }, categories: true, gridLineWidth: 1 }, exporting: { enabled: true }, lang: { drillUpText: ' ◁ Back ' }, tooltip: { pointFormatter: function () { var s = '● '+this.series.name+': '+this.y+''; if(typeof this.seriesSettings != "undefined" && typeof this.seriesSettings.tooltipText != "undefined" && this.seriesSettings.tooltipText != "") s = s + ' ['+this.…
has title: Highchart first category label is not wrapping
tagged with: highcharts
tagged with: javascript
tagged with: label
score: 0
type: UnansweredQuestion

http://stackoverflow.com/a/29801329
has comment: http://stackoverflow.com/comment/47731061
accepted answer of: http://stackoverflow.com/q/29801186
score: 0
type: AcceptedAnswer
has body: That's because in your onload callback of the xhr request, you're setting both the get and set elements with the same response text, which is why one paragraph appears twice. Create two different XMLHttpRequest objects and have different onload handlers. Or if you're using jQuery, why not look into the jQuery load method? $("#get").load("Share.html"); $("#set").load("Network.html");
answers question: http://stackoverflow.com/q/29801186
type: Answer

http://stackoverflow.com/q/29779683
has comment: http://stackoverflow.com/comment/47692585
has title: Element Array Access within a Deferred Object
type: Question
tagged with: arrays
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47693418
has comment: http://stackoverflow.com/comment/47690354
score: 0
has comment: http://stackoverflow.com/comment/47692992
tagged with: sql
has body: How would I access the values of 'timestamp' and 'usage' in the following example, function executeReadingsQuery(query, postQueryProcessing) { var d = new $.Deferred(); var processing = function(tx, results) { var result = []; var len = results.rows.length; for ( var i = 0; i &lt; len; i++) { result.push({ "timestamp" : moment(results.rows.item(i).timeStamp), "usage" : results.rows.item(i).usage }); } if (postQueryProcessing) { result = postQueryProcessing(result); } d.resolve(result); }; executeQuery(query, processing); return d; } A function that builds a query string will subsequently call the above function, function getReadingsInternal(noOfReadings, postQueryProcessing) { var query = "SELECT * from usage ORDER BY timestamp DESC limit " + noOfReadings.toString(); return executeReadingsQuery(query, postQueryProcessing); } And then there is another function that exposes the entire functionality globally, getReadings : function(noOfReadings) { return getReadingsInternal(noOfReadings); } The original function (the first one listed) is within a Variable called WNDatabase So I can access the function with a call that looks like this WNDatabase.getReadings(30) But I would like to be able to also globally access the values of timestamp and usage which populate the result[] array of the deferred object. It seems that it is not possible to do something like this $.when(WNDatabase.getReadings(30)).done(function() { for(var i=0; i&lt;7; i++){ console.log(this[i].usage); } }); So what would one do in this event?
tagged with: deferred
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/47798882
has text: I'm not seeing the loop and you shouldn't use closest('tr') because the button and select are both in the same level and you can use .siblings() instead
score: 0
comment on: http://stackoverflow.com/q/29835709
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47629681
comment on: http://stackoverflow.com/a/29748213
score: 1
has text: This doesn't retain other classes, e.g. "someClass2".
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47530899
comment on: http://stackoverflow.com/q/29697268
score: 0
type: Comment
type: QuestionComment
has text: @T.J.Crowder That sounds about right. Could recommend the following link to the OP: http://stackoverflow.com/questions/518000/is-javascript-a-pass-by-reference-or-pass-by-value-language

http://stackoverflow.com/comment/47580242
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29722215
has text: If none of the answer here are what you need, take a look at [this](http://abandon.ie/notebook/simple-file-uploads-using-jquery-ajax)

http://stackoverflow.com/comment/47587569
score: 4
comment on: http://stackoverflow.com/a/29726835
type: Comment
has text: If you don't see anything wrong, how is this a solution? It should be a comment.
type: AnswerComment

http://stackoverflow.com/q/29723134
upvote count: 18
downvote count: 1
type: Question
tagged with: google-maps
tagged with: javascript
has answer: http://stackoverflow.com/a/29723636
tagged with: google-maps-api-3
tagged with: google-maps-markers
answer count: 1
favorite count: 0
score: 17
has body: I am trying to place a marker into Google Maps using its PlaceID. I have the map working and displaying and can also add markers (using Lattitude and Longitude) into it. The code below is what I am using to try and make the marker display using its placeID however it is not displaying. function addPlaces(){ var marker = new google.maps.Marker({ place: new google.maps.Place('ChIJN1t_tDeuEmsRUsoyG83frY4'), map: map }); } This function is called after the map has loaded. google.maps.event.addDomListener(window, "load", addPlaces);
accepted answer: http://stackoverflow.com/a/29723636
type: AnsweredQuestion
tagged with: google-map-place
has title: Google Map add marker using place ID

http://stackoverflow.com/a/29807865
has comment: http://stackoverflow.com/comment/47744295
answers question: http://stackoverflow.com/q/29807791
has body: Try this to make the div scrollable: &lt;div style="overflow:auto;"&gt; Code taken from this question and answer link
score: 0
type: Answer

http://stackoverflow.com/a/29712894
answers question: http://stackoverflow.com/q/29712197
type: Answer
score: 0
has body: You need to install socket.io. Run in terminal: npm install socket.io

http://stackoverflow.com/comment/47778321
comment on: http://stackoverflow.com/q/29825678
type: Comment
type: QuestionComment
has text: @alexchenco: Can you post the compiled es5 files maybe? That'll let us track the mistake down.
score: 3

http://stackoverflow.com/comment/47787309
type: Comment
type: QuestionComment
has text: `var totalHand = (totalHand + handC);` I don't think you defined totalhand before using it
comment on: http://stackoverflow.com/q/29830254
score: 0

http://stackoverflow.com/comment/47656978
type: QuestionComment
has text: Material color i.e color of the line which I have created for highlighting the path
comment on: http://stackoverflow.com/q/29713556
score: 0
type: Comment

http://stackoverflow.com/comment/47527623
type: QuestionComment
score: 0
has text: As the current answers are only accounting for the simplest case, I have added something to explain my previous comment. Enjoy.
comment on: http://stackoverflow.com/q/29695073
type: Comment

http://stackoverflow.com/comment/47626171
comment on: http://stackoverflow.com/q/29746917
has text: @ Jamie Calver besides you problem you should use `if else`.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47780606
has text: Before your table.search, can console.log(this.value) and confirm it's recognizing the value correctly?
comment on: http://stackoverflow.com/q/29825455
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29833776
has comment: http://stackoverflow.com/comment/47794504
has comment: http://stackoverflow.com/comment/47794459
type: UnansweredQuestion
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/29833942
has body: I have question on if/else condition , my database has saved region id 5657 that i am using to implement if/else conditions. 1- is it bad practice to use id ? 2- what is right way to implement if/else condition in this case ? ctrl.js if( geoLocation.items ) { $.each(geoLocation.parent(), function( index, location ) { if( location.id === 5657 ) { var disableItemId = 'disabled' + location.id; // Get the model var model = $parse( disableItemId ); // Assigns a value to it model.assign( $scope, false ); } }); $.each( geoLocation.items, function( index, location ) { var disableItemId = 'disabled' + location.id; // Get the model var model = $parse( disableItemId ); // Assigns a value to it model.assign( $scope, false ); }); }
has comment: http://stackoverflow.com/comment/47794456
tagged with: if-statement
has title: Is it bad practice to use id for if/else conditions?
has comment: http://stackoverflow.com/comment/47794409
type: Question
score: 0
has comment: http://stackoverflow.com/comment/47794681
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47794716
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47794287
has comment: http://stackoverflow.com/comment/47794767

http://stackoverflow.com/q/29791414
has answer: http://stackoverflow.com/a/31212506
tagged with: drop-down-menu
has comment: http://stackoverflow.com/comment/50299218
has body: This is a regular script to load the placeholder facility into your CKEditor: Second: I am trying to load pre-defined values into CKEditor's Placeholder modal. It should look somehow like this Screenshot which was asked here (http://ckeditor.com/forums/CKEditor-4-Add-Ons/Modifying-the-placeholder-plugin) Third: CKEditor Docs says about the Placeholder customization: You could, for example, customize the dialog window to show a drop-down list with pre-defined options that can be selected to fill the placeholder. Unfortunately nothing can be found in their reference/docs. I would like to know, what would be a "no-hack" (for instance by editing placeholder/plugin/config.js) approach to get a dropdown menu into the Placeholder Modal window. Any help is appreciated Thanks
favorite count: 0
has title: CKEditor: Placeholder with pre-defined values
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47756203
has comment: http://stackoverflow.com/comment/50426447
answer count: 4
has answer: http://stackoverflow.com/a/32649253
downvote count: 0
has comment: http://stackoverflow.com/comment/47724395
type: Question
score: 3
tagged with: placeholder
has answer: http://stackoverflow.com/a/39233595
tagged with: javascript
tagged with: ckeditor
has answer: http://stackoverflow.com/a/37985795
upvote count: 3

http://stackoverflow.com/a/29716677
answers question: http://stackoverflow.com/q/29713678
score: 0
type: Answer
has body: "alters some of custom attr to DOM element" is not an asynchronous action (like a timeout, ajax request, or user interaction). It will have been executed, and finished executing, when the loop is over. All the new attribute values can be observed from the second loop. You do not need promises here, just put your synchronous statements in the right order and they will be evaluated sequentially.

http://stackoverflow.com/a/29742510
has comment: http://stackoverflow.com/comment/47618063
downvote count: 2
upvote count: 1
score: -1
answers question: http://stackoverflow.com/q/29742463
has body: Yes you use server side validation to validate input also. Please tell me which field you want to validate on server.
type: Answer

http://stackoverflow.com/a/29711280
score: -1
upvote count: 0
has comment: http://stackoverflow.com/comment/102924946
type: Answer
answers question: http://stackoverflow.com/q/29704454
downvote count: 1
has body: 1.You can also write a python script that parses all the package.jsons of the subdirectories and then generate the master package.json file 2.or You can also write a python script that parses all the package.jsons of the subdirectories and then generate a shellscript where the mater package.json will call it in the "start".

http://stackoverflow.com/q/29837165
accepted answer: http://stackoverflow.com/a/29838160
type: AnsweredQuestion
tagged with: knockout.js
type: Question
tagged with: asp.net-mvc
answer count: 1
tagged with: javascript
has title: How to data bind to a list of objects with knockout?
has answer: http://stackoverflow.com/a/29838160
score: 0
has body: Here is my view model. Server side: public class ShoppingListModel { public string Name { get; set; } public List<ItemModel> Items{ get; set; } public ShoppingListModel() { Items=new List<ItemModel>(); } } On the client side, I use knockout.mapping. ShoppingListModel = function(data) { var vm = ko.mapping.fromJSON(data); return vm; }; To bind the server-side model to the client-side model: @{ var jsonSerializerSettings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }; var data = new JavaScriptSerializer().Serialize(JsonConvert.SerializeObject(Model, jsonSerializerSettings)); } @section scripts { } The code above: use JSON.NET to serialize the server-side Model into a camel cased json. build the client-side view model. ko.applyBinding() Now I want to take advantage of the two-way binding. First I tested on the Name: @Html.HiddenFor(model => model.Name, new { @data_bind="value:name"}) It went well, I was able to edit the Name value on a text input and persist the value into the hidden input. The updated value could reach the POST action when the form is submitted. Now the question: how to implement the binding on the list? My test is to remove one item from the 'Items' list: @Html.HiddenFor(model => model.Items, new { data_bind = "value: items" }) A console.log() tells me that the client-side model has been updated, but this time, the binding on the HiddenFor has never worked! When the form is submitted, Items is always null. I guess it is reasonable because in Html: we are expecting the value of an input to be a simple value. I was thinking about loop through the list and data-bind from there. But it is also difficult. The knockout foreach is on tbody tag while a C# foreach is placed around tr (inside tbody). Then what is the correct way to bind the list? Here is my solution based on Fabio's suggestion: In the client-side ko model, add a computed value to bind the list into a json string. vm.itemsJson = ko.computed(func…
tagged with: knockout-mapping-plugin

http://stackoverflow.com/q/29695073
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47526358
answer count: 3
has title: Target previous element with jQuery
has answer: http://stackoverflow.com/a/29695154
downvote count: 1
has comment: http://stackoverflow.com/comment/47526718
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/29695154
accepted answer: http://stackoverflow.com/a/29695219
has comment: http://stackoverflow.com/comment/47526386
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47527623
has answer: http://stackoverflow.com/a/29695219
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29695793
upvote count: 0
has body: I'm creating portfolio section where every portfolio item shows as an image and every portfolio item has its own div which is hidden and contains more information about that item. When the user clicks on some portfolio item (image) div with more information for that item is shown. Each div with more info has two classes, portf-[nid] and portf ([nid] is Node ID, I work in Drupal and this class with [nid] helps me to target portfolio item with more info div for that item). Each of the more info divs contains arrows for item listing (next and previous) and I need to get them function, so when the user clicks on previous I need to hide current and show the previous item if it exists(when clicks on next to hide current and show next item if it exists). My markup looks like: &lt;div class="portf-3 portf"&gt; //some elements &lt;/div&gt; &lt;div class="portf-6 portf"&gt; //some elements &lt;/div&gt; &lt;div class="portf-7 portf"&gt; //some elements &lt;/div&gt; My question is how to hide the div I'm currently on and show the previous (or next). For example: if it is currently shown div with class portf-6 and user clicks on previous arrow, this div is being hidden and div with class portf-3 is being shown. It's not the problem to hide/show the div but how to check if there is the div above/below the current div and to target that div above or below the current div?
type: Question

http://stackoverflow.com/q/29762515
tagged with: appendchild
tagged with: javascript
has answer: http://stackoverflow.com/a/29762531
score: 0
answer count: 2
has title: appending child div to its parent dynamically in the constructor
has body: I'm having issues using appendchild() to append a div within a div. If possible, I would like to avoid using jquery.I'm using constructor functions for both the parent and child divs. &lt;script&gt; var loopi = 0; function codeDiv(){ codeDiv1 = document.createElement("div"); codeDiv1.style.height = "100px"; codeDiv1.style.width = "200px"; codeDiv1.style.border = "thick solid black"; } function functionObject(){ var functionDivObject = document.createElement("div"); functionDivObject.style.width = "500px"; functionDivObject.style.height = "500px"; functionDivObject.style.border = "thick solid black"; document.body.appendChild(functionDivObject); var codeDiv1 = new codeDiv(); functionDivObject.appendChild(codeDiv1); //I am having the problem here functionDivObject.id = "functionDiv"+loopi; loopi++; } loopi = 0; var temp = new functionObject(); &lt;/script&gt;
has answer: http://stackoverflow.com/a/29763111
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29762531
possible better answer: http://stackoverflow.com/a/29763111
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/29692554
possible better answer: http://stackoverflow.com/a/29692617
accepted answer: http://stackoverflow.com/a/29692896
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47521690
has answer: http://stackoverflow.com/a/29692617
has comment: http://stackoverflow.com/comment/47521845
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47521907
has body: I am newbie with javascript and jquery and i am facing a problem in json parsing with jquery. I am using open weather simplest API for fetching the weather information but nothing is happening. If i hardcode the json in any file or in my script it works fine but as soon as i use URL of API it stop showing result. here is my complete code: Get JSON data
has answer: http://stackoverflow.com/a/29692896
has title: Getting Json Response from an API using javascript/jquery
has comment: http://stackoverflow.com/comment/47521708
has comment: http://stackoverflow.com/comment/47521693
score: 0
type: Question
has comment: http://stackoverflow.com/comment/47522051
type: AnsweredQuestion

http://stackoverflow.com/a/29775420
downvote count: 0
answers question: http://stackoverflow.com/q/29771581
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47685159
has body: A simple method would be to create a policy for each access level. policies/level01.js policies/level02.js ect . . . your policy file will check their session/token to make sure they meet the criteria of that policy. policies/level01.js module.exports = function(req,res,next){ if(req.session.accessLevel = 1) return next(); return res.forbidden(); } Then in your config module.exports.policies = { UserController: { "create": ['policyXX.js'], "list": ['policyXX.js'], "show": ['policyXX.js'], }, AuthController: { '*': true, }}; Start with something like this that can familiarize with out these policies work and build up from there. It is always very important to know and understand exactly how your security works.
has comment: http://stackoverflow.com/comment/47682104
score: 1

http://stackoverflow.com/q/29752484
possible better answer: http://stackoverflow.com/a/29752545
favorite count: 0
has comment: http://stackoverflow.com/comment/47637195
has answer: http://stackoverflow.com/a/29752545
tagged with: time
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29752684
has body: I have these 2 console logs, but they return different times (-2 hours off). console.log(new Date()) // Date 2015-04-20T15:37:23.000Z console.log(Date()) // "Mon Apr 20 2015 17:37:23 GMT+0200 (CEST)" I know using Data() is the same as using the constructor and calling .toString(). However, i do need the Date() time and not the new Date() time. So why is it returning the wrong time and how can i reset it to output the correct one? thx,
type: Question
tagged with: javascript
tagged with: date
score: 4
has title: new Date() vs Date() and why does it return a different time (-2 hours)?
upvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/29752684
downvote count: 0

http://stackoverflow.com/comment/47632771
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29750209
has text: instead of `event.preventDefault();` try `return false` because yu need to avoid event propagation as well.

http://stackoverflow.com/q/29792208
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29792728
has comment: http://stackoverflow.com/comment/47713264
score: 1
has answer: http://stackoverflow.com/a/29792728
tagged with: image
has comment: http://stackoverflow.com/comment/47713128
answer count: 2
has comment: http://stackoverflow.com/comment/47713221
has title: Add an image id by finding the image alt
downvote count: 0
has answer: http://stackoverflow.com/a/29792328
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47713089
accepted answer: http://stackoverflow.com/a/29792328
has body: There is an image without an id on a page that I can't manually access to change the html. I'd like to be able to add an id value in a javascript file that I do have access to. I found this thread: Finding An image tag using the alt text And this one: Replace image and image title/alt text with Javascript And I've been trying a few variations to get it to work. Can someone show me where I'm going wrong? I'm currently using: $('img[alt="close_pop"]').attr('id','close'); I don't think I'm fully understanding, as this is what I thought it was doing: $('img[alt="close_pop"]') //getting the image based on the alt tag using jquery. .attr('id','close'); //then I was applying a new id to that image. All help appreciated!
linked to: http://stackoverflow.com/q/2914456
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47713066
linked to: http://stackoverflow.com/q/12003292
upvote count: 1
has comment: http://stackoverflow.com/comment/47713282

rails-routing
tags question: http://stackoverflow.com/q/29712189
type: Tag
tag name: rails-routing

http://stackoverflow.com/comment/47694622
type: Comment
has text: @Redrif how the Ajax post should be looks like?
score: 0
comment on: http://stackoverflow.com/a/29781592
type: AnswerComment

http://stackoverflow.com/q/29753438
tagged with: css
score: 0
has body: Hello I want to make a Menu thats pops out of the side when I click a button. I have it all set up with the CSS but the Javascript part doesn't work. I want to test if the width of menubarWrapper is equal to 300 then the width of the menubarWrapper needs to change to 0px and if it isn't equal to 300px than change it to 300px. I have the following JS: function menuBarToggle() { var menuWrapper = document.getElementById('menuWrapper'); if menuWrapper.width == 300 { menuWrapper.style.width = "0"; } else { menuWrapper.style.width = "300"; } } I also tried in the IF statement menuWrapper.style.width but that doesn't work also
answer count: 3
has comment: http://stackoverflow.com/comment/47639018
has title: JS, CSS Menubar Toggle
has answer: http://stackoverflow.com/a/29753804
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29753476
has answer: http://stackoverflow.com/a/29753476
has comment: http://stackoverflow.com/comment/47639337
type: Question
type: AnsweredQuestion
tagged with: menubar
has answer: http://stackoverflow.com/a/29753734
accepted answer: http://stackoverflow.com/a/29753804

http://stackoverflow.com/q/29838642
type: AnsweredQuestion
score: -2
has comment: http://stackoverflow.com/comment/47803753
has comment: http://stackoverflow.com/comment/47803659
has answer: http://stackoverflow.com/a/29840355
accepted answer: http://stackoverflow.com/a/29840355
type: Question
has comment: http://stackoverflow.com/comment/47806129
answer count: 2
downvote count: 2
linked to: http://stackoverflow.com/q/4892221
has comment: http://stackoverflow.com/comment/47807013
has comment: http://stackoverflow.com/comment/47803803
has comment: http://stackoverflow.com/comment/47803660
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/29840392
has body: function myFunc() { omaps: function tes() { return this.parent.x + this.parent.y; } } var myobj = { x: 1, y: 2, z: myFunc() } window.alert(myobj.z); return undefined function myFunc() { omaps: function tes() { return myobj.x + myobj.y; } } var myobj = { x: 1, y: 2, z: myFunc() } window.alert(myobj.z); return undefined var myobj = { x: 1, y: 2, z: { omaps: function() { return myobj.x + myobj.y; } } } window.alert(myobj.z); return [object, Object] From the snippets above I get a return with undefined or [object, Object] instead of value 3. How do I return the value I expected? Do I do it right or wrong?
has answer: http://stackoverflow.com/a/29840392
upvote count: 0
has comment: http://stackoverflow.com/comment/47808747
has title: How To call a Function from an Object Method that call parent properties
has comment: http://stackoverflow.com/comment/47803835
has comment: http://stackoverflow.com/comment/47803788

http://stackoverflow.com/comment/47703889
type: QuestionComment
comment on: http://stackoverflow.com/q/29787028
has text: @Phil why it won't? either window.URL is defined and it will be picked, or window.webkitURL is defined then it will pick that one.
score: 0
type: Comment

http://stackoverflow.com/a/29816818
answers question: http://stackoverflow.com/q/29815125
has comment: http://stackoverflow.com/comment/47772864
has body: Better way to do this in angular is filter your tiles array based on selected tag filter. {{tile.name}} // add image here too
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29815125
type: Answer
has comment: http://stackoverflow.com/comment/47771674
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47767568

http://stackoverflow.com/a/29710214
has body: You should load jQuery, and just one version, before Bootstrap. Bootstrap's JavaScript plugins need jQuery loaded first for them to work.
type: Answer
answers question: http://stackoverflow.com/q/29710040
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29710040

http://stackoverflow.com/q/29786751
has answer: http://stackoverflow.com/a/29787065
has answer: http://stackoverflow.com/a/29786800
downvote count: 0
has title: Issue in storing angular js response in global variable
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
upvote count: 1
has body: I am making an http call to my controller through angular.js and trying to store the response in one global variable like below. app.controller('dashBoardController', ['$scope', '$http', '$location', function ($scope, $http, $location) { $scope.details = []; var init = function () { $http({ method: 'GET', url: urlpath + '/values' }).success(function (response) { $scope.workouthistory = JSON.stringify(response); $scope.details = response; console.log($scope.details) }); } init(); alert($scope.details) ]); But when I try to print the response that I stored globally in an array I am getting an blank response. But, the console inside the method prints the response correctly. Kindly, help me figure out how to store this response globally.
score: 1
type: Question
answer count: 2

http://stackoverflow.com/comment/47763297
type: QuestionComment
has text: What about `history.back()`...?
comment on: http://stackoverflow.com/q/29818024
score: 0
type: Comment

http://stackoverflow.com/q/29792767
tagged with: jquery
favorite count: 0
has title: animation in text, hide text right to left is mounted
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29793170
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47714684
tagged with: javascript
has body: I want to do a animation in text, hide text right to left, but the letters is mounted after animation... I know that I can use a white-space: nowrap but I need it see as a paragraph how I can animated this text without mounted letters? JSfiddle Example setTimeout(function () { $("#title").animate({width: 'hide'}); $("#description").animate({width: 'hide'}); $("#text1").animate({width: 'hide'}); },2000); .bold{ font-size: 48px; color: black; width: 400px; } .normal{ font-size: 48px; color: black; width: 400px; } #container{ width: 452px; height: 625px; } #description{ margin-top: 40px; margin-bottom: 50px; } #description,#text1{ margin-left: 25px; } 1231231231123 asd asd as da sd asdfsdfasdfasd asd fsadf asdf asdfasdf. aaaaaaaaaaaaaaaa aaaaaaaaaaaa
has comment: http://stackoverflow.com/comment/47714866
has comment: http://stackoverflow.com/comment/47714573
has comment: http://stackoverflow.com/comment/47714550
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47714468

http://stackoverflow.com/a/71885612
has body: For completeness sake: You technically can do this within the context of Redis, using the EVAL command. This would get all keys according to the post:* pattern, then sort the keys, and use them to MGET all the items. EVAL "local keys = redis.call('KEYS','post:*'); if (table.getn(keys) == 0) then return {} end; table.sort(keys); return redis.call('MGET',unpack(keys));" This approach can increase performance, but manipulating Redis using LUA scripts might feel inelegant. There are also issues with the KEYS command, and some safety considerations with EVAL of course. I would say that the "Proper Redis Way" to solve this, would be to design a "composite data structure" around the use case: // a scoreless sorted set can be used as an index SET post:1500 <value> ZADD posts_index 0 post:1500 // Whenever you need a sorted (range) of items, you first check the index ZRANGE posts_index - + BYLEX ZRANGE posts_index [posts:1000 (posts:2000 BYLEX The sorted set posts_index is just a set of all the keys in the post "namespace". Of course, if you set TTLs or remove items from cache, you will need to manage this for the posts_index set as well. The result of ZRANGE is sorted, and can be used to GET/MGET items The advantage of this over client-side sorting is performance: It's pre-sorted, and you can split it into ranges, use cursors to only hold a few items in memory at a time, etc.
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29711600
type: Answer
upvote count: 2

http://stackoverflow.com/q/29837896
has body: I've created some code to pass back percentage of video watched metrics to an analytics platform. The code I have is working, but I'm having an issue with IE in that it will show both my duration and currentTime as NaN. I found this stackoverflow post about loadedmetadataevent: Problem retrieving HTML5 video duration, but I'm having difficulty adding it to my code so that it will work correctly. Question is: how do I wrap the timeupate event within a loadedmetadata event so that I can be certain that I have a value for duration when a user clicks the video? In a lot of cases there are multiple videos on the page, so to help illustrate the problem, I've created a JSfiddle. I've tried distilling down the entire code file into just the part that matters. jQuery('video').each(function () { var $video = jQuery(this); $video.on('timeupdate', function (event) { console.log(event.target.duration); console.log(event.target.currentTime); }); }); FULL CODE: /*jslint browser:true*/ var $videos = jQuery('video'), _ = { getParamFromInputLink: function (inputLink, param) { var match = (new RegExp("[?\\x26]" + param + "\\x3d([^\\x26]*)")).exec(inputLink); return match &amp;&amp; decodeURIComponent(match[1].replace(/\+/g, " ")); }, getVideo: function () { var videoSource = this.attr('src') || this.children().first().attr('src'), videoName = _.getParamFromInputLink(videoSource, 'n').split('.')[0].replace(/-/g, ' ').toLowerCase() || document.title; return { name: videoName }; }, getInteractionType: function (percentWatched) { return { '0%': '100', '25%': '101', '50%': '101', '75%': '101', '100%': '103' }[percentWatched]; }, onTimeUpdate: function (event) { var lastPercentageWatched = event.data.lastPercentageWatched, videoTitle = event.data.videoName, currentTime = event.target.currentTime, duration = event.target.duration, videoRemaining = duration - currentTime, videoCompletedBuffer = duration * 0.05, videoHasCompleted = 1, currentVideoPercentage = (Math.floor(currentTime / duration…
type: Question
has answer: http://stackoverflow.com/a/29869336
tagged with: javascript
tagged with: html5-video
score: 0
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29869336
tagged with: http://stackoverflow.com/tag/html
has title: HTML5 video: wrapping timeupdate event with loadedmetadata event
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/2221029

http://stackoverflow.com/q/29773484
score: 2
favorite count: 0
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/29773837
answer count: 1
has title: How to make a temporary cache in HTML 5
has body: I'm looking to make a temporary cache in HTML5, I want to cache my website only for 5 or 6 minutes, and then the cache will be deleted automatically from the user's browser ? using of course Application cache. Is that possible, if not what's the better way to give an offline version to users, an offline version that can be updated.
tagged with: html5-appcache
tagged with: caching
tagged with: browser-cache
downvote count: 0
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/29696636
score: 5
has comment: http://stackoverflow.com/comment/47530280
has comment: http://stackoverflow.com/comment/47529398
has comment: http://stackoverflow.com/comment/47529455
accepted answer: http://stackoverflow.com/a/29696809
answer count: 1
upvote count: 5
has comment: http://stackoverflow.com/comment/47529262
tagged with: javascript
has comment: http://stackoverflow.com/comment/47529434
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47529361
has body: I have a situation where I need to make 5 ajax calls. The second ajax call will be made after first call returns response, the third call is made when second call completes and likewise fourth and fifth call. There are 2 approach for this which I know, I could nest ajax calls on success of previous call or make async false before first call and make it true after last call. Could any one suggest which is and WHY it is the better way to accomplish my task or there is some more better way to do this. //First Way $.ajax({ ... success:function(){ $.ajax({ ... success:function(){ $.ajax({ ... success:function(){ $.ajax({ ... success:function(){ do something } }); } }); } }); } }); //second way $.ajaxSetup({ async: false }); $.ajax({ }); $.ajax({ }); $.ajax({ }); $.ajax({ }); $.ajax({ }); $.ajaxSetup({ async: true });
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/29696809
favorite count: 0
tagged with: ajax
type: Question
has title: Best approach for dependent ajax calls in jQuery

http://stackoverflow.com/a/29705927
type: Answer
has body: Asynchronously call your check function within the "done" function handler. Keep track of how many requests have completed, and only do your processing once that's equal to the total number of expected requests. if (PreSaveValidation()) { var allChangesSucceeded = true; var length = $(".editable-unsaved").length; var completedCount = 0; // ... $(".editable-unsaved").each( function() { // ... $.get("WS/AverageSalary.ashx", data).done(function (data) { completedCount++; if (data != "1") { $(this).removeClass("editable-unsaved"); // don't set all changes succeeded to true here } else { alert('fail'); allChangesSucceeded = false; } isComplete(length, completedCount, allChangesSucceeded); }); }); } function isComplete(totalLength, currentLength, allChangesSucceeded) { if (currentLength == totalLength) { // should this be !allChangesSucceeded? if (allChangesSucceeded) CancelChanges(); } }
score: 0
answers question: http://stackoverflow.com/q/29705755

http://stackoverflow.com/comment/47549369
comment on: http://stackoverflow.com/a/29706787
has text: https://jsfiddle.net/qsdn9qxa/. This is one using jquery val() method. Please tick as correct answer if this answer helped you.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/47618989
has text: And the `++bar;` evaluates to 2, which is then what the containing block `{ }` evaluates to, (i.e. it's last statement.), which is why it returns `2`.
type: AnswerComment
comment on: http://stackoverflow.com/a/29743014
type: Comment
score: 4

http://stackoverflow.com/comment/47700914
type: AnswerComment
has text: @Stevo looks as though you got it. I should have just posted the answer instead of a comment, durn. Good luck!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29785562

http://stackoverflow.com/q/29813268
tagged with: google-maps
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29813357
accepted answer: http://stackoverflow.com/a/29813357
type: AnsweredQuestion
has body: i got the code of drawing polylines in google maps from here but i want to get the focus on the map according to the latitude and longitude, so i added this line -> map.setCenter(new google.maps.LatLng(-122.5868225097656,45.56117947133065)); but the polyline didn't appear because the latitude and longitude are outside the screen and the line which i added (map.setCenter) didn't change anything here is the code: Simple Polylines
downvote count: 1
has title: focusing on google maps api according to latitude and longitude
type: Question
score: -1

http://stackoverflow.com/a/29816891
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47764296
has comment: http://stackoverflow.com/comment/47854285
has comment: http://stackoverflow.com/comment/47854323
has comment: http://stackoverflow.com/comment/47764498
type: Answer
accepted answer of: http://stackoverflow.com/q/29816785
has comment: http://stackoverflow.com/comment/47765614
has comment: http://stackoverflow.com/comment/47762848
answers question: http://stackoverflow.com/q/29816785
has comment: http://stackoverflow.com/comment/47762559
upvote count: 3
has body: Try to see in Firebug or a developer console the real ID of datepicker. JSF adds the form's ID to the element, like "formID:datepicker", so if you do $('#datepicker'), jquery can't find it.
score: 3
has comment: http://stackoverflow.com/comment/47854756
has comment: http://stackoverflow.com/comment/47761862

http://stackoverflow.com/comment/47639662
type: Comment
has text: I will try this. I am using a node server as the backend. I noticed that node logges the GET on the angular.js before it does the jquery. Can I assume this is the order that node is serving the files? Also can I assume this is the order that my browser is loading them as well?
score: 0
comment on: http://stackoverflow.com/a/29708467
type: AnswerComment

http://stackoverflow.com/q/29762300
downvote count: 0
favorite count: 0
tagged with: css
possible better answer: http://stackoverflow.com/a/29762567
type: AnsweredQuestion
has title: Knockout Conditional Formatting for Observable Number Not Working
has answer: http://stackoverflow.com/a/29762567
score: 1
has body: I have a situation in which I'd like to conditionally format the background colour of a certain area based on the value of an object. In this case, it's a piece of furniture and its serialNumber. Of course, this is simplified, as really I would like a triple condition. Whether the value is 0,1,or 2, but I can't even get it working with a simpler condition. No idea why it's not working. It seems as though it should be simple enough. Here's a fiddle for you: http://jsfiddle.net/Lxh8e9qv/1/ HTML &lt;tr data-bind="foreach: furnitures" id="furnitureArea" data-bind="style: { backgroundColor: serialNumber &gt; 1 ? 'red' : 'grey' }"&gt; JavaScript var Room = function (name, furnitures) { var self = this; self.name = ko.observable(name); self.furnitures = ko.observableArray([]); self.serialNumber = ko.observable(); ...
has answer: http://stackoverflow.com/a/29762404
upvote count: 1
tagged with: knockout.js
type: Question
accepted answer: http://stackoverflow.com/a/29762404
tagged with: javascript
answer count: 2
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47589509
type: Comment
has text: Hi Michelek, Thanks for replying. The problem here is , the call to changeCentralData is not happening at all. I placed an alert statement at the start of the function and i dont see that call happening. Toggle i commented out too but i cld not see the call happening to the function
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29727787

http://stackoverflow.com/q/29770969
upvote count: 13
has answer: http://stackoverflow.com/a/73413301
has title: Slick carousel right to left
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/55648645
score: 13
has answer: http://stackoverflow.com/a/73086682
type: Question
accepted answer: http://stackoverflow.com/a/29771080
has body: I've setup slick carousel to continuously scroll, however I need to to scroll in the oposite direction. Adding the RTL option didn't seem to work. Fiddle here (currently left to right) http://jsfiddle.net/mth2ghod/ $(function(){ $('.slider').slick({ speed: 10000, autoplay: true, autoplaySpeed: 100, cssEase: 'linear', slidesToShow: 1, slidesToScroll: 1, variableWidth: true }); });
has answer: http://stackoverflow.com/a/57660375
answer count: 11
has answer: http://stackoverflow.com/a/78006938
has answer: http://stackoverflow.com/a/54930160
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/47177081
has answer: http://stackoverflow.com/a/73603113
favorite count: 0
has answer: http://stackoverflow.com/a/73131780
has answer: http://stackoverflow.com/a/29771080
has answer: http://stackoverflow.com/a/76356506
has comment: http://stackoverflow.com/comment/112411606
tagged with: carousel
has answer: http://stackoverflow.com/a/55648645

http://stackoverflow.com/q/29705405
answer count: 2
possible better answer: http://stackoverflow.com/a/29705508
has comment: http://stackoverflow.com/comment/47546617
downvote count: 0
has answer: http://stackoverflow.com/a/29705508
tagged with: javascript
has comment: http://stackoverflow.com/comment/47546364
has comment: http://stackoverflow.com/comment/47546527
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47546352
has answer: http://stackoverflow.com/a/29705582
has title: Insert values into a database using javascript and php
has body: I'm trying to retrieve data from a html table based on which check box is checked function updtBask() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } var table = document.getElementById("mytable"); var chkBox = document.getElementById("1"); //for (var i = 1, row; row = table.rows[i].cells[4]; i++) { if (chkBox.checked) { var imgOne = document.getElementById("mytable").rows[1].cells[0].innerHTML; var prcOne = document.getElementById("mytable").rows[1].cells[1].innerHTML; var nameOne = document.getElementById("mytable").rows[1].cells[2].innerHTML; var descOne = document.getElementById("mytable").rows[1].cells[3].innerHTML; } then send this data to a php file which then inserts these values into a database. xmlhttp.open("POST","updateBasket.php"+{imgOne :imgOne, prcOne: prcOne, nameOne: nameOne, descOne: descOne},true); xmlhttp.send(); My php is as follows &lt;?php //create connection $con = mysqli_connect("csmysql.cs.cf.ac.uk", "c1427641", "adnog9","c1427641"); //get variables from javascript $one = $_POST["imgOne"]; $two = $_POST["prcOne"]; $three =$_POST["nameOne"]; $four = $_POST["descOne"]; // command to execute $command= "INSERT INTO basket (image, price, name, description) VALUES ('$one', '$two', '$three', '$four')" //execute command $result = mysqli_query($con, $command) //close connection mysql_close($con) ?&gt; I'm new to JavaScript so I may be completely wrong here.
upvote count: 1
tagged with: php
accepted answer: http://stackoverflow.com/a/29705582
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47546316
type: Question

http://stackoverflow.com/comment/47618394
comment on: http://stackoverflow.com/q/29742688
has text: Show us the code. Opera Mini handles negative margins well, so that by itself can't be the problem.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/29762014
has body: If you look at the plugin documentation(look at the success option), the success method gets the form object as the 4th parameter success Callback function to be invoked after the form has been submitted. If a 'success' callback function is provided it is invoked after the response has been returned from the server. It is passed the following arguments: 1.) responseText or responseXML value (depending on the value of the dataType option). 2.) statusText 3.) xhr (or the jQuery-wrapped form element if using jQuery &lt; 1.4) 4.) jQuery-wrapped form element (or undefined if using jQuery &lt; 1.4) So var edit_form = { url: 'asdf/asdf', dataType: 'json', success: function (output, status, xhr, $form) { console.log('x',$form, status); $form.css("border-color", "green"); setTimeout(function () { $form.css("border-color", "#323131"); }, 3000); }, error: function (xhr, status, error, $form) { console.log($form) $form.css("border-color", "red"); setTimeout(function () { $form.css("border-color", "#323131"); }, 3000); } }; $('.twitch-form').ajaxForm(edit_form); Demo: Fiddle
answers question: http://stackoverflow.com/q/29761898
has comment: http://stackoverflow.com/comment/47656072
accepted answer of: http://stackoverflow.com/q/29761898
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47655930
has comment: http://stackoverflow.com/comment/47655897
type: Answer
has comment: http://stackoverflow.com/comment/47656005
upvote count: 2
has comment: http://stackoverflow.com/comment/47655952

http://stackoverflow.com/q/29802472
score: 1
tagged with: angularjs-ng-template
type: Question
has answer: http://stackoverflow.com/a/29803713
accepted answer: http://stackoverflow.com/a/29803713
has title: Route with multiple modules an inline views not working - $http interceptor possibly causing errors
tagged with: angular-http-interceptors
tagged with: javascript
upvote count: 1
answer count: 1
tagged with: ngroute
has body: I'm working in a project with Angular. The idea is to have different modules and each one of them will be able to register its own routes. The partials will be all within the same HTML inline. However it is not working... Here is the plunkr http://plnkr.co/edit/n3q1FW95LD24XqTF37aZ The code is something like: &lt;body ng-class="{loaded: loaded}" ng-app="Stream" ng-controller="StreamCtrl"&gt; &lt;div id="wrapper" ng-show="loaded"&gt; &lt;div ng-view&gt;&lt;/div&gt; &lt;/div&gt; &lt;script type="text/ng-template" id="welcome.html"&gt; From the template &lt;/script&gt; &lt;/body&gt; And the JS: (function() { "use strict"; angular.module("Default", ["ngRoute"]) .config( ["$httpProvider", "$routeProvider", "$locationProvider", function ($httpProvider, $routeProvider, $locationProvider) { $routeProvider .when("/mee", { templateUrl: "partials/welcome.html" }) .when("/mee/index", { templateUrl: function(params){ console.log("Getting partial url"); return "partials/welcome.html" } }) ; } ]) ; })(); (function() { "use strict"; angular.module("Stream", [ "Default" ]) .config(["$locationProvider", function($locationProvider) { }]) .run(function($rootScope, $log, $window) { $log.info("Setting the application status as loaded!"); $rootScope.loaded = true; }); })(); The full code not working can be seen in plunkr...
favorite count: 0
tagged with: angularjs
linked to: http://stackoverflow.com/q/16747705
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/a/29800809
answers question: http://stackoverflow.com/q/29720177
score: 0
has body: Not really an answer, but an idea to get you started is to start logging everything on the Flash side to see where the breakage is. Since you're using IE, I recommend getting the Debug flash player, installing it, then running Vizzy along side to show your traces. Should give you a good idea of where the app is breaking down. Vizzy Debug Player
type: Answer

http://stackoverflow.com/q/29706738
has answer: http://stackoverflow.com/a/29707092
type: UnansweredQuestion
has title: Multiple JavaScript libraries with multiple dependencies
has comment: http://stackoverflow.com/comment/47549543
has comment: http://stackoverflow.com/comment/47549299
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29706864
type: Question
has comment: http://stackoverflow.com/comment/47549647
tagged with: javascript
has comment: http://stackoverflow.com/comment/47549185
answer count: 2
upvote count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47549151
has comment: http://stackoverflow.com/comment/47549691
favorite count: 0
has body: I am writing a web app which uses 2 different JavaScript libraries each with a different Jquery version dependency. How can I specify the Jquery version to use with each library?

http://stackoverflow.com/a/29713078
has comment: http://stackoverflow.com/comment/47561467
type: Answer
answers question: http://stackoverflow.com/q/29712971
accepted answer of: http://stackoverflow.com/q/29712971
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47561688
has comment: http://stackoverflow.com/comment/47561599
has comment: http://stackoverflow.com/comment/47561751
has comment: http://stackoverflow.com/comment/47561622
has comment: http://stackoverflow.com/comment/47561403
has comment: http://stackoverflow.com/comment/47561499
has comment: http://stackoverflow.com/comment/47561533
upvote count: 1
type: AcceptedAnswer
has body: I believe this is the correct way to implement parameters when using a resource factory: app.factory('movieService',function ($resource) { return $resource('https://itunes.apple.com/us/rss/topmovies/limit=50/genre=:id/json', {id: '@id'}, { query: { method: 'GET', isArray:true, params: {id: '@id'} } }); }); This can be simplified to: app.factory('movieService',function ($resource) { return $resource('https://itunes.apple.com/us/rss/topmovies/limit=50/genre=:id/json', {id: '@id'}); }); To call this get method you would need to do the following. Note the parameters that are used in the get method. app.controller('TestCrtl', function ($scope, movieService) { $scope.classicMovies = function(){ movieService.query({id: 4403}, function(result){ $scope.movies = result; }); } $scope.anctionMovies = function(){ movieService.query({id: 4404}, function(result){ $scope.movies = result; }); } }); Additionally, it should be noted that the resource method call is going to return a promise. You can either set it from the return value of the get method, like you did above (The status of the promise isn't guaranteed), or you can set it in the callback, which guarantees that the promise is resolved.

http://stackoverflow.com/a/29815078
score: 9
has comment: http://stackoverflow.com/comment/57801590
has body: When you declare an array with a size Array(1024); You are doing so that it allocates space for 1024 elements. It has to allocate this space up-front, because this form of declaring an array is an optimization stating "I need you to reserve 1024 locations so that you aren't constantly resizing the array as I push more elements onto it". As you probably know, declaring an array with simply [] still allows you to push unlimited number of elements onto it, however the array is silently being resized (most likely memcpy()) behind the scenes to allow this behaviour. EDIT: The reason you get much higher iterations in your second example, is because you are now using a sparse array. With a sparse array doing var arr = [] arr[1000000] = 1; Does not mean your array is now using 1,000,000 entries in memory. Contrast this to a dense array var arr = Array(1000000); Which explicitly tells the runtime to reserve an array that can store 1000000 entries in memory. Related StackOverflow question: https://stackoverflow.com/a/1510842/276949
answers question: http://stackoverflow.com/q/29814940
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/134281528
type: Answer
accepted answer of: http://stackoverflow.com/q/29814940
upvote count: 10
downvote count: 1

http://stackoverflow.com/comment/47628118
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29699795
has text: @Yakov: need more help?

http://stackoverflow.com/a/29703255
has body: Try this: var subCatContainer = $(".sub-category-container"); subCatContainer.scroll(function() { subCatContainer.scrollLeft($(this).scrollLeft()); }); DEMO
answers question: http://stackoverflow.com/q/29702952
score: 0
has comment: http://stackoverflow.com/comment/47542362
type: Answer

http://stackoverflow.com/a/29744968
has comment: http://stackoverflow.com/comment/47622464
downvote count: 0
has body: Checkout the following: ChartJS Highcharts Chartist Flot for jQuery I have used ChartJS and Highcharts - the latter is extremely full featured and gives a lot of control. Have also used Harry Plotter which is really lightweight and easy to use, but doesn't provide a great deal of styling control.
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29744803

http://stackoverflow.com/comment/47810038
type: QuestionComment
comment on: http://stackoverflow.com/q/29841736
score: 0
has text: Yeap I tried Illustrator and it also outputs this base64 gibberish. I guess I just need to create vector images from scratch.
type: Comment

http://stackoverflow.com/a/29762896
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47657629
has comment: http://stackoverflow.com/comment/47657690
upvote count: 1
has body: With width given as px, you really cannot resize it, unless you use some javascript/jquery! So if it is really important you to mention width in px you just can achieve it through jquery/javascript. So if you agree to mention it in % then definitely you can manage it through CSS as below: #wrapper{ position: relative;//no need to change this width: 50%; word-wrap: break-word;//apply this. height: auto; } DEMO
answers question: http://stackoverflow.com/q/29762690

http://stackoverflow.com/q/29724842
has title: Simple comparison condition is not working in JavaScript function
type: AnsweredQuestion
has body: I stored some values in input hidden elements in HTML &lt;input type="hidden" class="w_e_t_t_c_d" value="1659" /&gt; &lt;input type="hidden" class="w_e_t_t_c_d" value="1569" /&gt; &lt;input type="hidden" class="w_e_t_t_c_d" value="1699" /&gt; &lt;input type="hidden" class="w_e_t_t_c_d" value="500" /&gt; &lt;div id="max_num"&gt;&lt;/div&gt; Then I am trying to access maximum value by this JavaScript function function decre_incoming_troops() { //Selecting all elements of class w_e_t_t_c_d var incoming_troops = $('input:hidden.w_e_t_t_c_d'); var lastReach = 0; for(var i = 0; i &lt; incoming_troops.length; i++) { if(incoming_troops[i].value &gt; lastReach) { lastReach = incoming_troops[i].value; } document.getElementById("max_num").innerHTML = lastReach; } } decre_incoming_troops(); But unexpectedly this function is not giving maximum value. I debugged it in detail and fined that this if(incoming_troops[i].value &gt; lastReach) comparison condition is returning wrong result. I don't know that is there any bug or logical error in the code. Here is running example in FIDDLE Or you can check the same here in snippet below function decre_incoming_troops() { //Selecting all elements of class w_e_t_t_c_d var incoming_troops = $('input:hidden.w_e_t_t_c_d'); var lastReach = 0; for(var i = 0; i &lt; incoming_troops.length; i++) { if(incoming_troops[i].value &gt; lastReach) { lastReach = incoming_troops[i].value; } document.getElementById("max_num").innerHTML = lastReach; } } decre_incoming_troops(); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"&gt;&lt;/script&gt; &lt;input type="hidden" class="w_e_t_t_c_d" value="1659" /&gt; &lt;input type="hidden" class="w_e_t_t_c_d" value="1569" /&gt; &lt;input type="hidden" class="w_e_t_t_c_d" value="1699" /&gt; &lt;input type="hidden" class="w_e_t_t_c_d" value="500" /&gt; &lt;div id="max_num"&gt;&lt;/div&gt; Thank you in advance.
answer count: 2
has comment: http://stackoverflow.com/comment/47584092
has answer: http://stackoverflow.com/a/29724880
tagged with: javascript
duplicate of: http://stackoverflow.com/q/5630123
score: 0
has answer: http://stackoverflow.com/a/29724883
accepted answer: http://stackoverflow.com/a/29724883
linked to: http://stackoverflow.com/q/5630123
possible better answer: http://stackoverflow.com/a/29724880
type: Question

http://stackoverflow.com/comment/47827198
type: Comment
comment on: http://stackoverflow.com/a/29806126
type: AnswerComment
has text: no you don't need to add everything normally it works out of the box. This is only a bug with Ext.form.field.Display
score: 0

http://stackoverflow.com/q/29826104
has comment: http://stackoverflow.com/comment/47778946
linked to: http://stackoverflow.com/q/11258888
upvote count: 2
duplicate of: http://stackoverflow.com/q/11258888
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47778714
has answer: http://stackoverflow.com/a/29827360
tagged with: java
has title: Generate Javascript popup alert from Java
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47778535
has comment: http://stackoverflow.com/comment/47778456
has body: How can I generate a Javascript popup from within Java? I am using the wicket/jquery library. I tried the below but it failed with an alert method not found error import javax.script.*; public class ExecuteScript { public static void main(String[] args) throws Exception { // create a script engine manager ScriptEngineManager factory = new ScriptEngineManager(); // create a JavaScript engine ScriptEngine engine = factory.getEngineByName("JavaScript"); // evaluate JavaScript code from String engine.eval("alert(\"Test\")"); } }
score: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47779728
type: Question
tagged with: wicket

http://stackoverflow.com/a/29784711
upvote count: 3
answers question: http://stackoverflow.com/q/29783602
has body: Your module isn't being loaded because the function you create is never executed. Looks like you are missing () right before the final ; in your script. This fixes it for me: (function() { var app = angular.module("sampleApp", ["firebase"]) app.controller("SampleCtrl", function($scope, $firebaseObject) { var ref = new Firebase("https://fiery-inferno-4208.firebaseio.com/data"); var syncObject = $firebaseObject(ref); syncObject.$bindTo($scope, "data"); }); })();
downvote count: 0
has comment: http://stackoverflow.com/comment/47784060
has comment: http://stackoverflow.com/comment/47745826
type: Answer
score: 3

http://stackoverflow.com/comment/47536116
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29700047
score: 0
has text: Hmm.. It's been a long time since the last time I used PHP. However, I think you can return submitted data from PHP and check it in your js callback if it return success or not. Right ?

http://stackoverflow.com/comment/47558217
type: QuestionComment
has text: Check the link you gave, I actually tried that option too.. same thing the ng-model doesn't get update with the change in value via the jquery plugin (clockface)
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29711143

http://stackoverflow.com/comment/47593075
score: 0
has text: @webduvet Looks like what I have above was introduced in v 42. If you update you will get the behavior I show above. Looks like Chrome IS wrong :)
comment on: http://stackoverflow.com/q/29729067
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47633162
has text: Your code looks fine for me. But, i need to get the name attribute dynamically (0 to 4) in '$(".0")' here.
comment on: http://stackoverflow.com/a/29749978
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29705651
score: 1
tagged with: calendar
type: Question
has answer: http://stackoverflow.com/a/29705938
accepted answer: http://stackoverflow.com/a/29705938
tagged with: javascript
has body: i've created a website with a date-picker calender But the calendar is hardcoded as 365 divs with 365 div IDs and text inside. How do i make a "real" calender that works* and then i can style it to look and behave (with javascript) like the one i've simulated (created with divs) ? :) Now it is created like: &lt;div id = "calender"&gt; &lt;div id = "january1"&gt; 1 &lt;/div&gt; &lt;div id = "january2"&gt; 1 &lt;/div&gt; ... &lt;/div&gt; I want a real calendar which generates the right amount of days in a month for all years...
upvote count: 1
answer count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: HTML working calendar
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/q/29832013
has comment: http://stackoverflow.com/comment/47790585
has body: I come from a ruby/rails background, so I am having some trouble wrapping my mind around the backbone course exercises on UDEMY. Can someone tell me if I am making any errors, and how to fix them if so? This exercise was about collections and I need the output to be the console.logs var Vehicle = Backbone.Model.extend({ default: { registrationNumber: "XXX-XXX", color: "beige" } urlRoot: "/api/vehicle", start: function(){ console.log("Vehicle started"); } }); var Vehicles = Backbone.Collection.extend({ model: Vehicle, url:"api/vehicles" }); var vehicles = new Vehicles([ new Vehicle({car1: {registrationNumber = "XLI887", color = "Blue"} }), new Vehicle({car2: {registrationNumber = "ZNP123", color = "Blue"}}), new Vehicle({car3: {registrationNumber = "XUV456", color = "Grey"}}) ]); var blueCars = vehicles.where({ color: "Blue"}); var specificRegistration = vehicles.where({ registrationNumber:"XLI887"}); console.log("blue cars:", blueCars); console.log("Registration #:", specificRegistration); console.log("to JSON:", vehicles.toJSON());
tagged with: javascript
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/47791021
favorite count: 0
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/47790734
has comment: http://stackoverflow.com/comment/47790667
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29832123
accepted answer: http://stackoverflow.com/a/29832123
downvote count: 0
score: 1
has title: Learning backbone.js. Am I handling collections correctly?
type: Question

http://stackoverflow.com/a/29795143
has body: I'll not recommend you to do that, but if you want to: $('body').on('blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu', function(e) { // Your code here }); Reference: https://github.com/jquery/jquery/blob/master/src/event/alias.js#L6
type: Answer
upvote count: 3
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/29795060